Playgrounds
TerraTracer Playground
Interactive web app for converting bearing + distance sequences to GIS polygon maps with Leaflet.js visualization
TerraTracer Playground
Interactive web app at /playground/terratracer that converts bearing + distance sequences from land certificates into GIS polygon maps.
How to Use
- Set Tie Point — Enter starting latitude/longitude in decimal degrees
- Add Segments — Enter bearing (degrees) and distance (feet) for each leg of the boundary description
- Calculate — Click “Calculate Polygon” to draw the boundary on the map
- 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,altitudeorder - GeoJSON: Standard GIS interchange format —
[longitude, latitude]coordinate arrays - Clipboard: Plain text
latitude, longitudeper 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)
Related
- TerraTracer Project — Full project detail page
- GitHub Repository — Python CLI with full WGS84 accuracy