Click or drag to resize

Telogis.GeoBase.GeomUtil

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
GeomUtil Class

Contains mathematical utility functions for manipulating spatial data.

Functions
NameDescription
closestPointOnLineFromPoint (LatLon p1, LatLon p2, LatLon point)

Calculates the closest point on the line A to B from the point given.

Arguments
  • p1 (LatLon) - The latitude-longitude coordinates of the start point of the line.

  • p2 (LatLon) - The latitude-longitude coordinates of the end point of the line.

  • point (LatLon) - The latitude-longitude coordinates to measure distance from.

Returns

LatLon - The closest LatLon.

closestPointOnSetOfLines (LatLons latlons, LatLon latlon)

Calculates the closest point on a set of lines from the LatLon given.

Arguments
  • latlons (LatLons) - The LatLon coordinates of the lines.

  • latlon (LatLon) - The latitude-longitude coordinates to measure distance from.

Returns

LatLon - The closest LatLon.

convexPolygonsIntersect (Array polygon1, Array polygon2)

Tests if two convex polygons are intersecting.

Arguments
  • polygon1 (Array) - An array of Point representing a polygon. The array must be ordered so that two consecutive values represent an edge of the polygon.

  • polygon2 (Array) - An array of Point representing a polygon. The array must be ordered so that two consecutive values represent an edge of the polygon.

Returns

Boolean - True if the polygons intersect and false otherwise.

findDistanceToEndOfPath (LatLons path)

Calculates the distance to the end of a path.

Arguments
  • path (LatLons) - The LatLon coordinates of the lines.

Returns

Number - The calculated distance in meters.

pointInsideConvexPolygon (Point point, Array polygon)

Tests if a point is inside the bounds of a polygon. On the edge of the polygon is considered inside.

Arguments
  • point (Point) - The test point.

  • polygon (Array) - An array of Point representing a polygon. The array must be ordered so that two consecutive values represent an edge of the polygon.

Returns

Boolean - True if the point is inside the polygon and false otherwise.