line_segment library

Classes

BBox
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);
CoordinateType
Coordinate types, following https://tools.ietf.org/html/rfc7946#section-4
Feature<T extends GeometryObject>
Feature, as specified here https://tools.ietf.org/html/rfc7946#section-3.2
FeatureCollection<T extends GeometryObject>
FeatureCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.3
GeoJSONObject
GeometryCollection
GeometryCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.8
GeometryObject
GeometryType<T>
LineString
LineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.4
MultiLineString
MultiLineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.5
MultiPoint
MultiPoint, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.3
MultiPolygon
MultiPolygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.7
Point
Point, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.2
Polygon
Polygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.6
Position
Please make sure, you arrange your parameters like this:

Functions

lineSegment(GeoJSONObject geoJson, {bool combineGeometries = false}) FeatureCollection<LineString>
Creates a FeatureCollection of 2-vertex LineString segments from a LineString or MultiLineString or Polygon and MultiPolygon Returns FeatureCollection<LineString> 2-vertex line segments For example:
segmentEach(GeoJSONObject geojson, SegmentEachCallback callback, {bool combineNestedGeometries = true}) → void
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.
segmentReduce<T>(GeoJSONObject geojson, SegmentReduceCallback<T> callback, T? initialValue, {bool combineNestedGeometries = true}) → T?
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.

Typedefs

SegmentEachCallback = dynamic Function(Feature<LineString> currentSegment, int featureIndex, int? multiFeatureIndex, int? geometryIndex, int segmentIndex)
SegmentEachCallback
SegmentReduceCallback<T> = T? Function(T? previousValue, Feature<LineString> currentSegment, T? initialValue, int featureIndex, int? multiFeatureIndex, int? geometryIndex, int segmentIndex)
Callback for segmentReduce