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<
| Field | Description |
|---|---|
NN | Region index (00–99, A0–Z9) |
PP | Point index within the region (00–29) |
C | Last point flag: 1 = not last point, U = last point |
LAT | Latitude in WGS-84: sign (+/-) + 7 digits (degrees and decimals × 100000) |
LON | Longitude in WGS-84: sign (+/-) + 8 digits (degrees and decimals × 100000) |
HH | First left-neighbor point index (00–29, or 99 if none) |
II | Second left-neighbor point index (00–29, or 99 if none) |
Parameters
- A polygonal region is defined point by point; each
SGRcommand configures one point. - Use
C=Uon 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=99andII=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<
Related Signals
- Signals
R00–RZ9indicate membership in each region G40= region enter,G41= region exit- Use with ED to create geofence events