St_AsGeoJSON wkid? #421
-
Does the ST_AsGeoJSON function always output as wkid 4326? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
and is there a way to make it return points back as a different wkid? |
Beta Was this translation helpful? Give feedback.
-
Hello! The |
Beta Was this translation helpful? Give feedback.
Hello! The
ST_AsGeoJSON
andST_GeomFromGeoJSON
, like most functions in DuckDB are agnostic the whatever SRID/WKID the input geometries are in, because DuckDB does not store nor track the SRID of individual geometries or columns. In this case you simply get out whatever you put in, the coordinate data itself just gets converted to/from string, but no other flipping/transformation takes place. If you want to transform the geometries into some other coordinate system you should useST_Transform
and provide both a source and target SRID.