Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.32 KB

st_asgeojson.md

File metadata and controls

36 lines (23 loc) · 1.32 KB
description
This section contains reference documentation for the ST_AsGeoJSON function.

ST_AsGeoJSON

Returns the GeoJSON representation of the given geometry or geography.

Signature

ST_AsGeoJSON(geometryObject)

ArgumentsDescription
geometryObjectA geometry or geography object.

Usage Examples

select stAsGeoJSON( STPOINT(-122, 37) ) AS value
from ignoreMe
value
{"type":"Point","coordinates":[-122,37],"crs":{"type":"name","properties":{"name":"EPSG:0"}}}
select stAsGeoJSON( ST_GeogFromText('LINESTRING (30 10, 10 30, 40 40)') ) AS value
from ignoreMe 
value
{"type":"LineString","coordinates":[[30,10],[10,30],[40,40]],"crs":{"type":"name","properties":{"name":"EPSG:4326"}}}