public abstract class GeometryValue extends GeospatialValue
Abstract base class for geometry data values.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SRID
Default Spatial Reference System Identifier for Geometry Values (0).
|
Constructor and Description |
---|
GeometryValue() |
Modifier and Type | Method and Description |
---|---|
static GeometryValue |
castOptional(DataValue value)
For internal use only.
|
static GeometryValue |
castRequired(DataValue value)
For internal use only.
|
java.lang.String |
formatWKT()
See formatWKT(boolean).
|
abstract java.lang.String |
formatWKT(boolean sridRequired)
Return this value formatted in OData WKT (well-known text) format.
|
int |
getSrsCode()
Return spatial Reference System Code, e.g.
|
java.lang.String |
getSrsName()
Return (nullable) Spatial Reference System Name (optional).
|
static GeometryValue |
parseAny(java.lang.String text,
DataType type)
Parse a geometry value from GeoJSON format.
|
static GeometryValue |
parseAnyWKT(java.lang.String text)
|
static GeometryValue |
parseAnyWKT(java.lang.String text,
boolean sridRequired)
Return a value parsed from OData WKT (well-known text) format.
|
void |
setSrsCode(int value)
Set spatial Reference System Code, e.g.
|
void |
setSrsName(java.lang.String value)
Set spatial Reference System Name (optional).
|
java.lang.String |
toString()
Convert this data value to a string.
|
static GeometryPoint |
withLatitudeLongitude(double latitude,
double longitude)
Return 2D geometry point.
|
static GeometryPoint |
withXY(double x,
double y)
Return 2D geometry point.
|
static GeometryPoint |
withXYM(double x,
double y,
double m)
Return 2D geometry point with measure.
|
static GeometryPoint |
withXYZ(double x,
double y,
double z)
Return 3D geometry point.
|
static GeometryPoint |
withXYZM(double x,
double y,
double z,
double m)
Return 3D geometry point with measure.
|
cloneMutable, equals, getDataType, getTypeCode, hashCode
public static final int DEFAULT_SRID
Default Spatial Reference System Identifier for Geometry Values (0).
public static GeometryValue castOptional(DataValue value)
For internal use only.
value
- (internal use only)public static GeometryValue castRequired(DataValue value)
For internal use only.
value
- (internal use only)public java.lang.String formatWKT()
public abstract java.lang.String formatWKT(boolean sridRequired)
Return this value formatted in OData WKT (well-known text) format.
sridRequired
- Is SRID prefix required?public int getSrsCode()
Return spatial Reference System Code, e.g. EPSG SRID. Defaults to 0.
getSrsCode
in class GeospatialValue
public java.lang.String getSrsName()
Return (nullable) Spatial Reference System Name (optional).
getSrsName
in class GeospatialValue
public static GeometryValue parseAny(java.lang.String text, DataType type)
Parse a geometry value from GeoJSON format.
text
- A value in GeoJSON format.type
- A DataType.isGeometry
.public static GeometryValue parseAnyWKT(java.lang.String text)
text
- Text parameter.public static GeometryValue parseAnyWKT(java.lang.String text, boolean sridRequired)
Return a value parsed from OData WKT (well-known text) format.
text
- A value in OData WKT format.sridRequired
- Is SRID prefix required?public void setSrsCode(int value)
Set spatial Reference System Code, e.g. EPSG SRID. Defaults to 0.
setSrsCode
in class GeospatialValue
value
- Spatial Reference System Code, e.g. EPSG SRID. Defaults to 0.public void setSrsName(java.lang.String value)
Set spatial Reference System Name (optional).
setSrsName
in class GeospatialValue
value
- Spatial Reference System Name (optional).public java.lang.String toString()
Convert this data value to a string.
If the GeometryValue.dataType
is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used.
JSON format is used for structured values (arrays and objects).
public static GeometryPoint withLatitudeLongitude(double latitude, double longitude)
Return 2D geometry point.
latitude
- Y-coordinate.longitude
- X-coordinate.public static GeometryPoint withXY(double x, double y)
Return 2D geometry point.
x
- X-coordinate.y
- Y-coordinate.public static GeometryPoint withXYM(double x, double y, double m)
Return 2D geometry point with measure.
x
- X-coordinate.y
- Y-coordinate.m
- M-coordinate (measure).public static GeometryPoint withXYZ(double x, double y, double z)
Return 3D geometry point.
x
- X-coordinate.y
- Y-coordinate.z
- Z-coordinate.public static GeometryPoint withXYZM(double x, double y, double z, double m)
Return 3D geometry point with measure.
x
- X-coordinate.y
- Y-coordinate.z
- Z-coordinate.m
- M-coordinate (measure).