
geogml.polygon( polygon-or-points as Node[] ) as cts.polygon
Create a cts.polygon value from a sequence of GML
Point elements or a GML Polygon element.
// Create a cts:polygon from a GML Polygon
const geogml = require("/MarkLogic/geospatial/gml");
xdmp.describe(fn.head(
geogml.polygon(
fn.head(xdmp.unquote(
"<gml:Polygon xmlns:gml='http://www.opengis.net/gml/3.2'>" +
"<gml:exterior><gml:LinearRing>" +
"<gml:pos>12.5 -127.24</gml:pos>" +
"<gml:pos>15.25 -127.8</gml:pos>" +
"<gml:pos>13.45 -126.1</gml:pos>" +
"<gml:pos>12.5 -127.24</gml:pos>" +
"</gml:LinearRing></gml:exterior>" +
"</gml:Polygon>"
)).root
)));
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.