Service Area Coverage Validator avatar

Service Area Coverage Validator

Pricing

$1.00 / 1,000 evaluated unique coordinates

Go to Apify Store
Service Area Coverage Validator

Service Area Coverage Validator

Validate customer coordinates against your GeoJSON service zones. Polygon/MultiPolygon, holes, overlap and explicit boundary policies. JSON/CSV results and area summaries; no geocoding or routing API.

Pricing

$1.00 / 1,000 evaluated unique coordinates

Rating

0.0

(0)

Developer

AFK Digital

AFK Digital

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

11 days ago

Last modified

Features

Limited permissions

Share

Match customer coordinates against your own service-area GeoJSON. Find covered locations, overlapping zones, boundaries and coverage gaps without a map account, paid geocoding or routing API.

What this Actor does

  • Validates Polygon and MultiPolygon topology, including interior holes.
  • Matches all service areas using an indexed geometry engine.
  • Reports overlap without silently choosing a zone.
  • Produces a JSON/CSV Dataset, downloadable JSON and CSV, and a per-area summary.
  • Reports invalid customer coordinates separately. Invalid service-area geometry fails the entire run before evaluation or charging.

Membership is a geometric result. It does not guarantee driving time, route access, delivery eligibility or deliverability.

Quick start

Run the prefilled synthetic example. It contains inside, outside, boundary, overlap, hole, invalid and duplicate locations. An empty input object also runs this example. When providing your own data, provide both locations and serviceAreasGeoJson.

Locations JSON:

{"locationsJson":[{"location_id":"customer-1","latitude":1,"longitude":1}],"serviceAreasGeoJson":{"type":"FeatureCollection","features":[{"type":"Feature","id":"zone-A","properties":{},"geometry":{"type":"Polygon","coordinates":[[[0,0],[10,0],[10,10],[0,10],[0,0]]]}}]},"boundaryPolicy":"include","areaPriority":[],"maxLocations":10000}

Files and input fields

InputFormat
locationsJsonArray of objects with latitude, longitude and optional location_id
locationsFileInstead of locationsJson: {"key":"LOCATIONS.csv","storeId":"YOUR_STORE_ID"} or {"content":"latitude,longitude\n1,2"}
serviceAreasGeoJsonInline Polygon, MultiPolygon, Feature or FeatureCollection; or {"key":"AREAS.geojson","storeId":"YOUR_STORE_ID"}
boundaryPolicyinclude (default), exclude, report_only
areaPriorityArea IDs ordered highest first. All matched IDs must be ranked to resolve overlap
sourceStoresSelect each referenced key-value-store ID; grants read-only access under limited permissions
maxLocationsInteger from 1 to 10000; exceeding the cap fails rather than truncates

For store references, also set sourceStores to an array of the referenced store IDs, for example {"sourceStores":["YOUR_STORE_ID"]}. The storage picker grants READ access only to these stores. Files must already be in an Apify key-value store accessible to the run token, or supplied as inline UTF-8 content. Omit storeId to use the run's default store. Arbitrary URLs, local paths, ZIP and compressed files are unsupported. The Actor does not need access to a map service. Only requested records are read.

CSV requires a header with latitude and longitude; location_id is optional. JSON files contain an array, not a FeatureCollection. Decimal strings in location rows are accepted; invalid rows receive invalid_coordinate, no coordinate echo and no charge. Missing IDs use the 1-based input row number. GeoJSON Features need a string/integer id or properties.area_id; standalone geometry gets area-1.

Coordinates and geometry

Supports RFC 7946 WGS84 decimal degrees with GeoJSON positions [longitude, latitude]. Location fields are explicitly named latitude and longitude. Bounds are latitude -90..90 and longitude -180..180. Numeric geometry positions only; optional finite altitude is accepted but ignored for 2D membership. Legacy crs members are rejected: transform source data to RFC 7946 first. No automatic CRS transformation or axis guessing. Swapped coordinates that both remain in range cannot be detected; check your source.

Polygon rings must be closed and contain at least four positions. Self-intersections, invalid/outside holes, zero-area geometry, overlapping MultiPolygon parts, null geometry and duplicate area IDs are rejected. Ring winding direction does not affect membership. No automatic repair, buffering or snapping is applied.

