public class GeographyPointValue
extends java.lang.Object
Constructor and Description |
---|
GeographyPointValue(double longitude,
double latitude)
Construct a new GeographyPointValue from its coordinates.
|
Modifier and Type | Method and Description |
---|---|
GeographyPointValue |
add(GeographyPointValue offset)
Deprecated.
|
GeographyPointValue |
add(GeographyPointValue offset,
double alpha)
Deprecated.
|
boolean |
equals(java.lang.Object o)
Compare this point with another object.
|
void |
flattenToBuffer(java.nio.ByteBuffer buffer)
Serialize this point to a ByteBuffer.
|
static GeographyPointValue |
fromWKT(java.lang.String param)
Create a GeographyPointValue from a well-known text string.
|
double |
getLatitude()
Return the latitude of this point in degrees.
|
static int |
getLengthInBytes()
Returns the number of bytes an instance of this class requires when serialized
to a ByteBuffer.
|
double |
getLongitude()
Return the longitude of this point in degrees.
|
static int |
getValueDisplaySize()
The largest number of characters needed to represent
a point value as a string.
|
GeographyPointValue |
mul(double alpha)
Deprecated.
|
static GeographyPointValue |
normalizeLngLat(double longitude,
double latitude)
Create a GeographyPointValue with normalized coordinates.
|
GeographyPointValue |
rotate(double phi,
GeographyPointValue center)
Deprecated.
|
GeographyPointValue |
scale(GeographyPointValue center,
double alpha)
Deprecated.
|
void |
serialize(java.io.DataOutput output)
Serialize this point to a
DataOutput |
static void |
serializeNull(java.nio.ByteBuffer buffer)
Serialize the null point (that is, a SQL null value) to a ByteBuffer,
at the buffer's current position.
|
GeographyPointValue |
sub(GeographyPointValue offset)
Deprecated.
|
GeographyPointValue |
sub(GeographyPointValue offset,
double scale)
Deprecated.
|
java.lang.String |
toString()
Return this point as a well-known text string.
|
java.lang.String |
toWKT()
Return this point as a well-known text string.
|
static GeographyPointValue |
unflattenFromBuffer(java.nio.ByteBuffer inBuffer)
Deserialize a point from a ByteBuffer at the buffer's current position
|
static GeographyPointValue |
unflattenFromBuffer(java.nio.ByteBuffer inBuffer,
int offset)
Deserializes a point from a ByteBuffer, at an absolute offset.
|
public GeographyPointValue(double longitude, double latitude)
longitude
- in degrees.latitude
- in degrees.public static GeographyPointValue fromWKT(java.lang.String param)
param
- A well-known text string.public double getLatitude()
public double getLongitude()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toWKT()
public static int getValueDisplaySize()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public static int getLengthInBytes()
public void flattenToBuffer(java.nio.ByteBuffer buffer)
buffer
- The ByteBuffer to which this point will be serialized.public void serialize(java.io.DataOutput output) throws java.io.IOException
DataOutput
output
- to which this point will be serializedjava.io.IOException
- if any I/O error occurspublic static GeographyPointValue unflattenFromBuffer(java.nio.ByteBuffer inBuffer, int offset)
inBuffer
- The ByteBuffer from which to read the bytes for a point.offset
- Absolute offset of point data in buffer.public static GeographyPointValue unflattenFromBuffer(java.nio.ByteBuffer inBuffer)
inBuffer
- The ByteBuffer from which to read the bytes for a point.public static void serializeNull(java.nio.ByteBuffer buffer)
buffer
- The ByteBuffer to which a null point will be serialized.public static GeographyPointValue normalizeLngLat(double longitude, double latitude)
longitude
- in degrees, not range-restricted.latitude
- in degrees, not range-restricted.@Deprecated public GeographyPointValue add(GeographyPointValue offset, double alpha)
this + alpha*offset
, except that
Java does not allow one to write it in this way.
In particular, this - other
is equal to
add(other, -1)
, but fewer temporary objects are
created.
Normalize the coordinates.offset
- A point to add to this.alpha
- Coordinates of offset will be scaled by this much.@Deprecated public GeographyPointValue add(GeographyPointValue offset)
offset
- The offset to add to this.@Deprecated public GeographyPointValue sub(GeographyPointValue offset)
offset
- The offset to subtract from this.@Deprecated public GeographyPointValue sub(GeographyPointValue offset, double scale)
offset
- The offset to subtract from this.scale
- The amount by which to scale the offset point.@Deprecated public GeographyPointValue mul(double alpha)
alpha
- The amount by which to scale this.@Deprecated public GeographyPointValue rotate(double phi, GeographyPointValue center)
phi
- The angle to rotate in degrees.center
- The center of rotation.@Deprecated public GeographyPointValue scale(GeographyPointValue center, double alpha)
alpha*(this - center) + center
. This is
used to scale the vector from center to this as an offset by
alpha. This is equivalent to this.sub(center).mul(alpha).add(center)
,
but with fewer object creations.center
- The origin of scaling.alpha
- The scale factor.