FromGeoJSON - spectrum_spatial - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-03-07
ft:lastPublication
2025-03-07T10:28:48.112000

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'