Edges spanning more than 180 degrees longitude are rejected; cut antimeridian-crossing regions into valid parts first. Membership uses straight segments in longitude/latitude coordinate space, as represented in GeoJSON. It does not calculate geodesic distances.

Boundaries and overlaps

PolicyBoundary behavior
includeBoundary is a match, including hole boundaries
excludeBoundary is not a match; boundary_excluded when no interior match exists
report_onlyAny boundary contact produces boundary_review and no assignment

Boundary means exact topological contact at double precision, without a distance tolerance. A point strictly inside a hole is outside that polygon.

matched_area_ids contains all policy-eligible matches, sorted by ID. boundary_area_ids identifies every touched boundary. One match is assigned automatically. Multiple matches keep coverage_status=overlap. Without a complete explicit priority list, assigned_area_id stays null. With complete priority, the highest-ranked match is assigned and the overlap remains visible. Unknown or duplicate priority IDs fail validation.

Output

Each location returns location_id, latitude, longitude, matched_area_ids, assigned_area_id, coverage_status, boundary_status, assignment_reason and evidence_reference, plus boundary_area_ids.

coverage_status: covered, outside, overlap, boundary_excluded, boundary_review, invalid_coordinate. boundary_status: on_boundary, not_on_boundary, not_evaluated. evidence_reference is locations/N, a zero-based row reference in the supplied array or parsed file. Area IDs identify the corresponding source Features. Invalid coordinates are null in outputs.

Dataset exports JSON and CSV through Apify. Key-value-store records:

  • OUTPUT: JSON rows; OUTPUT.csv: spreadsheet-safe CSV.
  • SUMMARY: validation/evaluation counts, delivered counts, boundary policy, complexity and disclaimer.
  • AREA_SUMMARY and AREA_SUMMARY.csv: matched, assigned and boundary location counts by area.
  • VALIDATION_ERROR on rejected input: safe error code with zero evaluated/charged coordinates.

Duplicate location rows remain in output and area row counts. SUMMARY.unique_evaluated_coordinates deduplicates numeric latitude/longitude pairs; 1, 1.0 and "1" normalize to the same value.

Billing

Prepared for one custom pay-per-event unit: evaluated-coordinate. One event represents one successfully evaluated unique coordinate pair per run. Display pricing per 1,000 events. Outside and boundary classifications are successful evaluations. Repeated rows or multiple matching areas do not add events. Invalid location rows and failed service-area validation are never billed. No Actor-start or default-Dataset-item charge is intended.

Charging is batched; when a spending cap permits only part of the result, whole coordinate groups are delivered, including all duplicate rows belonging to those coordinates. Other valid rows are withheld. SUMMARY.withheld_location_count explains incomplete delivery. Area summary counts describe delivered rows. A fresh run evaluates and bills anew. Resurrected runs and any run with existing charge events are rejected to prevent billing replay. A restart can leave a partial failed run; start a new run only after reviewing its charges.

Price: $1.00 per 1,000 successfully evaluated unique coordinates ($0.001 per evaluated-coordinate event). Platform usage is included. No startup or per-Dataset-row fee.

Limits and privacy

10 MiB per UTF-8 file; 20 MiB total resolved input; 10,000 location rows; 500 Features; 100,000 geometry positions; 2,000,000 candidate geometry checks; 10 MiB serialized result JSON (validated before charging); 120-second validation/analysis deadline; 150-second process watchdog; 180-second run timeout. Default memory 512 MB. These are enforced limits, not a guarantee every maximum-sized geometry finishes.

Customer coordinates are intentionally present in private inputs/results, but application logs contain no location values or geometry coordinates. The Actor neither sends them to external map providers nor retains them outside Apify run storage. Access and retention follow the customer's Apify settings. Use synthetic data for public examples.

Development

Python 3.13, apify 3.4.1, Shapely 2.2.0. Run python -m pytest locally after installing pytest. Container entry point: python -m src.main.

References: GeoJSON RFC 7946, Apify pay-per-event.