HomeTextDataDeveloperFilesMediaUtilities

Geospatial Calculations

Distance, bounding box, radius queries, point-in-polygon testing, and polyline encoding — all with interactive map previews.

🔒 All calculations run locally in your browser. No coordinates are sent to any server.
Haversine formula: Calculates the great-circle distance between two points on a sphere using their latitudes and longitudes. Accuracy is ~0.5% vs the WGS-84 ellipsoid for most practical distances.
Bounding box: A rectangle defined by min/max coordinates that fully contains a circle of the given radius around the center point. Useful for database spatial pre-filtering before exact distance calculations.
Radius query: Generates a ready-to-use spatial query for your database that finds all points within the specified radius of a center coordinate. Combine with a bounding-box pre-filter for better performance.
Ray casting algorithm: Draws an imaginary ray from the point to infinity and counts how many polygon edges it crosses. An odd count means the point is inside.
Google Encoded Polyline: A compact lossy encoding that represents a series of coordinates as a single ASCII string. Used by Google Maps, Mapbox, OSRM, and Valhalla routing APIs.