geo.parse( data as Node[] ) as Sequence
Convert nodes in one or more of the supported geospatial representations into cts.region values.
Parameters | |
---|---|
data | Zero or more nodes containing geospatial data in one of the supported formats, such as KML, GML, GeoRSS, or GeoJSON. |
gml.parseGml
or
geojson.parseGeojson
.
The input nodes need not all use the same representation.
The returned Sequence
contains cts:region
values.
const geo = require('/MarkLogic/geospatial/geospatial'); const gmlNode = gml.point(xdmp.unquote( '<gml:Point xmlns:gml="http://www.opengis.net/gml">' + '<gml:pos>12.5 -127.24</gml:pos>' + '</gml:Point>') .next().value.root); const geoJsonNode = { type: 'Polygon', coordinates: [ [[1.0, 5.0], [1.0, 8.0], [6.0, 8.0], [7.0, 5.0], [1.0, 5.0]] ] }; geo.parse([gmlNode, geoJsonNode]) ==> A Sequence that contains a cts.point created from a GML node and a cts.polygon created from a GeoJSON node, similar to the following.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.