simplemaplab

Methodology

This page explains the algorithms, data sources, and technical decisions behind every SimpleMapLab tool. If you're evaluating our results for accuracy or building on our approach, this is your reference.

Distance calculation

The Distance Between Two Places tool and all radius-based tools use the Haversine formula — the standard great-circle distance formula on a sphere. It computes the shortest path between two points over the curved surface of the Earth.

The formula assumes a spherical Earth with radius R = 6,371 km (the mean volumetric radius). For distances under 1,000 km, the error vs. the WGS84 ellipsoid is under 0.3%. For longer distances, we use the same formula — the error never exceeds 0.5%.

Radius circles

The Map Radius Tool draws geodesic circles using Turf.js. Each circle is a 64-vertex polygon computed by projecting points at equal angular intervals from the center using the Haversine forward formula. This produces a true circle on the Earth's surface — unlike a naïve pixel-space circle on a Mercator map, which would be distorted at high latitudes.

Area measurement

The Map Area Calculator computes polygon area using Turf.js's geodesic area function, which integrates over the WGS84 ellipsoid. For radius circles, area is also computed as A = πr² on the sphere for cross-validation.

The Population Within Radius tool uses a simpler approach: the shoelace formula with a cos(lat) correction. This is accurate to within 1% for areas under 100,000 sq mi at mid-latitudes.

Drive time isochrones

The Drive Time Map calls the Valhalla routing engine, hosted publicly by FOSSGIS e.V.

How it works

  1. Valhalla loads the full OpenStreetMap road graph.
  2. From the origin point, it performs a Dijkstra-like expansion along connected road segments.
  3. Each segment has a cost (seconds) based on road functional class, speed limit, and length.
  4. Turns add a penalty: left turns across traffic cost more than right turns.
  5. When cumulative cost exceeds the threshold (e.g., 30 min), expansion stops on that branch.
  6. All reachable endpoints are connected into a polygon and smoothed (denoise + generalize).

Speed assumptions

Road typeDriveBikeWalk
Interstate / motorway55–70 mphExcludedExcluded
Highway / trunk45–65 mph15–20 mphExcluded
Arterial / primary30–45 mph12–16 mph3 mph
Residential20–30 mph10–14 mph3 mph
Service / alley10–15 mph8–10 mph3 mph
Path / sidewalkExcluded8–12 mph3 mph

Real-time traffic is not modeled. Results represent free-flow conditions.

Location detection (county/state/ZIP)

The What County Am I In?, What State Am I In?, and What ZIP Code Am I In? tools use a ray-casting point-in-polygon algorithm. Boundary data from the Census Bureau TIGER/Line files is loaded as TopoJSON and converted to GeoJSON features in the browser.

The ray-casting algorithm casts a horizontal ray from the test point and counts polygon edge crossings. An odd number of crossings means the point is inside. This runs in microseconds on modern devices.

Geocoding

Elevation

The Elevation Finder calls the Open-Meteo Elevation API, which returns altitude from the Copernicus 30-meter Digital Elevation Model (DEM).

Atmospheric pressure is calculated using the International Standard Atmosphere (ISA) barometric formula: P = P₀ × (1 − Lh/T₀)^(gM/RL), where L = 0.0065 K/m (lapse rate), T₀ = 288.15 K, g = 9.80665 m/s², M = 0.0289644 kg/mol, R = 8.31447 J/(mol·K).

Time zones

The Time Zone Finder uses the geo-tz library with boundary data from timezone-boundary-builder. DST detection compares January and July UTC offsets using the JavaScript Intl.DateTimeFormat API.

Blank map generation

Maps are generated from TopoJSON using d3-geo projections:

PNG and PDF exports are generated client-side: PNG via HTML Canvas at 2400px, PDF via jsPDF. Nothing is uploaded to a server.

Data sources summary

DataSourceLicense
Map tilesOpenFreeMap (OpenStreetMap)ODbL
Road networkOpenStreetMapODbL
US boundariesCensus Bureau TIGER/Line via us-atlasPublic domain
World boundariesNatural Earth 1:50mPublic domain
ZIP/city/county demographicsCensus ACS via SimpleMapsPublic domain / MIT
ElevationCopernicus 30m DEM via Open-MeteoCC-BY-4.0
Time zonesIANA tz database via timezone-boundary-builderODbL
RoutingValhalla + OSM via FOSSGISMIT / ODbL

Questions?

If you have questions about our methodology or believe a calculation is incorrect, please contact us with details.