Package mil.nga.sf.geojson
Class Position
- java.lang.Object
-
- mil.nga.sf.geojson.Position
-
- All Implemented Interfaces:
Serializable
public class Position extends Object implements Serializable
Position- Author:
- yutzlejp
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
List<Double>
getAdditionalElements()
Get the additional elementsDouble
getM()
Get the m valueDouble
getX()
Get the x valueDouble
getY()
Get the y valueDouble
getZ()
Get the z valueboolean
hasAdditionalElements()
Check if the position has additional elementsint
hashCode()
boolean
hasM()
Check if position has a m valueboolean
hasZ()
Check if position has a z valuePoint
toSimplePoint()
Convert to simple point
-
-
-
Constructor Detail
-
Position
public Position(Point point)
Constructor- Parameters:
point
- simple point
-
Position
public Position(Double longitude, Double latitude)
Constructor- Parameters:
longitude
- longitude valuelatitude
- latitude value
-
Position
public Position(Double longitude, Double latitude, Double altitude, Double... additionalElements)
Construct a Coordinates with additional elements. The specification allows for any number of additional elements in a position, after lng, lat, alt. https://tools.ietf.org/html/rfc7946#section-3.1.1- Parameters:
longitude
- The longitude.latitude
- The latitude.altitude
- The altitude.additionalElements
- The additional elements.
-
-
Method Detail
-
hasAdditionalElements
public boolean hasAdditionalElements()
Check if the position has additional elements- Returns:
- true if additional elements
-
getAdditionalElements
public List<Double> getAdditionalElements()
Get the additional elements- Returns:
- additional elements
-
getX
public Double getX()
Get the x value- Returns:
- x
-
getY
public Double getY()
Get the y value- Returns:
- y
-
getZ
public Double getZ()
Get the z value- Returns:
- z
-
getM
public Double getM()
Get the m value- Returns:
- m
-
hasZ
public boolean hasZ()
Check if position has a z value- Returns:
- true if has z value
-
hasM
public boolean hasM()
Check if position has a m value- Returns:
- true if has m value
-
toSimplePoint
public Point toSimplePoint()
Convert to simple point- Returns:
- simple point
-
-