com.esri.core.geometry
Class MultiPoint

java.lang.Object
  extended by com.esri.core.geometry.Geometry
      extended by com.esri.core.geometry.MultiPoint
All Implemented Interfaces:
Serializable

public final class MultiPoint
extends Geometry
implements 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.Type
 
Constructor Summary
MultiPoint()
          Creates a new empty multipoint.
MultiPoint(VertexDescription description)
           
 
Method Summary
protected  Object _getImpl()
           
 void add(double x, double y)
          Adds a point with the specified X, Y coordinates to this multipoint.
 void add(com.esri.core.geometry.MultiVertexGeometry src, int srcFrom, int srcTo)
          Appends points from another multipoint at the end of this multipoint.
 void add(Point point)
          Adds a point multipoint.
 void addAttribute(int semantics)
          Adds a new attribute to the Geometry.
 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.
 void dropAllAttributes()
          Drops all attributes from the Geometry with exception of POSITON.
 void dropAttribute(int semantics)
          Drops an attribute from the Geometry.
 boolean equals(Object other)
          Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.
 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.
 com.esri.core.geometry.Point2D[] getCoordinates2D()
          Returns XY coordinates as an array.
 VertexDescription getDescription()
          Returns the VertexDescription of this geomtry.
 int getDimension()
          Returns the topological dimension of the geometry object based on the geometry's type.
 Point getPoint(int index)
          Returns given vertex of the Geometry.
 void getPoint(int index, Point ptOut)
          Returns given vertex of the Geometry by value.
 int getPointCount()
          Returns the total vertex count in this Geometry.
 int getStateFlag()
          The stateFlag value changes with changes applied to this geometry.
 Geometry.Type getType()
          Returns the geometry type.
 com.esri.core.geometry.Point2D getXY(int index)
          Returns XY 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 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 removePoint(int pointIndex)
          Removes a point from this multipoint.
 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 setPoint(int index, Point pointSrc)
          Sets the vertex at given index of the Geometry.
 
Methods inherited from class com.esri.core.geometry.Geometry
addID, addM, calculateArea2D, calculateLength2D, copy, getDimensionFromType, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, queryLooseEnvelope2D
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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)
Returns value of the given vertex attribute as double.

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)
Returns value of the given vertex attribute as int.

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)
Returns given vertex of the Geometry.


getPointCount

public int getPointCount()
Returns the total vertex count in this Geometry.


getXY

public com.esri.core.geometry.Point2D getXY(int index)
Returns XY coordinates of the given vertex of the Geometry.


_getImpl

protected Object _getImpl()
Overrides:
_getImpl in class Geometry

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(com.esri.core.geometry.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.

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.

setAttribute

public void setAttribute(int semantics,
                         int index,
                         int ordinate,
                         double value)
Sets the value of given attribute at given posisiotnsis.

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)
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)


setPoint

public void setPoint(int index,
                     Point pointSrc)
Sets the vertex at given index of the Geometry.

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).

applyTransformation

public void applyTransformation(Transformation2D transform)
Description copied from class: Geometry
Applies 2D affine transformation in XY plane.

Specified by:
applyTransformation in class Geometry
Parameters:
transform - The affine transformation to be applied to this geometry.

copyTo

public void copyTo(Geometry dst)
Description copied from class: Geometry
Copies this geometry to another geometry of the same type. The result geometry is an exact copy.

Specified by:
copyTo in class Geometry

createInstance

public Geometry createInstance()
Description copied from class: Geometry
Creates an instance of an empty geometry of the same type.

Specified by:
createInstance in class Geometry

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 class Geometry
Returns:
Returns the integer value of the dimension of geometry.

getType

public Geometry.Type getType()
Description copied from class: Geometry
Returns the geometry type.

Specified by:
getType in class Geometry
Returns:
Returns the geometry type.

getDescription

public VertexDescription getDescription()
Description copied from class: Geometry
Returns the VertexDescription of this geomtry.

Overrides:
getDescription in class Geometry

addAttribute

public void addAttribute(int semantics)
Description copied from class: Geometry
Adds a new attribute to the Geometry.

Overrides:
addAttribute in class Geometry

dropAllAttributes

public void dropAllAttributes()
Description copied from class: Geometry
Drops all attributes from the Geometry with exception of POSITON.

Overrides:
dropAllAttributes in class Geometry

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 class Geometry

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.

Specified by:
isEmpty in class Geometry
Returns:
boolean Returns TRUE if this geometry is empty.

queryEnvelope

public void queryEnvelope(Envelope env)
Description copied from class: Geometry
Returns the axis aligned bounding box of the geometry.

Specified by:
queryEnvelope in class Geometry
Parameters:
env - The envelope to return the result in.

queryEnvelope2D

public void queryEnvelope2D(Envelope2D env)
Description copied from class: Geometry
Returns tight bbox of the Geometry in X, Y plane.

Specified by:
queryEnvelope2D in class Geometry

queryInterval

public Envelope1D queryInterval(int semantics,
                                int ordinate)
Description copied from class: Geometry
Returns the min and max attribute values at the ordinate of the Geometry

Specified by:
queryInterval in class Geometry

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.

Specified by:
setEmpty in class Geometry

equals

public boolean equals(Object other)
Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this multipoint.

Overrides:
hashCode in class Object

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 class Geometry
Returns:
The state of the geometry.

getPoint

public void getPoint(int index,
                     Point ptOut)
Returns given vertex of the Geometry by value.


getCoordinates2D

public com.esri.core.geometry.Point2D[] getCoordinates2D()
Returns XY coordinates as an array.



Copyright © 2013. All Rights Reserved.