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:
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.esri.core.geometry.Geometry
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
-
Field Summary
FieldsFields inherited from class com.esri.core.geometry.Geometry
m_description, m_touchFlag
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
_getImpl()
void
add
(double x, double y) Adds a point with the specified X, Y coordinates to this multipoint.(package private) void
add
(double x, double y, double z) Adds a 3DPoint with the specified X, Y, Z coordinates to this multipoint.void
add
(MultiVertexGeometry src, int srcFrom, int srcTo) Appends points from another multipoint at the end of this multipoint.void
Adds a point multipoint.void
Adds a point with the specified X, Y coordinates to this multipoint.void
addAttribute
(int semantics) Adds a new attribute to the Geometry.(package private) void
(package private) void
void
applyTransformation
(Transformation2D transform) Applies 2D affine transformation in XY plane.(package private) void
applyTransformation
(Transformation3D transform) Applies 3D affine transformation.void
Assigns the new VertexDescription by adding or dropping attributes.void
Copies this geometry to another geometry of the same type.Creates an instance of an empty geometry of the same type.void
Drops all attributes from the Geometry with exception of POSITON.void
dropAttribute
(int semantics) Drops an attribute from the Geometry.boolean
Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.long
Returns an estimate of this object size in bytes.double
getAttributeAsDbl
(int semantics, int index, int ordinate) Returns value of the given vertex attribute as double.int
getAttributeAsInt
(int semantics, int index, int ordinate) Returns value of the given vertex attribute as int.Returns boundary of this geometry.Returns the VertexDescription of this geometry.int
Returns the topological dimension of the geometry object based on the geometry's type.getPoint
(int index) Returns given vertex of the Geometry.void
getPointByVal
(int index, Point outPoint) Returns given vertex of the Geometry.int
Returns the total vertex count in this Geometry.int
The stateFlag value changes with changes applied to this geometry.getType()
Returns the geometry type.getXY
(int index) Returns XY coordinates of the given vertex of the Geometry.void
(package private) Point3D
getXYZ
(int index) Returns XYZ coordinates of the given vertex of the Geometry.int
hashCode()
Returns a hash code value for this multipoint.void
insertPoint
(int beforePointIndex, Point pt) Inserts a point to this multipoint.boolean
isEmpty()
IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.void
Merges the new VertexDescription by adding missing attributes from the src.void
queryCoordinates
(Point[] dst) void
queryCoordinates
(Point2D[] dst) Queries XY coordinates as an array.(package private) int
queryCoordinates
(Point2D[] dst, int dstSize, int beginIndex, int endIndex) (package private) void
queryCoordinates
(Point3D[] dst) Queries XYZ coordinates as an array.void
queryEnvelope
(Envelope env) Returns the axis aligned bounding box of the geometry.void
Returns tight bbox of the Geometry in X, Y plane.(package private) void
Returns tight bbox of the Geometry in 3D.queryInterval
(int semantics, int ordinate) Returns the min and max attribute values at the ordinate of the Geometry.void
removePoint
(int pointIndex) Removes a point from this multipoint.void
replaceNaNs
(int semantics, double value) Replaces NaNs in the attribute with the given value.void
resize
(int pointCount) Resizes the multipoint to have the given size.void
setAttribute
(int semantics, int index, int ordinate, double value) Sets the value of given attribute at given posisiotnsis.void
setAttribute
(int semantics, int index, int ordinate, int value) Same as above, but works with ints.void
setEmpty()
Returns the geometry to its original initialization state by releasing all data referenced by the geometry.void
Sets the vertex at given index of the Geometry.void
setPointByVal
(int index, Point pointSrc) Sets the vertex at given index of the Geometry.void
Sets XY coordinates of the given vertex of the Geometry.(package private) void
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 Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
m_impl
-
-
Constructor Details
-
MultiPoint
public MultiPoint()Creates a new empty multipoint. -
MultiPoint
-
-
Method Details
-
getAttributeAsDbl
public double getAttributeAsDbl(int semantics, int index, int ordinate) Description copied from class:MultiVertexGeometry
Returns value of the given vertex attribute as double.- Specified by:
getAttributeAsDbl
in 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:MultiVertexGeometry
Returns value of the given vertex attribute as int.- Specified by:
getAttributeAsInt
in 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
Description copied from class:MultiVertexGeometry
Returns given vertex of the Geometry.- Specified by:
getPoint
in classMultiVertexGeometry
-
getPointCount
public int getPointCount()Description copied from class:MultiVertexGeometry
Returns the total vertex count in this Geometry.- Specified by:
getPointCount
in classMultiVertexGeometry
-
getXY
Description copied from class:MultiVertexGeometry
Returns XY coordinates of the given vertex of the Geometry.- Specified by:
getXY
in classMultiVertexGeometry
-
getXY
- Specified by:
getXY
in classMultiVertexGeometry
-
getXYZ
Description copied from class:MultiVertexGeometry
Returns 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:
getXYZ
in classMultiVertexGeometry
-
queryCoordinates
Description copied from class:MultiVertexGeometry
Queries XY coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinates
in classMultiVertexGeometry
-
queryCoordinates
- Specified by:
queryCoordinates
in classMultiVertexGeometry
-
_getImpl
-
add
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
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
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
-
addPoints
-
insertPoint
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
Description copied from class:MultiVertexGeometry
Queries XYZ coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinates
in classMultiVertexGeometry
-
setAttribute
public void setAttribute(int semantics, int index, int ordinate, double value) Description copied from class:MultiVertexGeometry
Sets the value of given attribute at given posisiotnsis.- Specified by:
setAttribute
in 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:MultiVertexGeometry
Same 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:
setAttribute
in classMultiVertexGeometry
-
setPoint
Description copied from class:MultiVertexGeometry
Sets the vertex at given index of the Geometry.- Specified by:
setPoint
in 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
Description copied from class:MultiVertexGeometry
Sets XY coordinates of the given vertex of the Geometry. All other attributes are unchanged.- Specified by:
setXY
in classMultiVertexGeometry
-
setXYZ
Description copied from class:MultiVertexGeometry
Sets 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:
setXYZ
in classMultiVertexGeometry
-
applyTransformation
Description copied from class:Geometry
Applies 2D affine transformation in XY plane.- Specified by:
applyTransformation
in classGeometry
- Parameters:
transform
- The affine transformation to be applied to this geometry.
-
applyTransformation
Description copied from class:Geometry
Applies 3D affine transformation. Adds Z attribute if it is missing.- Specified by:
applyTransformation
in classGeometry
- Parameters:
transform
- The affine transformation to be applied to this geometry.
-
copyTo
Description copied from class:Geometry
Copies this geometry to another geometry of the same type. The result geometry is an exact copy. -
createInstance
Description copied from class:Geometry
Creates an instance of an empty geometry of the same type.- Specified by:
createInstance
in classGeometry
- Returns:
- The new instance.
-
getDimension
public int getDimension()Description copied from class:Geometry
Returns 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:
getDimension
in classGeometry
- Returns:
- Returns the integer value of the dimension of geometry.
-
estimateMemorySize
public long estimateMemorySize()Description copied from class:Geometry
Returns an estimate of this object size in bytes.This estimate doesn't include the size of the
VertexDescription
object because instances ofVertexDescription
are shared among geometry objects.- Specified by:
estimateMemorySize
in classGeometry
- Returns:
- Returns an estimate of this object size in bytes.
-
getType
Description copied from class:Geometry
Returns the geometry type. -
getDescription
Description copied from class:Geometry
Returns the VertexDescription of this geometry.- Overrides:
getDescription
in classGeometry
- Returns:
- VertexDescription
-
addAttribute
public void addAttribute(int semantics) Description copied from class:Geometry
Adds a new attribute to the Geometry.- Overrides:
addAttribute
in classGeometry
- Parameters:
semantics
- The VertexDescription.Semantics to add.
-
assignVertexDescription
Description copied from class:Geometry
Assigns the new VertexDescription by adding or dropping attributes. The Geometry will have the src description as a result.- Overrides:
assignVertexDescription
in classGeometry
- Parameters:
src
- VertexDescription to assign.
-
dropAllAttributes
public void dropAllAttributes()Description copied from class:Geometry
Drops all attributes from the Geometry with exception of POSITON.- Overrides:
dropAllAttributes
in classGeometry
-
dropAttribute
public void dropAttribute(int semantics) Description copied from class:Geometry
Drops 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:
dropAttribute
in classGeometry
- Parameters:
semantics
- The VertexDescription.Semantics to drop.
-
mergeVertexDescription
Description copied from class:Geometry
Merges the new VertexDescription by adding missing attributes from the src. The Geometry will have a union of the current and the src descriptions.- Overrides:
mergeVertexDescription
in classGeometry
- Parameters:
src
- VertexDescription to merge.
-
isEmpty
public boolean isEmpty()Description copied from class:Geometry
IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state. -
queryEnvelope
Description copied from class:Geometry
Returns the axis aligned bounding box of the geometry.- Specified by:
queryEnvelope
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryEnvelope2D
Description copied from class:Geometry
Returns tight bbox of the Geometry in X, Y plane.- Specified by:
queryEnvelope2D
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryEnvelope3D
Description copied from class:Geometry
Returns tight bbox of the Geometry in 3D.- Specified by:
queryEnvelope3D
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryInterval
Description copied from class:Geometry
Returns the min and max attribute values at the ordinate of the Geometry.- Specified by:
queryInterval
in 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:Geometry
Returns the geometry to its original initialization state by releasing all data referenced by the geometry. -
equals
Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry. -
hashCode
public int hashCode()Returns a hash code value for this multipoint. -
queryCoordinates
-
getPointByVal
Description copied from class:MultiVertexGeometry
Returns given vertex of the Geometry. The outPoint will have same VertexDescription as this Geometry.- Specified by:
getPointByVal
in classMultiVertexGeometry
-
setPointByVal
Description copied from class:MultiVertexGeometry
Sets the vertex at given index of the Geometry.- Specified by:
setPointByVal
in 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:Geometry
The stateFlag value changes with changes applied to this geometry. This allows the user to keep track of the geometry's state.- Overrides:
getStateFlag
in classGeometry
- Returns:
- The state of the geometry.
-
getBoundary
Description copied from class:Geometry
Returns 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:
getBoundary
in classGeometry
- Returns:
- The boundary geometry.
-
replaceNaNs
public void replaceNaNs(int semantics, double value) Description copied from class:Geometry
Replaces 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:
replaceNaNs
in classGeometry
- Parameters:
semantics
- The semantics for which to replace the NaNs.value
- The value to replace NaNs with.
-