public class Point extends Geometry
PointType
.
This is a zero-dimensional object that represents a specific (X,Y) location in a two-dimensional XY-plane. In case of Geographic Coordinate Systems, the X coordinate is the longitude and the Y is the latitude.
Constructor and Description |
---|
Point(double x,
double y)
Creates a new point.
|
Modifier and Type | Method and Description |
---|---|
static Point |
fromGeoJson(String source)
Creates a point from a GeoJSON
Point representation.
|
static Point |
fromWellKnownBinary(ByteBuffer source)
Creates a point from its Well-known Binary
(WKB) representation.
|
static Point |
fromWellKnownText(String source)
Creates a point from its Well-known
Text (WKT) representation.
|
double |
X()
Returns the X coordinate of this 2D point (or its longitude in Geographic Coordinate Systems.
|
double |
Y()
Returns the Y coordinate of this 2D point (or its latitude in Geographic Coordinate Systems).
|
asGeoJson, asWellKnownBinary, asWellKnownText, contains, equals, hashCode, toString
public Point(double x, double y)
x
- the X coordinate (or its longitude in Geographic Coordinate Systems).y
- the Y coordinate (or its latitude in Geographic Coordinate Systems).public static Point fromWellKnownText(String source)
source
- the Well-known Text representation to parse.InvalidTypeException
- if the string does not contain a valid Well-known Text
representation.public static Point fromWellKnownBinary(ByteBuffer source)
source
- the Well-known Binary representation to parse.InvalidTypeException
- if the provided ByteBuffer
does not contain a valid
Well-known Binary representation.public static Point fromGeoJson(String source)
source
- the GeoJSON Point
representation to parse.InvalidTypeException
- if the string does not contain a valid GeoJSON Point representation.public double X()
public double Y()
Copyright © 2012–2019. All rights reserved.