Package com.esri.core.geometry
Class Point
- java.lang.Object
-
- com.esri.core.geometry.Geometry
-
- com.esri.core.geometry.Point
-
- All Implemented Interfaces:
java.io.Serializable
public class Point extends Geometry implements java.io.Serializable
A Point 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.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.esri.core.geometry.Geometry
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
-
-
Field Summary
Fields Modifier and Type Field Description private double[]m_attributesprivate doublem_xprivate doublem_y-
Fields inherited from class com.esri.core.geometry.Geometry
m_description, m_touchFlag
-
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_assignVertexDescriptionImpl(VertexDescription newDescription)private void_setToDefault()Sets to a default empty state.voidapplyTransformation(Transformation2D transform)Applies 2D affine transformation in XY plane.voidapplyTransformation(Transformation3D transform)Applies 3D affine transformation.voidcopyTo(Geometry dst)Copies this geometry to another geometry of the same type.GeometrycreateInstance()Creates an instance of an empty geometry of the same type.booleanequals(java.lang.Object _other)Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.longestimateMemorySize()Returns an estimate of this object size in bytes.doublegetAttributeAsDbl(int semantics, int ordinate)Returns value of the given vertex attribute's ordinate.intgetAttributeAsInt(int semantics, int ordinate)Returns value of the given vertex attribute's ordinate.GeometrygetBoundary()Returns boundary of this geometry.intgetDimension()Returns the topological dimension of the geometry object based on the geometry's type.intgetID()Returns the ID of this point.doublegetM()Returns the attribute M of this point.Geometry.TypegetType()Returns the geometry type.doublegetX()Returns the X coordinate of the point.Point2DgetXY()Returns XY coordinates of this point.voidgetXY(Point2D pt)Returns XY coordinates of this point.Point3DgetXYZ()Returns XYZ coordinates of the point.doublegetY()Returns the Y coordinate of this point.doublegetZ()Returns the Z coordinate of this point.inthashCode()Returns the hash code for the point.booleanisEmpty()IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.(package private) booleanisEmptyImpl()voidqueryEnvelope(Envelope env)Returns the axis aligned bounding box of the geometry.voidqueryEnvelope2D(Envelope2D env)Returns tight bbox of the Geometry in X, Y plane.(package private) voidqueryEnvelope3D(Envelope3D env)Returns tight bbox of the Geometry in 3D.Envelope1DqueryInterval(int semantics, int ordinate)Returns the min and max attribute values at the ordinate of the Geometry.voidreplaceNaNs(int semantics, double value)Replaces NaNs in the attribute with the given value.voidsetAttribute(int semantics, int ordinate, double value)Sets the value of the attribute.voidsetAttribute(int semantics, int ordinate, int value)voidsetEmpty()Returns the geometry to its original initialization state by releasing all data referenced by the geometry.voidsetID(int id)Sets the ID of this point.voidsetM(double m)Sets the M coordinate of this point.voidsetX(double x)Sets the X coordinate of the point.voidsetXY(double x, double y)Set the X and Y coordinate of the point.voidsetXY(Point2D pt)Sets the XY coordinates of this point.voidsetXYZ(Point3D pt)Sets the XYZ coordinates of this point.voidsetY(double y)Sets the Y coordinate of this point.voidsetZ(double z)Sets the Z coordinate of this point.-
Methods inherited from class com.esri.core.geometry.Geometry
_clone, _getImpl, _touch, addAttribute, addID, addM, addZ, assignVertexDescription, calculateArea2D, calculateLength2D, copy, dropAllAttributes, dropAttribute, estimateMemorySize, getDescription, getDimensionFromType, getStateFlag, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, mergeVertexDescription, queryLooseEnvelope2D, queryLooseEnvelope3D, toString, vertex_count, writeReplace
-
-
-
-
Constructor Detail
-
Point
public Point()
Creates an empty 2D point.
-
Point
public Point(VertexDescription vd)
-
Point
public Point(double x, double y)Creates a 2D Point with specified X and Y coordinates. In case of Geographic Coordinate Systems, the X coordinate is the longitude and the Y is the latitude.- Parameters:
x- The X coordinate of the new 2D point.y- The Y coordinate of the new 2D point.
-
Point
public Point(Point2D pt)
-
Point
public Point(double x, double y, double z)Creates a 3D point with specified X, Y and Z coordinates. In case of Geographic Coordinate Systems, the X coordinate is the longitude and the Y is the latitude.- Parameters:
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.
-
-
Method Detail
-
getXY
public final Point2D getXY()
Returns XY coordinates of this point.
-
getXY
public final void getXY(Point2D pt)
Returns XY coordinates of this point.
-
setXY
public final void setXY(Point2D pt)
Sets the XY coordinates of this point. param pt The point to create the X and Y coordinate from.
-
getXYZ
public Point3D getXYZ()
Returns XYZ coordinates of the point. Z will be set to 0 if Z is missing.
-
setXYZ
public void setXYZ(Point3D pt)
Sets the XYZ coordinates of this point.- Parameters:
pt- The point to create the XYZ coordinate from.
-
getX
public final double getX()
Returns the X coordinate of the point.
-
setX
public void setX(double x)
Sets the X coordinate of the point.- Parameters:
x- The X coordinate to be set for this point.
-
getY
public final double getY()
Returns the Y coordinate of this point.
-
setY
public void setY(double y)
Sets the Y coordinate of this point.- Parameters:
y- The Y coordinate to be set for this point.
-
getZ
public double getZ()
Returns the Z coordinate of this point.
-
setZ
public void setZ(double z)
Sets the Z coordinate of this point.- Parameters:
z- The Z coordinate to be set for this point.
-
getM
public double getM()
Returns the attribute M of this point.
-
setM
public void setM(double m)
Sets the M coordinate of this point.- Parameters:
m- The M coordinate to be set for this point.
-
getID
public int getID()
Returns the ID of this point.
-
setID
public void setID(int id)
Sets the ID of this point.- Parameters:
id- The ID of this point.
-
getAttributeAsDbl
public double getAttributeAsDbl(int semantics, int ordinate)Returns value of the given vertex attribute's ordinate.- Parameters:
semantics- The attribute semantics.ordinate- The attribute's ordinate. For example, the Y coordinate of the NORMAL has ordinate of 1.- Returns:
- The ordinate as double value.
-
getAttributeAsInt
public int getAttributeAsInt(int semantics, int ordinate)Returns value of the given vertex attribute's ordinate. The ordinate is always 0 because integer attributes always have one component.- Parameters:
semantics- The attribute semantics.ordinate- The attribute's ordinate. For example, the y coordinate of the NORMAL has ordinate of 1.- Returns:
- The ordinate value truncated to a 32 bit integer value.
-
setAttribute
public void setAttribute(int semantics, int ordinate, double value)Sets the value of the attribute.- Parameters:
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.
-
setAttribute
public void setAttribute(int semantics, int ordinate, int value)
-
getType
public Geometry.Type getType()
Description copied from class:GeometryReturns the geometry type.
-
getDimension
public int getDimension()
Description copied from class:GeometryReturns the topological dimension of the geometry object based on the geometry's type.Returns 0 for point and multipoint.
Returns 1 for lines and polylines.
Returns 2 for polygons and envelopes
Returns 3 for objects with volume
- Specified by:
getDimensionin classGeometry- Returns:
- Returns the integer value of the dimension of geometry.
-
estimateMemorySize
public long estimateMemorySize()
Description copied from class:GeometryReturns an estimate of this object size in bytes.This estimate doesn't include the size of the
VertexDescriptionobject because instances ofVertexDescriptionare shared among geometry objects.- Specified by:
estimateMemorySizein classGeometry- Returns:
- Returns an estimate of this object size in bytes.
-
setEmpty
public void setEmpty()
Description copied from class:GeometryReturns the geometry to its original initialization state by releasing all data referenced by the geometry.
-
_assignVertexDescriptionImpl
protected void _assignVertexDescriptionImpl(VertexDescription newDescription)
- Specified by:
_assignVertexDescriptionImplin classGeometry
-
_setToDefault
private void _setToDefault()
Sets to a default empty state.
-
applyTransformation
public void applyTransformation(Transformation2D transform)
Description copied from class:GeometryApplies 2D affine transformation in XY plane.- Specified by:
applyTransformationin classGeometry- Parameters:
transform- The affine transformation to be applied to this geometry.
-
applyTransformation
public void applyTransformation(Transformation3D transform)
Description copied from class:GeometryApplies 3D affine transformation. Adds Z attribute if it is missing.- Specified by:
applyTransformationin classGeometry- Parameters:
transform- The affine transformation to be applied to this geometry.
-
copyTo
public void copyTo(Geometry dst)
Description copied from class:GeometryCopies this geometry to another geometry of the same type. The result geometry is an exact copy.
-
createInstance
public Geometry createInstance()
Description copied from class:GeometryCreates an instance of an empty geometry of the same type.- Specified by:
createInstancein classGeometry- Returns:
- The new instance.
-
isEmpty
public boolean isEmpty()
Description copied from class:GeometryIsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.
-
isEmptyImpl
final boolean isEmptyImpl()
-
queryEnvelope
public void queryEnvelope(Envelope env)
Description copied from class:GeometryReturns the axis aligned bounding box of the geometry.- Specified by:
queryEnvelopein classGeometry- Parameters:
env- The envelope to return the result in.
-
queryEnvelope2D
public void queryEnvelope2D(Envelope2D env)
Description copied from class:GeometryReturns tight bbox of the Geometry in X, Y plane.- Specified by:
queryEnvelope2Din classGeometry- Parameters:
env- The envelope to return the result in.
-
queryEnvelope3D
void queryEnvelope3D(Envelope3D env)
Description copied from class:GeometryReturns tight bbox of the Geometry in 3D.- Specified by:
queryEnvelope3Din classGeometry- Parameters:
env- The envelope to return the result in.
-
queryInterval
public Envelope1D queryInterval(int semantics, int ordinate)
Description copied from class:GeometryReturns the min and max attribute values at the ordinate of the Geometry.- Specified by:
queryIntervalin classGeometry- Parameters:
semantics- The semantics of the interval.ordinate- The ordinate of the interval.- Returns:
- The interval.
-
setXY
public void setXY(double x, double y)Set the X and Y coordinate of the point.- Parameters:
x- X coordinate of the point.y- Y coordinate of the point.
-
equals
public boolean equals(java.lang.Object _other)
Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns the hash code for the point.- Overrides:
hashCodein classjava.lang.Object
-
getBoundary
public Geometry getBoundary()
Description copied from class:GeometryReturns boundary of this geometry. Polygon and Envelope boundary is a Polyline. For Polyline and Line, the boundary is a Multi_point consisting of path end points. For Multi_point and Point null is returned.- Specified by:
getBoundaryin classGeometry- Returns:
- The boundary geometry.
-
replaceNaNs
public void replaceNaNs(int semantics, double value)Description copied from class:GeometryReplaces NaNs in the attribute with the given value. If the geometry is not empty, it adds the attribute if geometry does not have it yet, and replaces the values. If the geometry is empty, it adds the attribute and does not set any values.- Specified by:
replaceNaNsin classGeometry- Parameters:
semantics- The semantics for which to replace the NaNs.value- The value to replace NaNs with.
-
-