public class TurfInvariant extends Object
Constructor and Description |
---|
TurfInvariant() |
Modifier and Type | Method and Description |
---|---|
static void |
collectionOf(com.mapbox.services.commons.geojson.FeatureCollection featurecollection,
String type,
String name)
Enforce expectations about types of
FeatureCollection inputs for Turf. |
static void |
featureOf(com.mapbox.services.commons.geojson.Feature feature,
String type,
String name)
Enforce expectations about types of
Feature inputs for Turf. |
static void |
geojsonType(com.mapbox.services.commons.geojson.GeoJSON value,
String type,
String name)
Enforce expectations about types of GeoJSON objects for Turf.
|
static com.mapbox.services.commons.models.Position |
getCoord(com.mapbox.services.commons.geojson.Feature obj)
Unwrap a coordinate from a Feature with a Point geometry, a Point geometry, or a single
coordinate.
|
static com.mapbox.services.commons.models.Position |
getCoord(com.mapbox.services.commons.geojson.Point obj) |
public static com.mapbox.services.commons.models.Position getCoord(com.mapbox.services.commons.geojson.Feature obj) throws TurfException
obj
- any valueTurfException
- Signals that a Turf exception of some sort has occurred.public static com.mapbox.services.commons.models.Position getCoord(com.mapbox.services.commons.geojson.Point obj) throws TurfException
TurfException
public static void geojsonType(com.mapbox.services.commons.geojson.GeoJSON value, String type, String name) throws TurfException
value
- Any GeoJSON object.type
- Type expected GeoJSON type.name
- Name of calling function.TurfException
- Signals that a Turf exception of some sort has occurred.public static void featureOf(com.mapbox.services.commons.geojson.Feature feature, String type, String name) throws TurfException
Feature
inputs for Turf. Internally this uses
Feature.getType()
to judge geometry types.feature
- A feature with an expected geometry type.type
- Type expected GeoJSON type.name
- Name of calling function.TurfException
- Signals that a Turf exception of some sort has occurred.public static void collectionOf(com.mapbox.services.commons.geojson.FeatureCollection featurecollection, String type, String name) throws TurfException
FeatureCollection
inputs for Turf. Internally
this uses Feature.getType()
} to judge geometry types.featurecollection
- A FeatureCollection
for which features will be judgedtype
- Expected GeoJSON type.name
- Name of calling function.TurfException
- Signals that a Turf exception of some sort has occurred.© 2015–2016 Mapbox. All rights reserved.