public class Point extends Geometry implements Serializable
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
Constructor and Description |
---|
Point()
Creates an empty 2D point.
|
Point(double x,
double y)
Creates a 2D Point with specified X and Y coordinates.
|
Point(double x,
double y,
double z)
Creates a 3D point with specified X, Y and Z coordinates.
|
Point(Point2D pt) |
Point(VertexDescription vd) |
Modifier and Type | Method and Description |
---|---|
protected void |
_assignVertexDescriptionImpl(VertexDescription newDescription) |
void |
applyTransformation(Transformation2D transform)
Applies 2D affine transformation in XY plane.
|
void |
copyTo(Geometry dst)
Copies this geometry to another geometry of the same type.
|
Geometry |
createInstance()
Creates an instance of an empty geometry of the same type.
|
boolean |
equals(Object _other)
Returns TRUE when this geometry has exactly same type, properties, and
coordinates as the other geometry.
|
long |
estimateMemorySize()
Returns an estimate of this object size in bytes.
|
double |
getAttributeAsDbl(int semantics,
int ordinate)
Returns value of the given vertex attribute's ordinate.
|
int |
getAttributeAsInt(int semantics,
int ordinate)
Returns value of the given vertex attribute's ordinate.
|
Geometry |
getBoundary()
Returns boundary of this geometry.
|
int |
getDimension()
Returns the topological dimension of the geometry object based on the
geometry's type.
|
int |
getID()
Returns the ID of this point.
|
double |
getM()
Returns the attribute M of this point.
|
Geometry.Type |
getType()
Returns the geometry type.
|
double |
getX()
Returns the X coordinate of the point.
|
Point2D |
getXY()
Returns XY coordinates of this point.
|
void |
getXY(Point2D pt)
Returns XY coordinates of this point.
|
Point3D |
getXYZ()
Returns XYZ coordinates of the point.
|
double |
getY()
Returns the Y coordinate of this point.
|
double |
getZ()
Returns the Z coordinate of this point.
|
int |
hashCode()
Returns the hash code for the point.
|
boolean |
isEmpty()
IsEmpty returns TRUE when the Geometry object does not contain geometric
information beyond its original initialization state.
|
void |
queryEnvelope(Envelope env)
Returns the axis aligned bounding box of the geometry.
|
void |
queryEnvelope2D(Envelope2D env)
Returns tight bbox of the Geometry in X, Y plane.
|
Envelope1D |
queryInterval(int semantics,
int ordinate)
Returns the min and max attribute values at the ordinate of the Geometry.
|
void |
replaceNaNs(int semantics,
double value)
Replaces NaNs in the attribute with the given value.
|
void |
setAttribute(int semantics,
int ordinate,
double value)
Sets the value of the attribute.
|
void |
setAttribute(int semantics,
int ordinate,
int value) |
void |
setEmpty()
Returns the geometry to its original initialization state by releasing
all data referenced by the geometry.
|
void |
setID(int id)
Sets the ID of this point.
|
void |
setM(double m)
Sets the M coordinate of this point.
|
void |
setX(double x)
Sets the X coordinate of the point.
|
void |
setXY(double x,
double y)
Set the X and Y coordinate of the point.
|
void |
setXY(Point2D pt)
Sets the XY coordinates of this point.
|
void |
setXYZ(Point3D pt)
Sets the XYZ coordinates of this point.
|
void |
setY(double y)
Sets the Y coordinate of this point.
|
void |
setZ(double z)
Sets the Z coordinate of this point.
|
_getImpl, addAttribute, addID, addM, assignVertexDescription, calculateArea2D, calculateLength2D, copy, dropAllAttributes, dropAttribute, estimateMemorySize, getDescription, getDimensionFromType, getStateFlag, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, mergeVertexDescription, queryLooseEnvelope2D, toString, vertex_count
public Point()
public Point(VertexDescription vd)
public Point(double x, double y)
x
- The X coordinate of the new 2D point.y
- The Y coordinate of the new 2D point.public Point(Point2D pt)
public Point(double x, double y, double z)
x
- The X coordinate of the new 3D point.y
- The Y coordinate of the new 3D point.z
- The Z coordinate of the new 3D point.public final Point2D getXY()
public final void getXY(Point2D pt)
public final void setXY(Point2D pt)
public Point3D getXYZ()
public void setXYZ(Point3D pt)
pt
- The point to create the XYZ coordinate from.public final double getX()
public void setX(double x)
x
- The X coordinate to be set for this point.public final double getY()
public void setY(double y)
y
- The Y coordinate to be set for this point.public double getZ()
public void setZ(double z)
z
- The Z coordinate to be set for this point.public double getM()
public void setM(double m)
m
- The M coordinate to be set for this point.public int getID()
public void setID(int id)
id
- The ID of this point.public double getAttributeAsDbl(int semantics, int ordinate)
semantics
- The attribute semantics.ordinate
- The attribute's ordinate. For example, the Y coordinate of the
NORMAL has ordinate of 1.public int getAttributeAsInt(int semantics, int ordinate)
semantics
- The attribute semantics.ordinate
- The attribute's ordinate. For example, the y coordinate of the
NORMAL has ordinate of 1.public void setAttribute(int semantics, int ordinate, double value)
semantics
- The attribute semantics.ordinate
- The ordinate of the attribute.value
- Is the array to write values to. The attribute type and the
number of elements must match the persistence type, as well as
the number of components of the attribute.public void setAttribute(int semantics, int ordinate, int value)
public Geometry.Type getType()
Geometry
public int getDimension()
Geometry
Returns 0 for point and multipoint.
Returns 1 for lines and polylines.
Returns 2 for polygons and envelopes
Returns 3 for objects with volume
getDimension
in class Geometry
public long estimateMemorySize()
Geometry
This estimate doesn't include the size of the VertexDescription
object
because instances of VertexDescription
are shared among
geometry objects.
estimateMemorySize
in class Geometry
public void setEmpty()
Geometry
protected void _assignVertexDescriptionImpl(VertexDescription newDescription)
_assignVertexDescriptionImpl
in class Geometry
public void applyTransformation(Transformation2D transform)
Geometry
applyTransformation
in class Geometry
transform
- The affine transformation to be applied to this geometry.public void copyTo(Geometry dst)
Geometry
public Geometry createInstance()
Geometry
createInstance
in class Geometry
public boolean isEmpty()
Geometry
public void queryEnvelope(Envelope env)
Geometry
queryEnvelope
in class Geometry
env
- The envelope to return the result in.public void queryEnvelope2D(Envelope2D env)
Geometry
queryEnvelope2D
in class Geometry
env
- The envelope to return the result in.public Envelope1D queryInterval(int semantics, int ordinate)
Geometry
queryInterval
in class Geometry
semantics
- The semantics of the interval.ordinate
- The ordinate of the interval.public void setXY(double x, double y)
x
- X coordinate of the point.y
- Y coordinate of the point.public boolean equals(Object _other)
public int hashCode()
public Geometry getBoundary()
Geometry
getBoundary
in class Geometry
public void replaceNaNs(int semantics, double value)
Geometry
replaceNaNs
in class Geometry
semantics
- The semantics for which to replace the NaNs.value
- The value to replace NaNs with.Copyright © 2018. All rights reserved.