JMap.Geometry.bboxIntersect
Returns true if the first bbox intersect the second one.
The first boundary box
The second boundary box
JMap.Geometry.checkBbox
Throw an error if the provided parameter is not a valid boundary box.
The bbox object to check
JMap.Geometry.checkCircle
Throw an error if the provided parameter is not a valid circle.
The circle object to check
JMap.Geometry.checkLine
Throw an error if the provided parameter is not a valid polygon.
The line object to check
JMap.Geometry.checkLocation
Throw an error if the provided parameter is not a valid location.
The location object to check
JMap.Geometry.checkPolygon
Throw an error if the provided parameter is not a valid polygon.
The polygon array to check
JMap.Geometry.convertArea
Converts the distance from a unit to another.
the output unit
the input unit
JMap.Geometry.convertLength
Converts the distance from a unit to another.
the distance to convert
the output unit
the input unit
JMap.Geometry.getArea
Works for feature having geometry equals to Polygon or a MultiPolygon.
It returns the area in square meters.
Throw an error if the provided feature geometry is not a Polygon or a MultiPolygon.
The Polygon or MultiPolygon feature
JMap.Geometry.getBboxFromFeature
Returns the feature geometry boundary box (JBoundaryBox).
A feature object
JMap.Geometry.getBboxFromFeatures
Returns the boundary box that contains all features
array of features
JMap.Geometry.getBboxFromLine
Returns the line boundary box.
A line array
JMap.Geometry.getBboxFromPolygon
Returns the polygon boundary box.
A polygon array
JMap.Geometry.getCentroid
Returns a point feature representing the centroid of the provided feature or featureCollection.
a feature or a feature collection
JMap.Geometry.getFeatureFromWkt
Returns a GeoJSON feature from a Well-Known Text geometry representation.
a Well-Known Text geometry
JMap.Geometry.getLineLength
Works for feature having geometry equals to LineString or a MultiLineString.
It returns the line length in the desired units (default in kilometers).
Throw an error if the provided feature geometry is not a LineString or a MultiLineString.
The LineString or MultiLineString feature to measure.
Can be "degrees", "radians", "miles", or "kilometers" (default)
JMap.Geometry.getNormalizedBbox
Returns a normalized bbox that can be used in query string. The input bbox must be expressed in degrees and must also respect the convention of sw longitude being numerically smaller than ne longitude
A bbox that spans more than 360 degrees will be normalized as [-180,
A bbox which easting coordinates are not in the range -360<-->+360 will be translated to respect valid coordinates
The OGC define rules for bboxes that cross the antimeridian, stating that for such a bbox, the westmost coordinate must be expressed as a positive number.
For instance, this bbox: [-190, 42, -70, 50] would be expressed as [170, 42, -70, 50] in OGC-compliant syntax. Some services require that bboxes respect that syntax, but JS cartographic APIs and frameworks often use the non OGC-compliant format
The ogcCompliant parameter ensures that the returned bbox will be expressed in the good form.
JMap.Geometry.getPolygonFeature
Returns a polygon feature from coordinates.
If the coordinates are not closed the method will close it automatically.
the polygon coordinates (closed or not closed)
if true will close the coordinates (if needed)
JMap.Geometry.getPolygonFeatureFromBbox
Returns a polygon feature corresponding to the boundary box.
A boundary box
JMap.Geometry.getPolygonFeatureFromCircle
Returns a polygon feature from a circle object (JCircle).
A circle object
unit of the radius
JMap.Geometry.getRotatedFeature
Returns the feature with geometry rotated from the centroid.
the feature
from -360 to 360 degrees
JMap.Geometry.getPolygonFeature
Returns true if the geometry type match the Layer geometry type, else false.
the JMap layer id
JMap.Geometry.isValidBbox
Returns false if the provided parameter is not a valid boundary box.
The bbox object to check
JMap.Geometry.isValidGeometry
Returns true if the provided geometry is valid.
The given geometry object to test
JMap.Geometry.isValidLocation
Returns false if the provided parameter is not a valid location.
The location object to check
JMap.Geometry.lineIntersect
Returns true if the line feature geometry intersects the other feature geometry.
A line feature
A feature (can be not a line)
JMap.Geometry.polygonIntersect
Returns true if the polygon feature geometry intersects the other feature geometry.
A polygon feature
A feature (can be not a polygon)
JMap.Geometry
This section contains geometry related methods.
JMap geometry service is based on turfjs implementation.