
geojson:parse-geojson( $geojson as object-node()* ) as cts:region*
Convert GeoJSON object nodes into cts:region values.
| Parameters | |
|---|---|
| geojson | Zero or more JSON object nodes conforming to the GeoJSON specification. |
xquery version "1.0-ml";
import module namespace geojson = "http://marklogic.com/geospatial/geojson"
at "/MarkLogic/geospatial/geojson.xqy";
geojson:parse-geojson(
xdmp:unquote('
{ "type": "Polygon",
"coordinates": [
[[1.0, 5.0], [1.0, 8.0], [6.0, 8.0], [7.0, 5.0], [1.0, 5.0]]
]}
')/object-node()
)
==> A cts:polygon similar to the following:
cts:polygon("5,1 8,1 8,6 5,7 5,1")
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.