/** * Converts to a LineString. * * @return LineString */ public LineString toLineString() { return new LineString(positions()); }
/** * Convert to a LinearRing. * * @return LinearRing */ public LinearRing toLinearRing() { return new LinearRing(positions()); }
public static Feature featureWithId(String id) { return Feature.builder().withGeometry(Point.from(12.3, 45.3)).withId(id).build(); }
public static Builder builder(Feature feature) { return builder().withGeometry(feature.geometry).withProperties(feature.properties).withId(feature.id); }
/** * Build a {@link Feature} with the given {@link Geometry}. * * @param geometry The Geometry to build Feature from * * @return An instance of Feature */ public static Feature of(Geometry<?> geometry) { return builder().withGeometry(geometry).build(); }
/** * Create a Point from the given coordinates. * * @param lon The x axis value. Longitude in a geographic projection. * @param lat The y axis value. Latitude in a geographic projection. * @return Point instance. */ public static Point from(double lon, double lat) { return from(lon, lat, Double.NaN); }
/** * Create a LinearRing from the given points. * * @param points Point Iterable composed at least by 4 points, with the first and the last that are the same. * @return a LinearRing */ public static LinearRing of(Stream<Point> points) { return of(points::iterator); }
/** * Converts to a MultiPoint. * * @return MultiPoint */ public MultiPoint toMultiPoint() { return new MultiPoint(positions()); }
/** * Converts to a {@link MultiLineString}. * * @return this. */ public MultiLineString toMultiLineString() { return new MultiLineString(positions()); }
public static Feature featureWithProperties(Map<String, JsonElement> properties) { return Feature.builder().withGeometry(Point.from(12.3, 45.3)).withProperties(properties).build(); }
public static Builder builder(Feature feature) { return builder().withGeometry(feature.geometry).withProperties(feature.properties).withId(feature.id); }
/** * Build a {@link Feature} with the given {@link Geometry}. * * @param geometry The Geometry to build Feature from * * @return An instance of Feature */ public static Feature of(Geometry<?> geometry) { return builder().withGeometry(geometry).build(); }
/** * Converts to a LineString. * * @return LineString */ public LineString toLineString() { return new LineString(positions()); }
/** * Convert to a LinearRing. * * @return LinearRing */ public LinearRing toLinearRing() { return new LinearRing(positions()); }
/** * Converts to a MultiPoint. * * @return MultiPoint */ public MultiPoint toMultiPoint() { return new MultiPoint(positions()); }
public static Feature featureWithGeometry(Geometry<?> geometry) { return Feature.builder().withGeometry(Point.from(12.3, 45.3)).build(); }