ST_GeomFromGeoJSON

You are viewing an old version of this article. View the current version here.

This article is currently incomplete.

MariaDB starting with 10.2.4

ST_GeomFromGeoJSON was added in MariaDB 10.2.4

Syntax

ST_GeomFromGeoJSON(g[, options]])

Description

Given a GeoJSON input g, returns a geometry object.

Note that this function did not work correctly before MariaDB 10.2.8 - see MDEV-12180.

Examples

SET @j = '{ "type": "Point", "coordinates": [5.3, 15.0]}';

SELECT ST_AsText(ST_GeomFromGeoJSON(@j));
+-----------------------------------+
| ST_AsText(ST_GeomFromGeoJSON(@j)) |
+-----------------------------------+
| POINT(5.3 15)                     |
+-----------------------------------+

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.