Namespace: coordinate

ol. coordinate

Methods


<static> convexHull(points)

Compute a convex hull using Andrew's Monotone Chain Algorithm

Parameters:
Name Type Description
points Array.<ol.geom.Point>

an array of 2D points

Returns:

the convex hull vertices

Type
Array.<ol.geom.Point>

<static> dist2d(p1, p2)

Distance beetween 2 points Usefull geometric functions

Parameters:
Name Type Description
p1 ol.coordinate

first point

p2 ol.coordinate

second point

Returns:

distance

Type
number

<static> equal(p1, p2)

2 points are equal Usefull geometric functions

Parameters:
Name Type Description
p1 ol.coordinate

first point

p2 ol.coordinate

second point

Returns:
Type
boolean

<static> findSegment(pt, coords)

Find the segment a point belongs to

Parameters:
Name Type Description
pt ol.coordinate
coords Array.<ol.coordinate>
Returns:

the index (-1 if not found) and the segment


<static> fromDFCI(index, projection)

Get coordinate from French DFCI index

Parameters:
Name Type Description
index String

the DFCI index

projection ol/proj/Projection

result projection, default EPSG:27572

Returns:

coord

Type
ol/coordinate

<static> getFeatureCenter(f)

Get center coordinate of a feature

Parameters:
Name Type Description
f ol.Feature
Returns:

the center

Type
ol.coordinate

<static> getGeomCenter(geom)

Get center coordinate of a geometry

Parameters:
Name Type Description
geom ol.Feature
Returns:

the center

Type
ol.coordinate

<static> offsetCoords(coords, offset)

Offset a polyline

Parameters:
Name Type Description
coords Array.<ol.coordinate>
offset Number
See:
Returns:

resulting coord

Type
Array.<ol.coordinates>

<static> splitH(geom, y, n)

Split a Polygon geom with horizontal lines

Parameters:
Name Type Description
geom Array.<ol.coordinate>
y Number

the y to split

n Number

contour index

Returns:
Type
Array.<Array.<ol.coordinate>>

<static> toDFCI(coord, level, projection)

Convert coordinate to French DFCI grid

Parameters:
Name Type Description
coord ol/coordinate
level number

[0-3]

projection ol/proj/Projection

of the coord, default EPSG:27572

Returns:

the DFCI index

Type
String

<static> validDFCI(index)

The string is a valid DFCI index

Parameters:
Name Type Description
index string

DFCI index

Returns:
Type
boolean

<static> validDFCICoord(coord, projection)

Coordinate is valid for DFCI

Parameters:
Name Type Description
coord ol/coordinate
projection ol/proj/Projection

result projection, default EPSG:27572

Returns:
Type
boolean