ToGeoJSON

Description

Converts a Spatial Geometry to its GeoJSON (geospatial data interchange format based on JavaScript Object Notation (JSON)) equivalent. This function converts feature geometry into the corresponding following GeoJSON geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. The GeoJSON specification follows the defined JSON from http://geojson.org/geojson-spec.html.

Syntax

ToGeoJSON (obj)

Arguments

obj is a Spatial Feature geometry

Example

Returns a GeoJSON string from a feature geometry.

select ToGeoJSON(obj) from "/Samples/NamedTables/WorldTable" where country='Madagascar'