Package com.mapbox.turf
Class TurfMeta
java.lang.Object
com.mapbox.turf.TurfMeta
Class contains methods that are useful for getting all coordinates from a specific GeoJson
geometry.
- Since:
- 2.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.FeatureCollection featureCollection, boolean excludeWrapCoord) Get all coordinates from aFeatureCollectionobject, returning aListofPointobjects.static List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.Feature feature, boolean excludeWrapCoord) Get all coordinates from aFeatureobject, returning aListofPointobjects.static List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.LineString lineString) Get all coordinates from aLineStringobject, returning aListof Point objects.static List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.MultiLineString multiLineString) Get all coordinates from aMultiLineStringobject, returning aListof Point objects.static List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.MultiPoint multiPoint) Get all coordinates from aMultiPointobject, returning aListof Point objects.static List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.MultiPolygon multiPolygon, boolean excludeWrapCoord) Get all coordinates from aMultiPolygonobject, returning aListof Point objects.static List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.Point point) Get all coordinates from aPointobject, returning aListof Point objects.static List<com.mapbox.geojson.Point>coordAll(com.mapbox.geojson.Polygon polygon, boolean excludeWrapCoord) Get all coordinates from aPolygonobject, returning aListof Point objects.static com.mapbox.geojson.PointgetCoord(com.mapbox.geojson.Feature obj) Unwrap a coordinatePointfrom aFeaturewith aPointgeometry.
-
Method Details
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.Point point) Get all coordinates from aPointobject, returning aListof Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before usingcoordAll(com.mapbox.geojson.Point).- Parameters:
point- anyPointobject- Returns:
- a
Listmade up ofPoints - Since:
- 2.0.0
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.MultiPoint multiPoint) Get all coordinates from aMultiPointobject, returning aListof Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before usingcoordAll(com.mapbox.geojson.Point).- Parameters:
multiPoint- anyMultiPointobject- Returns:
- a
Listmade up ofPoints - Since:
- 2.0.0
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.LineString lineString) Get all coordinates from aLineStringobject, returning aListof Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before usingcoordAll(com.mapbox.geojson.Point).- Parameters:
lineString- anyLineStringobject- Returns:
- a
Listmade up ofPoints - Since:
- 2.0.0
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.Polygon polygon, @NonNull boolean excludeWrapCoord) Get all coordinates from aPolygonobject, returning aListof Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before usingcoordAll(com.mapbox.geojson.Point).- Parameters:
polygon- anyPolygonobjectexcludeWrapCoord- whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration- Returns:
- a
Listmade up ofPoints - Since:
- 2.0.0
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.MultiLineString multiLineString) Get all coordinates from aMultiLineStringobject, returning aListof Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before usingcoordAll(com.mapbox.geojson.Point).- Parameters:
multiLineString- anyMultiLineStringobject- Returns:
- a
Listmade up ofPoints - Since:
- 2.0.0
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.MultiPolygon multiPolygon, @NonNull boolean excludeWrapCoord) Get all coordinates from aMultiPolygonobject, returning aListof Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before usingcoordAll(com.mapbox.geojson.Point).- Parameters:
multiPolygon- anyMultiPolygonobjectexcludeWrapCoord- whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. Used to handlePolygonandMultiPolygongeometries.- Returns:
- a
Listmade up ofPoints - Since:
- 2.0.0
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.Feature feature, @NonNull boolean excludeWrapCoord) Get all coordinates from aFeatureobject, returning aListofPointobjects.- Parameters:
feature- theFeaturethat you'd like to extract the Points from.excludeWrapCoord- whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. Used if theFeaturepassed through the method is aPolygonorMultiPolygongeometry.- Returns:
- a
Listmade up ofPoints - Since:
- 4.8.0
-
coordAll
@NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.FeatureCollection featureCollection, @NonNull boolean excludeWrapCoord) Get all coordinates from aFeatureCollectionobject, returning aListofPointobjects.- Parameters:
featureCollection- theFeatureCollectionthat you'd like to extract the Points from.excludeWrapCoord- whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. Used if aFeaturein theFeatureCollectionthat's passed through this method, is aPolygonorMultiPolygongeometry.- Returns:
- a
Listmade up ofPoints - Since:
- 4.8.0
-
getCoord
public static com.mapbox.geojson.Point getCoord(com.mapbox.geojson.Feature obj) Unwrap a coordinatePointfrom aFeaturewith aPointgeometry.- Parameters:
obj- any value- Returns:
- a coordinate
- Since:
- 3.2.0
- See Also:
-