Class CoordinatesBuilder
java.lang.Object
org.opensearch.common.geo.builders.CoordinatesBuilder
A builder for a list of coordinates.
Enables chaining of individual coordinates either as long/lat pairs
or as
Coordinate
elements, arrays or collections.- Opensearch.internal:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionList
<org.locationtech.jts.geom.Coordinate> build()
close()
Makes a closed ring out of the current coordinates by adding the starting point as the end point.coordinate
(double longitude, double latitude) Add a new coordinate to the collectioncoordinate
(org.locationtech.jts.geom.Coordinate coordinate) Add a new coordinate to the collectioncoordinates
(Collection<? extends org.locationtech.jts.geom.Coordinate> coordinates) Add a collection of coordinates to the current coordinatescoordinates
(org.locationtech.jts.geom.Coordinate... coordinates) Add an array of coordinates to the current coordinates
-
Constructor Details
-
CoordinatesBuilder
public CoordinatesBuilder()
-
-
Method Details
-
coordinate
Add a new coordinate to the collection- Parameters:
coordinate
- the coordinate to add- Returns:
- this
-
coordinate
Add a new coordinate to the collection- Parameters:
longitude
- longitude of the coordinatelatitude
- latitude of the coordinate- Returns:
- this
-
coordinates
Add an array of coordinates to the current coordinates- Parameters:
coordinates
- array ofCoordinate
s to add- Returns:
- this
-
coordinates
public CoordinatesBuilder coordinates(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
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
- Returns:
- a list containing the current coordinates
-