Class 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
    • Constructor Detail

      • MultiPoint

        public MultiPoint()
        Creates a new empty multipoint.
    • Method Detail

      • 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 class MultiVertexGeometry
        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 class MultiVertexGeometry
        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.
      • getXYZ

        Point3D getXYZ​(int index)
        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 class MultiVertexGeometry
      • _getImpl

        protected java.lang.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​(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.
      • 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 class MultiVertexGeometry
        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 class MultiVertexGeometry
      • setPoint

        public void setPoint​(int index,
                             Point pointSrc)
        Description copied from class: MultiVertexGeometry
        Sets the vertex at given index of the Geometry.
        Specified by:
        setPoint in class MultiVertexGeometry
        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: MultiVertexGeometry
        Sets XY coordinates of the given vertex of the Geometry. All other attributes are unchanged.
        Specified by:
        setXY in class MultiVertexGeometry
      • setXYZ

        void setXYZ​(int index,
                    Point3D pt)
        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 class MultiVertexGeometry
      • 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.
      • applyTransformation

        void applyTransformation​(Transformation3D transform)
        Description copied from class: Geometry
        Applies 3D affine transformation. Adds Z attribute if it is missing.
        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
        Parameters:
        dst - The geometry instance to copy to.
      • 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
        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 class Geometry
        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 of VertexDescription are shared among geometry objects.

        Specified by:
        estimateMemorySize in class Geometry
        Returns:
        Returns an estimate of this object size in bytes.
      • 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.
      • addAttribute

        public void addAttribute​(int semantics)
        Description copied from class: Geometry
        Adds a new attribute to the Geometry.
        Overrides:
        addAttribute in class Geometry
        Parameters:
        semantics - The VertexDescription.Semantics to add.
      • assignVertexDescription

        public void assignVertexDescription​(VertexDescription src)
        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 class Geometry
        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 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
        Parameters:
        semantics - The VertexDescription.Semantics to drop.
      • mergeVertexDescription

        public void mergeVertexDescription​(VertexDescription src)
        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 class Geometry
        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.
        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
        Parameters:
        env - The envelope to return the result in.
      • queryEnvelope3D

        void queryEnvelope3D​(Envelope3D env)
        Description copied from class: Geometry
        Returns tight bbox of the Geometry in 3D.
        Specified by:
        queryEnvelope3D in class Geometry
        Parameters:
        env - The envelope to return the result in.
      • 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
        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.
        Specified by:
        setEmpty in class 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Returns a hash code value for this multipoint.
        Overrides:
        hashCode in class java.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: MultiVertexGeometry
        Returns given vertex of the Geometry. The outPoint will have same VertexDescription as this Geometry.
        Specified by:
        getPointByVal in class MultiVertexGeometry
      • setPointByVal

        public void setPointByVal​(int index,
                                  Point pointSrc)
        Description copied from class: MultiVertexGeometry
        Sets the vertex at given index of the Geometry.
        Specified by:
        setPointByVal in class MultiVertexGeometry
        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 class Geometry
        Returns:
        The state of the geometry.
      • getBoundary

        public 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 class Geometry
        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 class Geometry
        Parameters:
        semantics - The semantics for which to replace the NaNs.
        value - The value to replace NaNs with.