coordAll function
Gets all coordinates from any GeoJSONObject. Receives any GeoJSONObject Returns List<Position> For example:
var featureColl = FeatureCollection(features:
[Feature(geometry: Point(coordinates: Position(13,15)))
,Feature(geometry: LineString(coordinates: [Position(1, 2),
Position(67, 50)]))]);
var coords = coordAll(features);
//= [Position(13,15), Position(1, 2), Position(67, 50)]
Implementation
List<Position?> coordAll(GeoJSONObject geojson) {
List<Position?> coords = [];
coordEach(geojson, (
Position? currentCoord,
int? coordIndex,
int? featureIndex,
int? multiFeatureIndex,
int? geometryIndex,
) {
coords.add(currentCoord);
});
return coords;
}