Please make sure, you arrange your parameters like this:
Longitude 1, Latitude 1, Altitude 1 (optional), Longitude 2, Latitude 2, Altitude 2 (optional)
You can either specify 4 or 6 parameters
If you are using the default constructor with two dimensional positions (lng + lat only), please use the constructor like this:
BBox(lng1, lat1, lng2, lat2);
Returns true if a point is on a line. Accepts an optional parameter to ignore the
start and end vertices of the LineString.
The ignoreEndVertices=false controls whether to ignore the start and end vertices.
epsilon is the Fractional number to compare with the cross product result.
It's useful for dealing with floating points in lng/lat
example:
Unit of measurement factors using a spherical (non-ellipsoid) earth radius.
Keys are the name of the unit, values are the number of that unit in a single radian
Calculates the bounding box for any geoJson object, including FeatureCollection.
If recompute is not set and the bbox is not null, the function uses the bbox of the given GeoJSONObject.
Converts any bearing angle from the north line direction (positive clockwise)
and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line
Takes a ring and return true or false whether or not the ring is clockwise
or counter-clockwise.
Takes a Feature<LineString> orLineString or a List<Position> to be
evaluated.
example:
booleanContains returns true if the second geometry is completely contained
by the first geometry.
The interiors of both geometries must intersect and, the interior and
boundary of the secondary must not intersect the exterior of the primary.
booleanContains returns the exact opposite result of the booleanWithin.
example:
Determine whether two geometries of the same type have identical X,Y coordinate values.
See http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htmprecision=6 sets decimal precision to use when comparing coordinates.
With direction set to true, even if the LineStrings are reverse versions
of each other but they have similar Positions, they will be considered the
same. If shiftedPolygon is true, two Polygons with shifted Positions
are considered the same.
Returns true if the objects are equal, false otherwise
example:
Takes a Point, and a Polygon or MultiPolygonand determines if the
Point resides within the Polygon. The Polygon can be convex or concave.
The function accounts for holes. By taking a Feature<Polygon> or a
Feature<MultiPolygon>. ignoreBoundary=false should be set to true if
Polygon's boundary should be ignored when determining if the Point is
inside the Polygon, otherwise, false.
example:
Returns true if the first GeoJSONObject is completely within the second GeoJSONObject.
The interiors of both geometries must intersect and, the interior and boundary
of the primary (geometry a) must not intersect the exterior of the secondary
(geometry b). booleanWithin returns the exact opposite result of booleanContains.
Removes redundant coordinates from any GeometryType.
Takes a Feature or GeometryTypemutate allows GeoJSON input to be mutated
Returns the cleaned input Feature
example:
clusterEach
Takes a FeatureCollection, a dynamic property key/value used to create clusters,
and a ClusterEachCallback method that takes (cluster, clusterValue, currentIndex) and
Returns void.
For example:
Reduces clusters in Features, similar to Iterable.reduce
Takes a geojson, a dynamic porperty, a GeoJSONObject's property key/value
used to create clusters, a ClusterReduceCallback method, and an initialValue to
use as the first argument to the first call of the callback.
Returns the value that results from the reduction.
For example:
convertArea(numarea, [dynamicoriginalUnit = Unit.meters, dynamicfinalUnit = Unit.kilometers])
→ num
Converts a area to the requested unit.
Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares
createBins
Takes a FeatureCollection geojson, and dynamic property key whose
corresponding values of the Features will be used to create bins.
Returns Map<String, List
Takes a Point and calculates the location of a destination point given a distance in
degrees, radians, miles, or kilometers; and bearing in degrees.
This uses the Haversine formula to account for global curvature.
For example:
Calculates the distance between two Points in degrees, radians, miles, or kilometers.
This uses the Haversine formula to account for global curvature.
For example:
Takes a feature or set of features and returns all positions as Points.
Takes GeoJSONObject input.
Returns FeatureCollection<point> representing the exploded input features
Throws Exception if it encounters an unknown geometry type
Reduces flattened features in any GeoJSONObject, similar to Iterable.reduce.
Takes a FeatureCollection, Feature, or Geometry
a FlattenReduceCallback method that takes (previousValue, currentFeature, featureIndex, multiFeatureIndex),
an initialValue Value to use as the first argument to the first call of the callback.
Returns the value that results from the reduction.
For example:
Get Cluster
Takes a FeatureCollection<Feature> and a dynamicfilter used on GeoJSON properties
to get Cluster.
Returns a FeatureCollection single cluster filtered by GeoJSON Properties
For example:
Returns if point is on the segment between start and end.
Borrowed from booleanPointOnLine to speed up the evaluation (instead of
using the module as dependency).
start is the coord pair of start of line, end is the coord pair of end
of line, and point is the coord pair of point to check.
Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees
Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet
Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians
Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
Takes any LineString or Polygon and returns the intersecting Point.
removeDuplicates=true removes duplicate intersections,
ignoreSelfIntersections=false ignores self-intersections on input features
Returns a FeatureCollection<Point> containing point(s) that intersect both
example:
Takes any LineString, MultiLineString, Polygon or MultiPolygon and
returns the overlapping lines between both features.
feature1 first feature
feature2 second feature
tolerance tolerance distance to match overlapping line segments, default is 0
unit the unit in which the tolerance is expressed, default is kilometers
returns FeatureCollection<LineString> lines(s) that are overlapping between both features
Takes a line, at a start point startPt, and a stop point stopPt
and returns a subsection of the line in-between those points.
The start & stop points don't need to fall exactly on the line.
Converts LineString to Polygon
Takes a optional boolean autoComplete that auto completes LineStrings
Takes an optional orderCoords that sorts LineStrings to place outer
ring at the first Position of the coordinates.
Takes two Points and returns a point midway between them.
The midpoint is calculated geodesically, meaning the curvature of the
earth is taken into account.
For example:
Takes a reference Point and a FeatureCollection of Features
with Point geometries and returns the
point from the FeatureCollection closest to the reference. This calculation
is geodesic. For example:
Properties contains filter (does not apply deepEqual operations)
Takes a Mapproperties value, and a Map filter and
Returns bool if filter does equal the properties
For example
Reduces properties in any GeoJSONObject into a single value,
similar to how Iterable.reduce works. However, in this case we lazily run
the reduction, so List of all properties is unnecessary.
Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.
Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
Takes two Point and finds the bearing angle between them along a Rhumb line
i.e. the angle measured in degrees start the north line (0 degrees)
kFinal calculates the final bearing if true.
Returns bearing from north in decimal degrees, between -180 and 180 degrees (positive clockwise)
example:
Iterates over 2-vertex line segment in any GeoJSON object, similar to Iterable.forEach
(Multi)Point geometries do not contain segments therefore they are ignored during this operation.
Reduces 2-vertex line segment in any GeoJSON object, similar to Iterable.reduce
(Multi)Point geometries do not contain segments therefore they are ignored during this operation.
Takes a Feature or FeatureCollection and truncates the precision of the geometry.
precision sets the coordinate decimal precision
coordinates sets the maximum number of coordinates (primarly used to remove z coordinates)
mutate allows GeoJSONObject input to be mutated (significant performance increase if true)
Returns GeoJSONObject layer with truncated geometry
example:
var point = Point(coordinates: Position.of(
70.46923055566859,
58.11088890802906,
1508
));
var truncated = truncate(point, precision: 3, coordinates: 2);
//=truncated.geometry.coordinates => 70.469, 58.111
//addToMap
var addToMap = truncated;
ClusterEachCallback
Takes a FeatureCollection, the cluster being processed, a clusterValue
used to create cluster being processed, and the currentIndex, the index of
current element being processed in the List. Starts at index 0
Returns void.
ClusterReduceCallback
The first time the callback function is called, the values provided as arguments depend
on whether the reduce method has an initialValue argument.
Callback for flattenReduce
The first time the callback function is called, the values provided as
arguments depend on whether the reduce method has an initialValue argument.
If an initialValue is provided to the reduce method: