Loading TOC...

geo.regionClean

geo.regionClean(
   $region as cts.region,
   [$options as String[]]
) as cts.region

Summary

This function fixes various problems with the region or raises an error if it is not repairable. The only relevant fix for MarkLogic is to remove duplicate adjacent vertices in polygons (including inner and outer polygons of complex polygons). The only relevant options are options controlling the coordinate system and the tolerance option.

Parameters
$region A cts region.
$options The tolerance, units, coordinate system.

Options include:

"coordinate-system=name"
Use the named coordinate system. Valid names are wgs84 for the WGS84 coordinate system and raw for the unmapped planar coordinate system
"tolerance"
A tolerance value. For the raw coordinate system, use the units of the coordinate system. For other (geodetic) coordinate systems, use the units specified by the units option. If the tolerance is too fine for the precision, inconsistencies may result and a larger tolerance should be used.
"units=miles"
Distance is measured in miles.

Example

geo.regionClean(
  cts.polygon([
    cts.point(40.1234567890,-120.1234567890),
    cts.point(40.123456543,-120.123456543),
    cts.point(40.12455,-120.123467),
    cts.point(40.13456,-120.1455195)]))

// => a cts.region with the following coordinates:
//    40.123457,-120.12346 40.12455,-120.12347 40.13456,-120.14552
//    40.123457,-120.12346"

Comments

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