Skip to main content
Playgrounds

TerraTracer Playground

Interactive web app for converting bearing + distance sequences to GIS polygon maps with Leaflet.js visualization

March 18, 2026

TerraTracer Playground

Interactive web app at /playground/terratracer that converts bearing + distance sequences from land certificates into GIS polygon maps.

How to Use

  1. Set Tie Point — Enter starting latitude/longitude in decimal degrees
  2. Add Segments — Enter bearing (degrees) and distance (feet) for each leg of the boundary description
  3. Calculate — Click “Calculate Polygon” to draw the boundary on the map
  4. Export — Download as KML (Google Earth), GeoJSON (GIS tools), or copy coordinates

Technical Details

Geodesic Math

Uses haversine forward geodesic (spherical Earth, R = 6,371,000m):

destinationPoint(lat, lng, bearingDeg, distanceMeters):
  angular_distance = distance / EARTH_RADIUS
  lat2 = asin(sin(lat)*cos(ang) + cos(lat)*sin(ang)*cos(bearing))
  lng2 = lng + atan2(sin(bearing)*sin(ang)*cos(lat), cos(ang) - sin(lat)*sin(lat2))

Accuracy: <0.1% error for claims under 50km. Full WGS84/Karney accuracy available in the Python CLI.

Map

  • Library: Leaflet.js 1.9.4 (CDN, no npm dependency)
  • Tiles: CARTO dark basemap
  • Features: Polygon drawing, clickable vertices, area/perimeter overlay

Export Formats

  • KML: XML format for Google Earth — coordinates in longitude,latitude,altitude order
  • GeoJSON: Standard GIS interchange format — [longitude, latitude] coordinate arrays
  • Clipboard: Plain text latitude, longitude per line

Demo Data

Pre-populated with a 4-segment rectangle near Washington DC:

  • N 0° 0’ 0” (North) × 1000 ft
  • N 90° 0’ 0” (East) × 500 ft
  • S 0° 0’ 0” (South) × 1000 ft
  • S 90° 0’ 0” (West) × 500 ft

Known Limitations

  • Haversine (sphere) not Karney (ellipsoid) — fine for typical claims, not for continent-scale
  • Area calculation uses simplified projection — may be inaccurate for very large polygons
  • DMS input path exists but demo uses DD; DMS edge cases may be undertested
  • No PDF OCR integration yet (planned)

Source

  • Page: src/pages/playground/terratracer.astro (1442 lines)
  • Dependencies: Leaflet.js 1.9.4 (CDN only)
  • Auth: Public (no login required)
terratracerplaygroundgeospatialleafletkmlgeojsonmap