CrunchyData / pg_featureserv

Lightweight RESTful Geospatial Feature Server for PostGIS in Go
Apache License 2.0
462 stars 91 forks source link

output crs always 4326? #142

Open wendellwt opened 1 year ago

wendellwt commented 1 year ago

Question: How does one specify the output srid of the geometry response from feature server?

This issue says that "pg_featureserve CRS support is a work-in-progress", but that may be an old issue. There were more discussions here but I could not determine the result.

When using the table definition:

RETURNS TABLE ( flw_geog geometry(geometry,102004) )

Non of these attempts produce desired results:

ST_SetSRID(ST_Transform(trajectory(t.flown_path)::geometry,102004),102004) as flown_track
ST_SetSRID(ST_Transform(trajectory(t.flown_path)::geometry(geometry,4326),102004),102004) as flown_track
ST_SetSRID(ST_Transform(trajectory(t.flown_path)::geometry,102004)::geometry,102004) as flown_track

The data seems to be properly converted to 102004 (Lambert Conformal Conic), but featureserve insists on converting it to 4326. Is there a way to stop that conversion?

dr-jts commented 1 year ago

The response CRS can be specified by using the request parameter crs=SRID.

See documentation here.

wendellwt commented 1 year ago

Great! Thank you.