Methods
-
<static> convexHull(points)
-
Compute a convex hull using Andrew's Monotone Chain Algorithm
Parameters:
Name Type Description pointsArray.<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 lineArray.<ol.geom.Geometry.coordinate> optionsProperties
Name Type Description tensionNumber a [0,1] number / can be interpreted as the "length" of the tangent, default 0.5
resolutionNumber size of segment to split
pointsPerSegInteger 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 p1ol.Coordinate first point
p2ol.Coordinate second point
Returns:
distance
- Type
- number
-
<static> equal(p1, p2)
-
2 points are equal Usefull geometric functions
Parameters:
Name Type Description p1ol.Coordinate first point
p2ol.Coordinate second point
Returns:
- Type
- boolean
-
<static> findSegment(pt, coords)
-
Find the segment a point belongs to
Parameters:
Name Type Description ptol.Coordinate coordsArray.<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 indexString the DFCI index
projectionol/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 fol.Feature Returns:
the center
- Type
- ol.coordinate
-
<static> getGeomCenter(geom)
-
Get center coordinate of a geometry
Parameters:
Name Type Description geomol.geom.Geometry Returns:
the center
- Type
- ol.Coordinate
-
<static> getIntersectionPoint(d1, d2)
-
Intersect 2 lines
Parameters:
Name Type Description d1Arrar.<ol.coordinate> d2Arrar.<ol.coordinate> -
<static> GPAltiCode(coord, options)
-
Calculate elevation on coordinates or on a set of coordinates
Parameters:
Name Type Description coordol.coordinate | Array.<ol.coordinate> coordinate or an array of coordinates
optionsObject Properties
Name Type Argument Default Description projectionol/proj~ProjectionLike <optional>
'EPSG:3857' geometry projection, default 'EPSG:3857'
samplingnumber <optional>
0 number of resulting point, max 5000, if none keep input points or use samplingDist
samplingDistnumber <optional>
0 distance for sampling the line or use sampling if lesser
successstring a function that takes the resulting XYZ coordinates
errorstring -
<static> offsetCoords(coords, offset)
-
Offset a polyline
Parameters:
Name Type Description coordsArray.<ol.Coordinate> offsetnumber - See:
Returns:
resulting coord
- Type
- Array.<ol.Coordinate>
-
<static> sampleAt(p1, p2, d, start)
-
Add points along a segment
Parameters:
Name Type Description p1ol.Coordinate p2ol.Coordinate dnumber startboolean 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 geomArray.<ol.Coordinate> ynumber the y to split
nnumber contour index
Returns:
- Type
- Array.<Array.<ol.Coordinate>>
-
<static> toDFCI(coord, level, projection)
-
Convert coordinate to French DFCI grid
Parameters:
Name Type Description coordol/coordinate levelnumber [0-3]
projectionol/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 indexstring DFCI index
Returns:
- Type
- boolean
-
<static> validDFCICoord(coord, projection)
-
Coordinate is valid for DFCI
Parameters:
Name Type Description coordol/coordinate projectionol/proj/Projection result projection, default EPSG:27572
Returns:
- Type
- boolean