Package com.esri.core.geometry
Class MultiPoint
- java.lang.Object
-
- com.esri.core.geometry.Geometry
-
- com.esri.core.geometry.MultiVertexGeometry
-
- com.esri.core.geometry.MultiPoint
-
- All Implemented Interfaces:
java.io.Serializable
public class MultiPoint extends MultiVertexGeometry implements java.io.Serializable
A Multipoint is a collection of points. A multipoint is a one-dimensional geometry object. Multipoints can be used to store a collection of point-based information where the order and individual identity of each point is not an essential characteristic of the point set.- 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 MultiPointImplm_implprivate static longserialVersionUID-
Fields inherited from class com.esri.core.geometry.Geometry
m_description, m_touchFlag
-
-
Constructor Summary
Constructors Constructor Description MultiPoint()Creates a new empty multipoint.MultiPoint(VertexDescription description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object_getImpl()voidadd(double x, double y)Adds a point with the specified X, Y coordinates to this multipoint.(package private) voidadd(double x, double y, double z)Adds a 3DPoint with the specified X, Y, Z coordinates to this multipoint.voidadd(MultiVertexGeometry src, int srcFrom, int srcTo)Appends points from another multipoint at the end of this multipoint.voidadd(Point point)Adds a point multipoint.voidadd(Point2D pt)Adds a point with the specified X, Y coordinates to this multipoint.voidaddAttribute(int semantics)Adds a new attribute to the Geometry.(package private) voidaddPoints(Point[] points)(package private) voidaddPoints(Point2D[] points)voidapplyTransformation(Transformation2D transform)Applies 2D affine transformation in XY plane.(package private) voidapplyTransformation(Transformation3D transform)Applies 3D affine transformation.voidassignVertexDescription(VertexDescription src)Assigns the new VertexDescription by adding or dropping attributes.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.voiddropAllAttributes()Drops all attributes from the Geometry with exception of POSITON.voiddropAttribute(int semantics)Drops an attribute from the Geometry.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 index, int ordinate)Returns value of the given vertex attribute as double.intgetAttributeAsInt(int semantics, int index, int ordinate)Returns value of the given vertex attribute as int.GeometrygetBoundary()Returns boundary of this geometry.VertexDescriptiongetDescription()Returns the VertexDescription of this geometry.intgetDimension()Returns the topological dimension of the geometry object based on the geometry's type.PointgetPoint(int index)Returns given vertex of the Geometry.voidgetPointByVal(int index, Point outPoint)Returns given vertex of the Geometry.intgetPointCount()Returns the total vertex count in this Geometry.intgetStateFlag()The stateFlag value changes with changes applied to this geometry.Geometry.TypegetType()Returns the geometry type.Point2DgetXY(int index)Returns XY coordinates of the given vertex of the Geometry.voidgetXY(int index, Point2D pt)(package private) Point3DgetXYZ(int index)Returns XYZ coordinates of the given vertex of the Geometry.inthashCode()Returns a hash code value for this multipoint.voidinsertPoint(int beforePointIndex, Point pt)Inserts a point to this multipoint.booleanisEmpty()IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.voidmergeVertexDescription(VertexDescription src)Merges the new VertexDescription by adding missing attributes from the src.voidqueryCoordinates(Point[] dst)voidqueryCoordinates(Point2D[] dst)Queries XY coordinates as an array.(package private) intqueryCoordinates(Point2D[] dst, int dstSize, int beginIndex, int endIndex)(package private) voidqueryCoordinates(Point3D[] dst)Queries XYZ coordinates as an array.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.voidremovePoint(int pointIndex)Removes a point from this multipoint.voidreplaceNaNs(int semantics, double value)Replaces NaNs in the attribute with the given value.voidresize(int pointCount)Resizes the multipoint to have the given size.voidsetAttribute(int semantics, int index, int ordinate, double value)Sets the value of given attribute at given posisiotnsis.voidsetAttribute(int semantics, int index, int ordinate, int value)Same as above, but works with ints.voidsetEmpty()Returns the geometry to its original initialization state by releasing all data referenced by the geometry.voidsetPoint(int index, Point pointSrc)Sets the vertex at given index of the Geometry.voidsetPointByVal(int index, Point pointSrc)Sets the vertex at given index of the Geometry.voidsetXY(int index, Point2D pt)Sets XY coordinates of the given vertex of the Geometry.(package private) voidsetXYZ(int index, Point3D pt)Sets XYZ coordinates of the given vertex of the Geometry.-
Methods inherited from class com.esri.core.geometry.MultiVertexGeometry
_assignVertexDescriptionImpl, getCoordinates2D, getCoordinates3D, getPoint
-
Methods inherited from class com.esri.core.geometry.Geometry
_clone, _touch, addID, addM, addZ, calculateArea2D, calculateLength2D, copy, estimateMemorySize, getDimensionFromType, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, queryLooseEnvelope2D, queryLooseEnvelope3D, toString, vertex_count, writeReplace
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_impl
private MultiPointImpl m_impl
-
-
Constructor Detail
-
MultiPoint
public MultiPoint()
Creates a new empty multipoint.
-
MultiPoint
public MultiPoint(VertexDescription description)
-
-
Method Detail
-
getAttributeAsDbl
public double getAttributeAsDbl(int semantics, int index, int ordinate)Description copied from class:MultiVertexGeometryReturns value of the given vertex attribute as double.- Specified by:
getAttributeAsDblin classMultiVertexGeometry- Parameters:
semantics- The atribute semantics.index- is the vertex index in the Geometry.ordinate- is the ordinate of a vertex attribute (for example, y has ordinate of 1, because it is second ordinate of POSITION) If attribute is not present, the default value is returned. See VertexDescription::GetDefaultValue() method.
-
getAttributeAsInt
public int getAttributeAsInt(int semantics, int index, int ordinate)Description copied from class:MultiVertexGeometryReturns value of the given vertex attribute as int.- Specified by:
getAttributeAsIntin classMultiVertexGeometry- Parameters:
semantics- The atribute semantics.index- is the vertex index in the Geometry.ordinate- is the ordinate of a vertex attribute (for example, y has ordinate of 1, because it is second ordinate of POSITION) If attribute is not present, the default value is returned. See VertexDescription::GetDefaultValue() method. Avoid using this method on non-integer atributes.
-
getPoint
public Point getPoint(int index)
Description copied from class:MultiVertexGeometryReturns given vertex of the Geometry.- Specified by:
getPointin classMultiVertexGeometry
-
getPointCount
public int getPointCount()
Description copied from class:MultiVertexGeometryReturns the total vertex count in this Geometry.- Specified by:
getPointCountin classMultiVertexGeometry
-
getXY
public Point2D getXY(int index)
Description copied from class:MultiVertexGeometryReturns XY coordinates of the given vertex of the Geometry.- Specified by:
getXYin classMultiVertexGeometry
-
getXY
public void getXY(int index, Point2D pt)- Specified by:
getXYin classMultiVertexGeometry
-
getXYZ
Point3D getXYZ(int index)
Description copied from class:MultiVertexGeometryReturns XYZ coordinates of the given vertex of the Geometry. If the Geometry has no Z's, the default value for Z is returned (0).- Specified by:
getXYZin classMultiVertexGeometry
-
queryCoordinates
public void queryCoordinates(Point2D[] dst)
Description copied from class:MultiVertexGeometryQueries XY coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
queryCoordinates
public void queryCoordinates(Point[] dst)
- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
add
public void add(Point point)
Adds a point multipoint.- Parameters:
point- The Point to be added to this multipoint.
-
add
public void add(double x, double y)Adds a point with the specified X, Y coordinates to this multipoint.- Parameters:
x- The new Point's X coordinate.y- The new Point's Y coordinate.
-
add
public void add(Point2D pt)
Adds a point with the specified X, Y coordinates to this multipoint.- Parameters:
pt- the point to add
-
add
void add(double x, double y, double z)Adds a 3DPoint with the specified X, Y, Z coordinates to this multipoint.- Parameters:
x- The new Point's X coordinate.y- The new Point's Y coordinate.z- The new Point's Z coordinate.
-
add
public void add(MultiVertexGeometry src, int srcFrom, int srcTo)
Appends points from another multipoint at the end of this multipoint.- Parameters:
src- The mulitpoint to append to this multipoint.srcFrom- The start index in the source multipoint from which to start appending points.srcTo- The end index in the source multipoint right after the last point to be appended. Use -1 to indicate the rest of the source multipoint.
-
addPoints
void addPoints(Point2D[] points)
-
addPoints
void addPoints(Point[] points)
-
insertPoint
public void insertPoint(int beforePointIndex, Point pt)Inserts a point to this multipoint.- Parameters:
beforePointIndex- The index right before the new point to insert.pt- The point to insert.
-
removePoint
public void removePoint(int pointIndex)
Removes a point from this multipoint.- Parameters:
pointIndex- The index of the point to be removed.
-
resize
public void resize(int pointCount)
Resizes the multipoint to have the given size.- Parameters:
pointCount- - The number of points in this multipoint.
-
queryCoordinates
void queryCoordinates(Point3D[] dst)
Description copied from class:MultiVertexGeometryQueries XYZ coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
setAttribute
public void setAttribute(int semantics, int index, int ordinate, double value)Description copied from class:MultiVertexGeometrySets the value of given attribute at given posisiotnsis.- Specified by:
setAttributein classMultiVertexGeometry- Parameters:
semantics- The atribute semantics.index- is the vertex index in the Geometry.ordinate- is the ordinate of a vertex attribute (for example, y has ordinate of 1, because it is seond ordinate of POSITION)value- is the value to set. as well as the number of components of the attribute. If the attribute is not present in this Geometry, it is added.
-
setAttribute
public void setAttribute(int semantics, int index, int ordinate, int value)Description copied from class:MultiVertexGeometrySame as above, but works with ints. Avoid using this method on non-integer atributes because some double attributes may have NaN default values (e.g. Ms)- Specified by:
setAttributein classMultiVertexGeometry
-
setPoint
public void setPoint(int index, Point pointSrc)Description copied from class:MultiVertexGeometrySets the vertex at given index of the Geometry.- Specified by:
setPointin classMultiVertexGeometry- Parameters:
index- The index of the vertex being changed.pointSrc- The Point instance to set given vertex attributes from. The pointSrc can not be empty.
The method throws if the pointSrc is not of the Point type.
The attributes, that are present in the pointSrc and missing in this Geometry, will be added to the Geometry.
The vertex attributes missing in the pointSrc but present in the Geometry will be set to the default values (see VertexDescription::GetDefaultValue).
-
setXY
public void setXY(int index, Point2D pt)Description copied from class:MultiVertexGeometrySets XY coordinates of the given vertex of the Geometry. All other attributes are unchanged.- Specified by:
setXYin classMultiVertexGeometry
-
setXYZ
void setXYZ(int index, Point3D pt)Description copied from class:MultiVertexGeometrySets XYZ coordinates of the given vertex of the Geometry. If Z attribute is not present in this Geometry, it is added. All other attributes are unchanged.- Specified by:
setXYZin classMultiVertexGeometry
-
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
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.
-
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.
-
getType
public Geometry.Type getType()
Description copied from class:GeometryReturns the geometry type.
-
getDescription
public VertexDescription getDescription()
Description copied from class:GeometryReturns the VertexDescription of this geometry.- Overrides:
getDescriptionin classGeometry- Returns:
- VertexDescription
-
addAttribute
public void addAttribute(int semantics)
Description copied from class:GeometryAdds a new attribute to the Geometry.- Overrides:
addAttributein classGeometry- Parameters:
semantics- The VertexDescription.Semantics to add.
-
assignVertexDescription
public void assignVertexDescription(VertexDescription src)
Description copied from class:GeometryAssigns the new VertexDescription by adding or dropping attributes. The Geometry will have the src description as a result.- Overrides:
assignVertexDescriptionin classGeometry- Parameters:
src- VertexDescription to assign.
-
dropAllAttributes
public void dropAllAttributes()
Description copied from class:GeometryDrops all attributes from the Geometry with exception of POSITON.- Overrides:
dropAllAttributesin classGeometry
-
dropAttribute
public void dropAttribute(int semantics)
Description copied from class:GeometryDrops an attribute from the Geometry. Dropping the attribute is equivalent to setting the attribute to the default value for each vertex, However, it is faster and the result Geometry has smaller memory footprint and smaller size when persisted.- Overrides:
dropAttributein classGeometry- Parameters:
semantics- The VertexDescription.Semantics to drop.
-
mergeVertexDescription
public void mergeVertexDescription(VertexDescription src)
Description copied from class:GeometryMerges the new VertexDescription by adding missing attributes from the src. The Geometry will have a union of the current and the src descriptions.- Overrides:
mergeVertexDescriptionin classGeometry- Parameters:
src- VertexDescription to merge.
-
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.
-
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.
-
setEmpty
public void setEmpty()
Description copied from class:GeometryReturns the geometry to its original initialization state by releasing all data referenced by the geometry.
-
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 a hash code value for this multipoint.- Overrides:
hashCodein classjava.lang.Object
-
queryCoordinates
int queryCoordinates(Point2D[] dst, int dstSize, int beginIndex, int endIndex)
-
getPointByVal
public void getPointByVal(int index, Point outPoint)Description copied from class:MultiVertexGeometryReturns given vertex of the Geometry. The outPoint will have same VertexDescription as this Geometry.- Specified by:
getPointByValin classMultiVertexGeometry
-
setPointByVal
public void setPointByVal(int index, Point pointSrc)Description copied from class:MultiVertexGeometrySets the vertex at given index of the Geometry.- Specified by:
setPointByValin classMultiVertexGeometry- Parameters:
index- The index of the vertex being changed.pointSrc- The Point instance to set given vertex attributes from. The pointSrc can not be empty.
The method throws if the pointSrc is not of the Point type.
The attributes, that are present in the pointSrc and missing in this Geometry, will be added to the Geometry.
The vertex attributes missing in the pointSrc but present in the Geometry will be set to the default values (see VertexDescription::GetDefaultValue).
-
getStateFlag
public int getStateFlag()
Description copied from class:GeometryThe stateFlag value changes with changes applied to this geometry. This allows the user to keep track of the geometry's state.- Overrides:
getStateFlagin classGeometry- Returns:
- The state of the geometry.
-
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.
-
-