Class CoordinatesBuilder
- java.lang.Object
-
- org.elasticsearch.common.geo.builders.CoordinatesBuilder
-
public class CoordinatesBuilder extends java.lang.Object
A builder for a list of coordinates. Enables chaining of individual coordinates either as long/lat pairs or asCoordinate
elements, arrays or collections.
-
-
Constructor Summary
Constructors Constructor Description CoordinatesBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<org.locationtech.jts.geom.Coordinate>
build()
CoordinatesBuilder
close()
Makes a closed ring out of the current coordinates by adding the starting point as the end point.CoordinatesBuilder
coordinate(double longitude, double latitude)
Add a new coordinate to the collectionCoordinatesBuilder
coordinate(org.locationtech.jts.geom.Coordinate coordinate)
Add a new coordinate to the collectionCoordinatesBuilder
coordinates(java.util.Collection<? extends org.locationtech.jts.geom.Coordinate> coordinates)
Add a collection of coordinates to the current coordinatesCoordinatesBuilder
coordinates(org.locationtech.jts.geom.Coordinate... coordinates)
Add an array of coordinates to the current coordinates
-
-
-
Method Detail
-
coordinate
public CoordinatesBuilder coordinate(org.locationtech.jts.geom.Coordinate coordinate)
Add a new coordinate to the collection- Parameters:
coordinate
- the coordinate to add- Returns:
- this
-
coordinate
public CoordinatesBuilder coordinate(double longitude, double latitude)
Add a new coordinate to the collection- Parameters:
longitude
- longitude of the coordinatelatitude
- latitude of the coordinate- Returns:
- this
-
coordinates
public CoordinatesBuilder coordinates(org.locationtech.jts.geom.Coordinate... coordinates)
Add an array of coordinates to the current coordinates- Parameters:
coordinates
- array ofCoordinate
s to add- Returns:
- this
-
coordinates
public CoordinatesBuilder coordinates(java.util.Collection<? extends org.locationtech.jts.geom.Coordinate> coordinates)
Add a collection of coordinates to the current coordinates- Parameters:
coordinates
- collection ofCoordinate
s to add- Returns:
- this
-
close
public CoordinatesBuilder close()
Makes a closed ring out of the current coordinates by adding the starting point as the end point. Will have no effect of starting and end point are already the same coordinate.
-
build
public java.util.List<org.locationtech.jts.geom.Coordinate> build()
- Returns:
- a list containing the current coordinates
-
-