Loading TOC...

geo.countDistinctVertices

geo.countDistinctVertices(
   region as cts.region,
   [options as String[]]
) as Number

Summary

Return a count of the distinct number of vertices in a region, taking tolerance into account.

Parameters
region A cts region.
options

Options include:

"coordinate-system=value"
Use the given coordinate system. Valid values are wgs84, wgs84/double, etrs89, etrs89/double, raw and raw/double. Defaults to the governing coordinating system.
"precision=value"
Use the coordinate system at the given precision. Allowed values: float and double. Defaults to the precision of the governing coordinate system.
"units=value"
Measure distance, radii of circles, and tolerance in the specified units. Allowed values: miles (default), km, feet, meters.
"tolerance=distance"
Tolerance is the largest allowable variation in geometry calculations. If the distance between two points is less than tolerance, then the two points are considered equal. For the raw coordinate system, use the units of the coordinates. For geographic coordinate systems, use the units specified by the units option.

Usage Notes

This function returns a count of the distinct number of vertices in a region. It takes into account tolerance. The vertex that closes the ring is only counted once. For a complex polygon this is a count of the vertices in the outer polygon. For points it returns 1, for circles it returns 0, and for boxes it returns the number of distinct points in the set (sw, se, nw, ne).

The value of the precision option takes precedence over that implied by the governing coordinate system name, including the value of the coordinate-system option. For example, if the governing coordinate system is "wgs84/double" and the precision option is "float", then the operation uses single precision.

See Also

Example

geo.countDistinctVertices(
  cts.polygon([cts.point(1,2),cts.point(3,4),cts.point(3,4),
               cts.point(4,5), cts.point(1,2)]) )

// => 3

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