Loading TOC...

geo.polygonIntersects

geo.polygonIntersects(
   $polygon as cts.polygon,
   $region as cts.region[],
   [$options as String[]]
) as Boolean

Summary

Returns true if the polygon intersects with a region.

Parameters
$polygon A geographic polygon.
$region One or more geographic regions (boxes, circles, polygons, or points). Where multiple regions are specified, return true if any region intersects the target polygon.
$options Options for the operation. The default is ().

Options include:

Options include:

"coordinate-system=string"
Use the given coordinate system. Valid values are:
wgs84
The WGS84 coordinate system.
raw
The raw (unmapped) coordinate system.
"units=miles"
Distance (for circles) is measured in miles.
"boundaries-included"
Points on boxes', circles', and polygons' boundaries are counted as matching. This is the default.
"boundaries-excluded"
Points on boxes', circles', and polygons' boundaries are not counted as matching.
"boundaries-latitude-excluded"
Points on boxes' latitude boundaries are not counted as matching.
"boundaries-longitude-excluded"
Points on boxes' longitude boundaries are not counted as matching.
"boundaries-south-excluded"
Points on the boxes' southern boundaries are not counted as matching.
"boundaries-west-excluded"
Points on the boxes' western boundaries are not counted as matching.
"boundaries-north-excluded"
Points on the boxes' northern boundaries are not counted as matching.
"boundaries-east-excluded"
Points on the boxes' eastern boundaries are not counted as matching.
"boundaries-circle-excluded"
Points on circles' boundary are not counted as matching.
"boundaries-endpoints-excluded"
Points on linestrings' boundary (the endpoints) are not counted as matching.

Example

// Is Regent's Park within a mile of the American School in London? Yes 

geo.polygonIntersects(
    cts.polygon([
      cts.point(51.5298921,-0.1674557),
      cts.point(51.5327487,-0.1660395),
      cts.point(51.5343504,-0.1644945),
      cts.point(51.5354716,-0.1620483),
      cts.point(51.5367796,-0.1574993),
      cts.point(51.5374737,-0.1526499),
      cts.point(51.5369398,-0.1488304),
      cts.point(51.5351513,-0.1468134),
      cts.point(51.5319478,-0.1460838),
      cts.point(51.5284771,-0.1460409),
      cts.point(51.5253265,-0.1455688),
      cts.point(51.5237779,-0.1450968),
      cts.point(51.5227899,-0.1461697),
      cts.point(51.5233507,-0.1478004),
      cts.point(51.5246323,-0.1483583),
      cts.point(51.5248192,-0.1587868),
      cts.point(51.5266348,-0.1604605),
      cts.point(51.5292514,-0.1644945),
      cts.point(51.5298387,-0.1665545)
    ]),
    cts.circle(1,cts.point(51.5347842,-0.1766932)));

==> true

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy