Check which points are inside which geofence shapes
Performs point-in-polygon checks for all combinations of shapes and points. Returns only shapes that contain at least one point.
Array of geofence shapes (polygons or circles)
Array of points to check
Optional coordinate system settings
Result with matches (shapes containing points)
Check if a single point is inside any of the given shapes
Convenience method for single-point geofence checks.
Array of geofence shapes
Single point to check
Array of shape IDs that contain the point
Create a circular geofence shape helper
Unique identifier for the geofence
Center coordinate
Radius in meters
GeofenceShape object
Create a rectangular geofence shape helper
Unique identifier for the geofence
Southwest corner coordinate
Northeast corner coordinate
GeofenceShape object with polygon WKT
Filter points to only those inside a shape
Useful for filtering a list of locations to only those within a service area.
Single geofence shape
Array of points to filter
Only points that are inside the shape
const serviceArea = {
id: 'delivery-zone',
wkt: 'POLYGON(...)'
};
const allCustomers = [
{ id: 'c1', coord: { lat: 41.38, lng: 2.17 } },
{ id: 'c2', coord: { lat: 41.50, lng: 2.30 } },
{ id: 'c3', coord: { lat: 41.39, lng: 2.16 } }
];
const eligibleCustomers = await service.filterPointsInShape(
serviceArea,
allCustomers
);
// Returns only customers within the delivery zone
Check if a point is inside a circular zone
Convenience method for circular geofence checks.
Center of the circular zone
Radius of the zone in meters
Point to check
True if point is inside the circle
Check if a point is inside a polygon zone
Convenience method for polygon geofence checks.
Polygon in WKT format
Point to check
True if point is inside the polygon
ProtectedrequestExecutes a generic request to the Cercalia API.
Query parameters for the API request.
Human-readable name for logging and debugging.
OptionalbaseUrl: stringOptional override for the base API URL.
A promise resolving to the parsed API response.
GeofencingService - Point-in-Polygon Geofencing using Cercalia InsideGeoms API
This service checks whether points are inside defined geographic zones (geofences). Essential for delivery zone validation, fleet monitoring, and location-based alerts.
Key Features
Use Cases
Usage Examples
See
https://docs.cercalia.com/docs/cercalia-webservices/geofencing/