Spatial SQL
Run DuckDB queries with spatial and H3 extensions on Parquet files from mapular-mpoi using the mapular-geo server.
The mapular-geo server is DuckDB with spatial and H3 extensions. Use it to query, aggregate, and export Parquet files downloaded by mapular-mpoi.
No credentials needed. Works with files in /tmp, $TMPDIR, and ~/Downloads.
Tools
query(sql)
Run a DuckDB SQL statement. Returns a file path and preview rows.
export(sql, format)
Export SQL results to parquet, csv, or geojson.
geocode(address)
Convert a free-form address to lat/lon. Returns lat, lon, display_name, confidence, and provider.
Examples
Filter by category
SELECT name, latitude, longitude
FROM read_parquet('/tmp/pois.parquet')
WHERE overture_group_secondary = 'health'
LIMIT 20
Proximity query
SELECT name, latitude, longitude,
ST_Distance(
ST_Point(longitude, latitude),
ST_Point(13.377, 52.516)
) AS dist_deg
FROM read_parquet('/tmp/pois.parquet')
WHERE ST_DWithin(
ST_Point(longitude, latitude),
ST_Point(13.377, 52.516),
0.005
)
ORDER BY dist_deg
H3 aggregation
SELECT
h3_latlng_to_cell(latitude, longitude, 7) AS h3_index,
COUNT(*) AS poi_count
FROM read_parquet('/tmp/pois.parquet')
GROUP BY 1
ORDER BY poi_count DESC
LIMIT 10
Export to GeoJSON
export(
sql="SELECT name, latitude, longitude FROM read_parquet('/tmp/pois.parquet') LIMIT 100",
format="geojson"
)
Geocode an address
geocode("Brandenburg Gate, Berlin")
→ { lat: 52.5163, lon: 13.3777, confidence: "high" }
File path restrictions
query restricts file reads to the system temp directory (/tmp or $TMPDIR) and ~/Downloads. To allow an additional path, set MAPULAR_GEO_DATA_DIR=/path/to/data in the server's environment.