Package com.mapbox.turf
Class TurfTransformation
java.lang.Object
com.mapbox.turf.TurfTransformation
Methods in this class consume one GeoJSON object and output a new object with the defined
parameters provided.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.mapbox.geojson.Polygoncircle(com.mapbox.geojson.Point center, double radius) Takes aPointand calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.static com.mapbox.geojson.PolygonTakes aPointand calculates the circle polygon given a radius in the providedTurfConstants.TurfUnitCriteria; and steps for precision.static com.mapbox.geojson.PolygonTakes aPointand calculates the circle polygon given a radius in the providedTurfConstants.TurfUnitCriteria; and steps for precision.
-
Method Details
-
circle
public static com.mapbox.geojson.Polygon circle(@NonNull com.mapbox.geojson.Point center, double radius) Takes aPointand calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision. This uses theDEFAULT_STEPSandTurfConstants.UNIT_DEFAULTvalues.- Parameters:
center- aPointwhich the circle will center aroundradius- the radius of the circle- Returns:
- a
Polygonwhich represents the newly created circle - Since:
- 3.0.0
-
circle
public static com.mapbox.geojson.Polygon circle(@NonNull com.mapbox.geojson.Point center, double radius, String units) Takes aPointand calculates the circle polygon given a radius in the providedTurfConstants.TurfUnitCriteria; and steps for precision. This method uses theDEFAULT_STEPS.- Parameters:
center- aPointwhich the circle will center aroundradius- the radius of the circleunits- one of the units found insideTurfConstants.TurfUnitCriteria- Returns:
- a
Polygonwhich represents the newly created circle - Since:
- 3.0.0
-
circle
public static com.mapbox.geojson.Polygon circle(@NonNull com.mapbox.geojson.Point center, double radius, int steps, String units) Takes aPointand calculates the circle polygon given a radius in the providedTurfConstants.TurfUnitCriteria; and steps for precision.- Parameters:
center- aPointwhich the circle will center aroundradius- the radius of the circlesteps- number of steps which make up the circle parameterunits- one of the units found insideTurfConstants.TurfUnitCriteria- Returns:
- a
Polygonwhich represents the newly created circle - Since:
- 3.0.0
-