Package org.voltdb.types
Class GeographyPointValue
java.lang.Object
org.voltdb.types.GeographyPointValue
The Java class that corresponds to the SQL type GEOGRAPHY_POINT.
 Represents a point as defined by its longitude and latitude.
- 
Constructor SummaryConstructorsConstructorDescriptionGeographyPointValue(double longitude, double latitude) Construct a new GeographyPointValue from its coordinates.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanCompare this point with another object.voidflattenToBuffer(ByteBuffer buffer) Serialize this point to a ByteBuffer.static GeographyPointValueCreate a GeographyPointValue from a well-known text string.doubleReturn the latitude of this point in degrees.static intReturns the number of bytes an instance of this class requires when serialized to a ByteBuffer.doubleReturn the longitude of this point in degrees.static intThe largest number of characters needed to represent a point value as a string.static GeographyPointValuenormalizeLngLat(double longitude, double latitude) Create a GeographyPointValue with normalized coordinates.voidserialize(DataOutput output) Serialize this point to aDataOutputstatic voidserializeNull(ByteBuffer buffer) Serialize the null point (that is, a SQL null value) to a ByteBuffer, at the buffer's current position.toString()Return this point as a well-known text string.toWKT()Return this point as a well-known text string.static GeographyPointValueunflattenFromBuffer(ByteBuffer inBuffer) Deserialize a point from a ByteBuffer at the buffer's current positionstatic GeographyPointValueunflattenFromBuffer(ByteBuffer inBuffer, int offset) Deserializes a point from a ByteBuffer, at an absolute offset.
- 
Constructor Details- 
GeographyPointValuepublic GeographyPointValue(double longitude, double latitude) Construct a new GeographyPointValue from its coordinates.- Parameters:
- longitude- in degrees.
- latitude- in degrees.
 
 
- 
- 
Method Details- 
fromWKTCreate a GeographyPointValue from a well-known text string.- Parameters:
- param- A well-known text string.
- Returns:
- A new instance of GeographyPointValue.
 
- 
getLatitudepublic double getLatitude()Return the latitude of this point in degrees.- Returns:
- The latitude of this point in degrees.
 
- 
getLongitudepublic double getLongitude()Return the longitude of this point in degrees.- Returns:
- The longitude of this point in degrees.
 
- 
toStringReturn this point as a well-known text string.
- 
toWKTReturn this point as a well-known text string.- Returns:
- This point as a well-known text string.
 
- 
getValueDisplaySizepublic static int getValueDisplaySize()The largest number of characters needed to represent a point value as a string.- Returns:
- number of characters needed for display
 
- 
equalsCompare this point with another object. Returns true if this point is being compared to another point that represents the same location.
- 
getLengthInBytespublic static int getLengthInBytes()Returns the number of bytes an instance of this class requires when serialized to a ByteBuffer.- Returns:
- The number of bytes an instance of this class requires when serialized to a ByteBuffer.
 
- 
flattenToBufferSerialize this point to a ByteBuffer.- Parameters:
- buffer- The ByteBuffer to which this point will be serialized.
 
- 
serializeSerialize this point to aDataOutput- Parameters:
- output- to which this point will be serialized
- Throws:
- IOException- if any I/O error occurs
 
- 
unflattenFromBufferDeserializes a point from a ByteBuffer, at an absolute offset.- Parameters:
- inBuffer- The ByteBuffer from which to read the bytes for a point.
- offset- Absolute offset of point data in buffer.
- Returns:
- A new instance of GeographyPointValue.
 
- 
unflattenFromBufferDeserialize a point from a ByteBuffer at the buffer's current position- Parameters:
- inBuffer- The ByteBuffer from which to read the bytes for a point.
- Returns:
- A new instance of GeographyPointValue.
 
- 
serializeNullSerialize the null point (that is, a SQL null value) to a ByteBuffer, at the buffer's current position.- Parameters:
- buffer- The ByteBuffer to which a null point will be serialized.
 
- 
normalizeLngLatCreate a GeographyPointValue with normalized coordinates. The longitude and latitude inputs may be any real numbers. They are not restricted to be in the ranges [-180,180] or [-90,90] respectively. The created instance will will have coordinates between (-180,180) and [-90,90].- Parameters:
- longitude- in degrees, not range-restricted.
- latitude- in degrees, not range-restricted.
- Returns:
- A GeographyPointValue with the given coordinates normalized.
 
 
-