FromGeoJSON

Description

Converts a string formatted in GeoJSON (geospatial data interchange format based on JavaScript Object Notation (JSON)) to a Spatial Feature geometry, such as a Point, MultiPoint, LineString, MultiLineString, Polygon, Polygon, MultiPolygon or Geometry Collection. This function deals with the GeoJSON geometry fragment only and assumes it is in the GeoJSON 1.0 syntax. The GeoJSON specification follows the defined JSON from http://geojson.org/geojson-spec.html.

Note: This function is supported only for coordinate system supported by MapInfo.

An example of a GeoJSON string is:

{"type":"Point","coordinates":[100.0,200.0],"crs":{"type":"name","properties":{"name":"epsg:4326"}}}

Syntax

FromGeoJSON (str)

Arguments

str is a GeoJSON string

Example

Returns a Spatial Feature geometry from a GeoJSON-formatted string.

select FromGeoJSON('{"type": "Point", "coordinates": [-71,43.824787,50], "crs": {"type": "name", "properties": {"name": "epsg:4326"}}}') as mi_point from countries where country='Canada'