Class: Geo

Geo


new Geo()

The object to provide geographical data and methods.
Warning: The coordinate reference system is WGS 84 witch uses the coordinate order [longitude,latitude]!
Changing the coordinate reference system (CRS) is not supported yet.

Classes

BoundaryBox
Feature
FeatureCollection
GeometryCollection
LineString
MultiLineString
MultiPoint
MultiPolygon
Point
Polygon

Methods


<static> detectAsGeometry(geometry)

Takes an array and puts it into a GeoJSON geometry definition. If it geometry already is a valid GeoJSON it will only be returned

Parameters:
Name Type Description
geometry Array | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.Point | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection
Returns:
Type
boolean | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.Point | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection

<static> edgeIntersectsBounds(edge, bounds)

Checks whether an edge intersects a boundary box or not

Parameters:
Name Type Description
edge Array
bounds Array
Returns:
Type
boolean

<static> edgeIntersectsEdge(edge1, edge2 [, allowOnEdge])

Method checks whether an edge intersects another edge

Parameters:
Name Type Argument Default Description
edge1 Array

A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]]

edge2 Array

A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]]

allowOnEdge boolean <optional>
true

also counts it as intersection if the edge is on the other edge

Returns:
Type
boolean

<static> edgeIntersectsLineString(edge, lineString)

The method checks whether a edge intersects a lineString or not. The polygon will be auto closed

Parameters:
Name Type Description
edge Array

A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]]

lineString Array

A line representation i.e. [[1,2],[2,3],[4,4],[1,2]]

Returns:
Type
boolean

<static> edgeIntersectsPolygon(edge, polygon)

The method checks whether a edge intersects a polygon or not. The polygon will be auto closed

Parameters:
Name Type Description
edge Array

A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]]

polygon Array

A polygon representation i.e. [[1,2],[2,3],[4,4],[1,2]]

Returns:
Type
boolean

<static> edgeWithinPolygon(edge, polygon)

The method checks whether a edge is inside a polygon or not. The polygon will be auto closed

Parameters:
Name Type Description
edge Array

A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]]

polygon Array

A polygon representation i.e. [[1,2],[2,3],[4,4],[1,2]]

Returns:
Type
boolean

<static> lineStringWithinLineString(lineString, inLineString)

TODO: ALSO needs to return true for [[1,1],[2,2,]] and [[0,0],[4,4]] // probably needs a rewrite Checks whether a line follows another line or is on the line respectively

Parameters:
Name Type Description
lineString Array

An array of points, i.e. [[1,1],[1,2],[1,3]]

inLineString Array

An array of points, i.e. [[1,1],[1,2],[1,3]]

Returns:
Type
boolean

<static> pointWithinBounds(point, bounds)

Checks whether a point is inside a boundary box or not

Parameters:
Name Type Description
point Array
bounds Array
Returns:
Type
boolean

<static> pointWithinLineString(point, lineString)

The method checks whether a point is on a line string path or not.

Parameters:
Name Type Description
point Array

A point representation i.e. [1,2]

lineString Array

A line string path representation i.e. [[1,2],[2,3],[4,4],[1,2]]

Returns:
Type
boolean

<static> pointWithinPolygon(point, polygon)

The method checks whether a point is inside a polygon or not. The polygon will be auto closed

Parameters:
Name Type Description
point Array

A point representation i.e. [1,2]

polygon Array

A polygon representation i.e. [[1,2],[2,3],[4,4],[1,2]]

Returns:
Type
boolean