Geofence Event Simulator
Find every zone-boundary crossing between timestamped locations and estimate its time by linear interpolation. The simulator checks outer rings and holes, so it can detect an entry and exit even when both recorded samples are outside. Its map is a local, tile-free planar preview.
Key features
- RFC 7946 GeoJSON Polygon and MultiPolygon zones, including interior holes
- Every straight-segment boundary crossing between strictly increasing timestamped samples
- Selectable inside/outside treatment of the boundary and a meter-based sample proximity tolerance
- Tangencies and duplicate vertex hits merged to avoid false entry/exit events
- Route replay with per-zone state, crossing time, coordinates and segment fraction
- Browser-local JSON, CSV and SVG export with bounded, validated input
How to use
- Paste GeoJSON zones and an array of {time,lon,lat} samples, or choose local JSON files. The example crosses an interior hole.
- Choose whether exact boundary points count as inside or outside, and set a 0–100 m sample-boundary tolerance.
- Run the simulation to list each segment crossing and its interpolated UTC time.
- Use Play or the time slider to move the location marker; select a log entry to jump to its crossing.
- Download the event log as JSON or CSV, or save the current map frame as SVG.
Use cases
- Test location-trigger rules before deploying a geofence alert
- Find two crossings hidden between sparse GPS samples
- Verify exit and re-entry when a route traverses a polygon hole
- Compare policies for boundary samples, tangencies and duplicate timestamps
Frequently asked questions
How is a crossing time between samples computed?
The tool joins two recorded longitude–latitude positions with a planar straight segment, finds its intersection fraction with the zone ring, and linearly interpolates the UTC timestamps. It cannot recover the true route, varying speed or a geodesic trajectory.
How do boundary policy and tolerance differ?
The policy says whether a point or interval exactly on a boundary counts as inside or outside. The 0–100 m tolerance classifies samples near a boundary; it does not shift the polygon or the interpolated crossing coordinates.
What if there are no zones or timestamps are unordered?
An empty FeatureCollection yields zero zones and events. Timestamps must increase strictly; reversed, duplicate or malformed times produce an actionable error.
Does touching a vertex create an entry or exit?
No event is recorded if the inside state before and after the touch is unchanged. Duplicate hits at a shared vertex are merged, while travel along a boundary follows the chosen policy.
Can this handle continental routes or the antimeridian?
No. Combined longitude and latitude spans are each limited to 3 degrees, latitude to ±85 degrees, and antimeridian-crossing zones are rejected. The planar model is not a surveying or navigation decision engine.
Are coordinates uploaded?
No. Files and coordinates are processed in this browser tab, without external map tiles. Downloads are created locally only when requested.
Privacy
Zones and route samples remain in the current browser tab. There is no server upload or external map request.
Comments & questions