Loading TOC...

MarkLogic 12 EA 1 Product Documentation
geo.polygonToLinestring

geo.polygonToLinestring(
   region as cts.region
) as Sequence

Summary

Construct a linestring from the vertices of a polygon, or construct a sequence of linestrings from the outer and inner polygons of a complex polygon.

Parameters
region A cts.polygon or cts.complexPolygon from which to generate a linestring or linestrings.

Usage Notes

The vertex that closes the loop is excluded from the result linestring(s).

An error is thrown if any of the input values is not a polygon or complex polygon.

The return Sequence contains cts.linestring values.

See Also

Example

const geo = require("/MarkLogic/geospatial/geospatial");

geo.polygonToLinestring(
  cts.polygon([
    cts.point(1,1),cts.point(2,2),
    cts.point(3,3),cts.point(1,1)
  ])
)

// A Sequence containing a cts.linestring
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.