Spatial GeoJSON Analysis with DuckDB WASM

Perform spatial analysis on remote GeoJSON files using SQL queries with DuckDB's spatial extension.

Enter the URL of a remote GeoJSON file to analyze
Search for a location to center the map and get coordinates
Use {SOURCE} as placeholder for the GeoJSON URL
Initializing DuckDB...
Common Spatial Functions:
  • ST_Read('url') - Read spatial data directly from GeoJSON, Shapefile, etc.
  • ST_Area(geom) - Calculate area of geometry
  • ST_Centroid(geom) - Find centroid of geometry
  • ST_AsText(geom) - Convert geometry to Well-Known Text (WKT)
  • ST_Within(geom1, geom2) - Test if geom1 is within geom2
  • ST_MakeEnvelope(xmin, ymin, xmax, ymax) - Create bounding box
  • ST_Distance(geom1, geom2) - Calculate distance between geometries
  • ST_GeomFromGeoJSON(json) - Convert GeoJSON geometry to DuckDB geometry
Note: Spatial functions require the spatial extension to be loaded.
Query Results
Map Visualization