logoalt Hacker News

thibautgyesterday at 1:03 PM1 replyview on HN

And with PostgREST [0], you can automatically convert any PostGIS table (with geometry or geography column) to GeoJSON by using an "Accept: application/geo+json" header in the request.

[0] https://docs.postgrest.org/en/v14/how-tos/working-with-postg...


Replies

pramseyyesterday at 3:39 PM

At the SQL level, the ST_AsGeoJSON(record) variant will convert a tuple that includes a geometry and any combination of other columns into a GeoJSON output.

show 1 reply