Skip to main content

GR — Regions

Configures polygonal geofence regions. The device supports up to 360 regions (R00–RZ9). Each region is defined by a series of latitude/longitude points forming a closed polygon.

Format

  • Query: >QGR{NN}{PP}<
  • Set point: >SGR{NN}{PP}{C}{LAT}{LON}{HH}{II}<
  • Set (undefine region): >SGR{NN}U<
  • Response (defined point): >RGR{NN}{PP}{C}{LAT}{LON}{HH}{II}<
  • Response (undefined): >RGR{NN}{PP}U<
FieldDescription
NNRegion index (0099, A0Z9)
PPPoint index within the region (0029)
CLast point flag: 1 = not last point, U = last point
LATLatitude in WGS-84: sign (+/-) + 7 digits (degrees and decimals × 100000)
LONLongitude in WGS-84: sign (+/-) + 8 digits (degrees and decimals × 100000)
HHFirst left-neighbor point index (0029, or 99 if none)
IISecond left-neighbor point index (0029, or 99 if none)

Parameters

  • A polygonal region is defined point by point; each SGR command configures one point.
  • Use C=U on the last point of the polygon.
  • To undefine a region, use >SGR{NN}U<.
  • A valid region needs at least 3 points.
  • Point indexes should be assigned from lower to higher longitude (left to right on a north-up map).
  • If a point has no left neighbors, use HH=99 and II=99.

Examples

Define point 00 of region R00 (not last point):

>SGR00001+2578250-080281309999<

Query region R00, point 0:

>QGR0000<
>RGR00001+2578250-080281309999<

Undefine region R00:

>SGR00U<
  • Signals R00RZ9 indicate membership in each region
  • G40 = region enter, G41 = region exit
  • Use with ED to create geofence events