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> cspline(line, options)

Calculate cspline on coordinates

Parameters:
Name Type Description
line Array.<ol.geom.Geometry.coordinate>
options
Properties
Name Type Description
tension Number

a [0,1] number / can be interpreted as the "length" of the tangent, default 0.5

resolution Number

size of segment to split

pointsPerSeg Integer

number of points per segment to add if no resolution is provided, default add 10 points per segment

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

<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.geom.Geometry
Returns:

the center

Type
ol.Coordinate

<static> getIntersectionPoint(d1, d2)

Intersect 2 lines

Parameters:
Name Type Description
d1 Arrar.<ol.coordinate>
d2 Arrar.<ol.coordinate>

<static> GPAltiCode(coord, options)

Calculate elevation on coordinates or on a set of coordinates

Parameters:
Name Type Description
coord ol.coordinate | Array.<ol.coordinate>

coordinate or an array of coordinates

options Object
Properties
Name Type Argument Default Description
projection ol/proj~ProjectionLike <optional>
'EPSG:3857'

geometry projection, default 'EPSG:3857'

sampling number <optional>
0

number of resulting point, max 5000, if none keep input points or use samplingDist

samplingDist number <optional>
0

distance for sampling the line or use sampling if lesser

success string

a function that takes the resulting XYZ coordinates

error string

<static> offsetCoords(coords, offset)

Offset a polyline

Parameters:
Name Type Description
coords Array.<ol.Coordinate>
offset number
See:
Returns:

resulting coord

Type
Array.<ol.Coordinate>

<static> sampleAt(p1, p2, d, start)

Add points along a segment

Parameters:
Name Type Description
p1 ol.Coordinate
p2 ol.Coordinate
d number
start boolean

include starting point, default true

Returns:
Type
Array.<ol.Coordinate>

<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