geo.polygon( polygon-or-points as Node[] ) as cts.polygon
Create a cts.polygon value from a sequence of point nodes in one of the supported markup vocabularies, such as KML or GML.
// Create a cts.polygon from a set of GeoJSON points const geo = require('/MarkLogic/geospatial/geospatial'); geo.polygon([ {type: 'Point', coordinates: [100.0,0.0]}, {type: 'Point', coordinates: [101.0,0.0]}, {type: 'Point', coordinates: [101.0,1.0]}, {type: 'Point', coordinates: [100.0,1.0]}, {type: 'Point', coordinates: [100.0,0.0]} ]);
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.