TurfConversion { public static Feature polygonToLine(@NonNull Feature feature) { return polygonToLine(feature, null); } private  TurfConversion(); static double lengthToDegrees(double distance, @TurfUnitCriteria String units); static double degreesToRadians(double degrees); static double radiansToDegrees(double radians); static double radiansToLength(double radians); static double radiansToLength(double radians, @NonNull @TurfUnitCriteria String units); static double lengthToRadians(double distance); static double lengthToRadians(double distance, @NonNull @TurfUnitCriteria String units); static double convertLength(@FloatRange(from = 0) double distance,
                                     @NonNull @TurfUnitCriteria String originalUnit); static double convertLength(@FloatRange(from = 0) double distance,
                                     @NonNull @TurfUnitCriteria String originalUnit,
                                     @Nullable @TurfUnitCriteria String finalUnit); static FeatureCollection explode(@NonNull FeatureCollection featureCollection); static FeatureCollection explode(@NonNull Feature feature); static Feature polygonToLine(@NonNull Feature feature); static Feature polygonToLine(@NonNull Feature feature, @Nullable JsonObject properties); static Feature polygonToLine(@NonNull Polygon polygon); static FeatureCollection polygonToLine(@NonNull MultiPolygon multiPolygon); static Feature polygonToLine(@NonNull Polygon polygon, @Nullable JsonObject properties); static FeatureCollection polygonToLine(@NonNull MultiPolygon multiPolygon,
                                                @Nullable JsonObject properties); static FeatureCollection multiPolygonToLine(@NonNull Feature feature); static FeatureCollection multiPolygonToLine(@NonNull Feature feature,
                                                     @Nullable JsonObject properties); static FeatureCollection combine(@NonNull FeatureCollection originalFeatureCollection);  }
@Test public void polygonToLine_GeometryPolygon() throws NullPointerException { Polygon polygon = Polygon.fromJson(loadJsonFixture(TURF_POLYGON_TO_LINE_PATH_IN + TURF_POLYGON_TO_LINE_FILENAME_GEOMETRY_POLYGON)); Feature expected = Feature.fromJson(loadJsonFixture(TURF_POLYGON_TO_LINE_PATH_OUT + TURF_POLYGON_TO_LINE_FILENAME_GEOMETRY_POLYGON)); compareJson(expected.toJson(), TurfConversion.polygonToLine(polygon).toJson()); }
@Test public void polygonToLine_Polygon() throws NullPointerException { Feature polygon = Feature.fromJson(loadJsonFixture(TURF_POLYGON_TO_LINE_PATH_IN + TURF_POLYGON_TO_LINE_FILENAME_POLYGON)); Feature expected = Feature.fromJson(loadJsonFixture(TURF_POLYGON_TO_LINE_PATH_OUT + TURF_POLYGON_TO_LINE_FILENAME_POLYGON)); compareJson(expected.toJson(), TurfConversion.polygonToLine(polygon).toJson()); }
@Test public void polygonToLine_PolygonWithHole() throws NullPointerException { Feature polygon = Feature.fromJson(loadJsonFixture(TURF_POLYGON_TO_LINE_PATH_IN + TURF_POLYGON_TO_LINE_FILENAME_POLYGON_WITH_HOLE)); Feature expected = Feature.fromJson(loadJsonFixture(TURF_POLYGON_TO_LINE_PATH_OUT + TURF_POLYGON_TO_LINE_FILENAME_POLYGON_WITH_HOLE)); compareJson(expected.toJson(), TurfConversion.polygonToLine(polygon).toJson()); }