Package mil.nga.grid.features
Class Point
- java.lang.Object
-
- mil.nga.sf.Geometry
-
- mil.nga.sf.Point
-
- mil.nga.grid.features.Point
-
- All Implemented Interfaces:
Serializable
public class Point extends Point
Point- Author:
- osbornb
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Point
copy()
Copy the pointstatic Point
degrees(double longitude, double latitude)
Create a point in degreesstatic Point
degreesToMeters(double longitude, double latitude)
Create a point converting the degrees coordinate to metersboolean
equals(Object obj)
double
getLatitude()
Get the latitudedouble
getLongitude()
Get the longitudePixel
getPixel(int width, int height, Bounds bounds)
Get the pixel where the point fits into the boundsPixel
getPixel(GridTile tile)
Get the pixel where the point fits into tileUnit
getUnit()
Get the unitint
hashCode()
boolean
isDegrees()
Is this point in degreesboolean
isMeters()
Is this point in metersboolean
isUnit(Unit unit)
Is in the provided unit typestatic Point
meters(double longitude, double latitude)
Create a point in metersstatic Point
metersToDegrees(double longitude, double latitude)
Create a point converting the meters coordinate to degreesstatic Point
point(double longitude, double latitude)
Create a point with default degree unitstatic Point
point(double longitude, double latitude, Unit unit)
Create a pointstatic Point
point(Point point)
Copy a pointstatic Point
point(Point point, Unit unit)
Create a pointvoid
setLatitude(double latitude)
Set the latitudevoid
setLongitude(double longitude)
Set the longitudevoid
setUnit(Unit unit)
Set the unitPoint
toDegrees()
Convert to degreesPoint
toMeters()
Convert to metersstatic Point
toUnit(double longitude, double latitude, Unit unit)
Create a point from a coordinate in an opposite unit to another unitPoint
toUnit(Unit unit)
Convert to the unitstatic Point
toUnit(Unit fromUnit, double longitude, double latitude, Unit toUnit)
Create a point from a coordinate in a unit to another unit-
Methods inherited from class mil.nga.sf.Point
equalsX, equalsXY, equalsY, getM, getX, getY, getZ, isEmpty, isSimple, setM, setX, setY, setZ
-
Methods inherited from class mil.nga.sf.Geometry
expandEnvelope, getCentroid, getDegreesCentroid, getDimension, getEnvelope, getGeometryType, hasM, hasZ, is3D, isMeasured, setHasM, setHasZ, updateZM
-
-
-
-
Constructor Detail
-
Point
public Point(double longitude, double latitude)
Constructor, inUnit.DEGREE
units- Parameters:
longitude
- longitudelatitude
- latitude
-
Point
public Point(double longitude, double latitude, Unit unit)
Constructor- Parameters:
longitude
- longitudelatitude
- latitudeunit
- unit
-
Point
public Point(Point point)
Copy constructor- Parameters:
point
- point to copy
-
-
Method Detail
-
point
public static Point point(double longitude, double latitude)
Create a point with default degree unit- Parameters:
longitude
- longitudelatitude
- latitude- Returns:
- point
-
point
public static Point point(double longitude, double latitude, Unit unit)
Create a point- Parameters:
longitude
- longitudelatitude
- latitudeunit
- unit- Returns:
- point
-
degrees
public static Point degrees(double longitude, double latitude)
Create a point in degrees- Parameters:
longitude
- longitude in degreeslatitude
- latitude in degrees- Returns:
- point in degrees
-
meters
public static Point meters(double longitude, double latitude)
Create a point in meters- Parameters:
longitude
- longitude in meterslatitude
- latitude in meters- Returns:
- point in meters
-
toUnit
public static Point toUnit(Unit fromUnit, double longitude, double latitude, Unit toUnit)
Create a point from a coordinate in a unit to another unit- Parameters:
fromUnit
- unit of provided coordinatelongitude
- longitudelatitude
- latitudetoUnit
- desired unit- Returns:
- point in unit
-
toUnit
public static Point toUnit(double longitude, double latitude, Unit unit)
Create a point from a coordinate in an opposite unit to another unit- Parameters:
longitude
- longitudelatitude
- latitudeunit
- desired unit- Returns:
- point in unit
-
degreesToMeters
public static Point degreesToMeters(double longitude, double latitude)
Create a point converting the degrees coordinate to meters- Parameters:
longitude
- longitude in degreeslatitude
- latitude in degrees- Returns:
- point in meters
-
metersToDegrees
public static Point metersToDegrees(double longitude, double latitude)
Create a point converting the meters coordinate to degrees- Parameters:
longitude
- longitude in meterslatitude
- latitude in meters- Returns:
- point in degrees
-
point
public static Point point(Point point)
Copy a point- Parameters:
point
- point to copy- Returns:
- point
-
point
public static Point point(Point point, Unit unit)
Create a point- Parameters:
point
- point to copyunit
- unit- Returns:
- point
-
getLongitude
public double getLongitude()
Get the longitude- Returns:
- longitude
-
setLongitude
public void setLongitude(double longitude)
Set the longitude- Parameters:
longitude
- longitude
-
getLatitude
public double getLatitude()
Get the latitude- Returns:
- latitude
-
setLatitude
public void setLatitude(double latitude)
Set the latitude- Parameters:
latitude
- latitude
-
getUnit
public Unit getUnit()
Get the unit- Returns:
- unit
-
setUnit
public void setUnit(Unit unit)
Set the unit- Parameters:
unit
- unit
-
isUnit
public boolean isUnit(Unit unit)
Is in the provided unit type- Parameters:
unit
- unit- Returns:
- true if in the unit
-
isDegrees
public boolean isDegrees()
Is this point in degrees- Returns:
- true if degrees
-
isMeters
public boolean isMeters()
Is this point in meters- Returns:
- true if meters
-
toUnit
public Point toUnit(Unit unit)
Convert to the unit- Parameters:
unit
- unit- Returns:
- point in units, same point if equal units
-
toDegrees
public Point toDegrees()
Convert to degrees- Returns:
- point in degrees, same point if already in degrees
-
toMeters
public Point toMeters()
Convert to meters- Returns:
- point in meters, same point if already in meters
-
getPixel
public Pixel getPixel(GridTile tile)
Get the pixel where the point fits into tile- Parameters:
tile
- tile- Returns:
- pixel
-
getPixel
public Pixel getPixel(int width, int height, Bounds bounds)
Get the pixel where the point fits into the bounds- Parameters:
width
- widthheight
- heightbounds
- bounds- Returns:
- pixel
-
-