com.esri.arcgis.geometry
Interface IPointCollection

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IPointCollection2, IPointCollection3, IPointCollection4, IPointCollection5
All Known Implementing Classes:
IPointCollection2Proxy, IPointCollection3Proxy, IPointCollection4Proxy, IPointCollection5Proxy, IPointCollectionProxy, MultiPatch, Multipoint, Path, Polygon, Polyline, Ring, TriangleFan, Triangles, TriangleStrip

public interface IPointCollection
extends java.io.Serializable

Provides access to members that manipulate the points of a Multipoint, Path, Ring, Polyline, Polygon, TriangleFan, TriangleStrip, or MultiPatch.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Description

Used to access and manipulate the Points in Multipoints, Paths, Rings, Polylines, Polygons, TriangleFans, TriangleStrips, and MultiPatches.  IPointCollection can be used to create Multipoints, TriangleFans, TriangleStrips, Line-based Paths, Line-based Rings, single-path Line-based Polylines, and single-ring Line-based Polygons.  Multipoints, TriangleFans, and TriangleStrips return references to the points in the collection.  All other geometries return copies of points instead of direct references.  PointCollections can be used to get, count, add, insert, query, remove, replace, set, and update the Points in a geometry.  Depending on the method, Points can be manipulated as a single Point, an array of Points, or a collection of Points.

 

If you are using a .NET enabled language, such as VB.NET, you may want to use the alternative versions of IPointCollection methods exposed by the IGeometryBridge and IGeometryBridge2 interfaces.

See Also:
IPoint

Method Summary
 void addPoint(IPoint inPoint, java.lang.Object before, java.lang.Object after)
          Adds a vertex to a Path, Ring, Polyline, or Polygon; or adds a reference to the input point to a Multipoint, TriangleFan, or TriangleStrip.
 void addPointCollection(IPointCollection newPoints)
          Adds copies of points in the input point collection to this Path, Ring, Polyline, or Polygon; or adds references to the points in the collection to this Multipoint, TriangleFan, or TriangleStrip.
 void addPoints(int count, IPoint newPoints)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.addPoints(com.esri.arcgis.geometry.IPointCollection4, com.esri.arcgis.geometry.IPoint[]).
 IEnumVertex getEnumVertices()
          A new enumerator for this point collection.
 IPoint getPoint(int i)
          A copy of the ith vertex of a Path, Ring, Polyline, or Polygon; or a reference to the ith point of a Multipoint, TriangleFan, or TriangleStrip.
 int getPointCount()
          The number of points in the collection.
 void insertPointCollection(int index, IPointCollection newPoints)
          Inserts copies of points, from the input point collection, as vertices into this Path, Ring, Polyline, or Polygon; or references to points in the input point collection into this Multipoint, TriangleFan, or TriangleStrip.
 void insertPoints(int index, int count, IPoint newPoints)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.insertPoints(com.esri.arcgis.geometry.IPointCollection4, int, com.esri.arcgis.geometry.IPoint[]).
 void queryPoint(int index, IPoint point)
          Queries for a point in the PointCollection at given index.
 void queryPoints(int index, int count, IPoint points)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.queryPoints(com.esri.arcgis.geometry.IPointCollection4, int, com.esri.arcgis.geometry.IPoint[][]).
 void removePoints(int index, int count)
          Removes vertices from a Path, Ring, Polyline, or Polygon, or references to points from a Multipoint, TriangleFan, or TriangleStrip.
 void replacePointCollection(int index, int goingAway, IPointCollection newPoints)
          Replaces vertices/points within a PointCollection.
 void replacePoints(int index, int comingIn, int goingAway, IPoint newPoints)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.replacePoints(com.esri.arcgis.geometry.IPointCollection4, int, int, com.esri.arcgis.geometry.IPoint[]).
 void setPointCollection(IPointCollection newPoints)
          Replaces all vertices of this Path, Ring, Polyline, or Polygon with copies of the points in the input collection; or all points of this Multipoint, TriangleFan, or TriangleStrip with references to points from the input collection.
 void setPoints(int count, IPoint newPoints)
          Replaces all existing vertices of this Path, Ring, Polyline, or Polygon with copies of the input points; or all existing points of this Multipoint, TriangleFan, or TriangleStrip with references to the input points (for C++ and VB users only).
 void updatePoint(int i, IPoint p)
          Changes the ith vertex or point to be a copy of the input point.
 

Method Detail

getPointCount

public int getPointCount()
                  throws java.io.IOException,
                         AutomationException
The number of points in the collection.

Supported Platforms

Windows, Solaris, Linux

Description

Returns the number of Points in the PointCollection.  The last Point in the PointCollection has an index equal to PointCount - 1.

Returns:
The cPoints
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPoint

public IPoint getPoint(int i)
                throws java.io.IOException,
                       AutomationException
A copy of the ith vertex of a Path, Ring, Polyline, or Polygon; or a reference to the ith point of a Multipoint, TriangleFan, or TriangleStrip.

Supported Platforms

Windows, Solaris, Linux

Description

Gets the ith Point from the PointCollection.  The first Point in the PointCollection has index 0, and the last Point has index equal to PointCount - 1.  (Alternatively, the last Point in the PointCollection can be referenced using index -1.).

Remarks

Note: Since a copy of the point is returned by Point (get_Point) for path, ring, polyline and polygon the IPointCollection::UpdatePoint method must be used to update points on those geometry types.

Parameters:
i - The i (in)
Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addPoint

public void addPoint(IPoint inPoint,
                     java.lang.Object before,
                     java.lang.Object after)
              throws java.io.IOException,
                     AutomationException
Adds a vertex to a Path, Ring, Polyline, or Polygon; or adds a reference to the input point to a Multipoint, TriangleFan, or TriangleStrip.

Supported Platforms

Windows, Solaris, Linux

Description

Adds a Point to a PointCollection.  If before and after are omitted, the Point is added to the end of the PointCollection.  Additionally, by specifying either the before or after index, the Point can be added at a specific location in the PointCollection.

Parameters:
inPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
before - A Variant (in, optional, pass null if not required)
after - A Variant (in, optional, pass null if not required)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

updatePoint

public void updatePoint(int i,
                        IPoint p)
                 throws java.io.IOException,
                        AutomationException
Changes the ith vertex or point to be a copy of the input point.

Supported Platforms

Windows, Solaris, Linux

Description

Updates the ith Point with a copy of the input Point.  Update replaces the reference to the indexed point with a reference to the input Point.

Remarks

For efficiency UpdatePoint does not check if the spatial reference of the input point is equal to the spatial reference of the PointCollection. Please make sure that the spatial reference of the input point is equal to the spatial reference of the PointCollection before you pass the point in.

Note : You can also explicitly check the spatial reference by using IClone::IsEqual

Parameters:
i - The i (in)
p - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryPoints

public void queryPoints(int index,
                        int count,
                        IPoint points)
                 throws java.io.IOException,
                        AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.queryPoints(com.esri.arcgis.geometry.IPointCollection4, int, com.esri.arcgis.geometry.IPoint[][]).

Copies some points to an existing array of points. This method is intended for internal use only.

Supported Platforms

Windows, Solaris, Linux

Description

Queries a specified number (Count) of Points starting at the given index into an array of Points.

Parameters:
index - The index (in)
count - The count (in)
points - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertPoints

public void insertPoints(int index,
                         int count,
                         IPoint newPoints)
                  throws java.io.IOException,
                         AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.insertPoints(com.esri.arcgis.geometry.IPointCollection4, int, com.esri.arcgis.geometry.IPoint[]).

Inserts copies of the input points as vertices into a Path, Ring, Polyline, or Polygon; or references to the input points into a Multipoint, TriangleFan, or TriangleStrip. This method is intended for internal use only.

Supported Platforms

Windows, Solaris, Linux

Description

Inserts a specified number (Count) of Points into the PointCollection at the given index from an array of Points.  The first Count points from the array are inserted.

Parameters:
index - The index (in)
count - The count (in)
newPoints - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertPointCollection

public void insertPointCollection(int index,
                                  IPointCollection newPoints)
                           throws java.io.IOException,
                                  AutomationException
Inserts copies of points, from the input point collection, as vertices into this Path, Ring, Polyline, or Polygon; or references to points in the input point collection into this Multipoint, TriangleFan, or TriangleStrip.

Supported Platforms

Windows, Solaris, Linux

Description

Inserts a PointCollection of Points into the PointCollection at the specified index.  The resulting PointCollection does not retain information about the distinction between the old and new Point Collections.

Parameters:
index - The index (in)
newPoints - A reference to a com.esri.arcgis.geometry.IPointCollection (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addPoints

public void addPoints(int count,
                      IPoint newPoints)
               throws java.io.IOException,
                      AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.addPoints(com.esri.arcgis.geometry.IPointCollection4, com.esri.arcgis.geometry.IPoint[]).

Adds copies of the input points as vertices to this Path, Ring, Polyline, or Polygon; or references to the input points to this Multipoint, TriangleFan, or TriangleStrip. This method is intended for internal use only.

Supported Platforms

Windows, Solaris, Linux

Description

Adds the first specified number (Count) of Points to the PointCollection from an array of Points (with at least Count points).  The Points are all added to the end of the PointCollection in the same sequence as they are ordered in the array.

Parameters:
count - The count (in)
newPoints - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addPointCollection

public void addPointCollection(IPointCollection newPoints)
                        throws java.io.IOException,
                               AutomationException
Adds copies of points in the input point collection to this Path, Ring, Polyline, or Polygon; or adds references to the points in the collection to this Multipoint, TriangleFan, or TriangleStrip.

Supported Platforms

Windows, Solaris, Linux

Description

Adds a PointCollection of Points to the end of the PointCollection.  The resulting PointCollection does not retain the division between the old PointCollection and the additional PointCollection.

Parameters:
newPoints - A reference to a com.esri.arcgis.geometry.IPointCollection (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPoints

public void setPoints(int count,
                      IPoint newPoints)
               throws java.io.IOException,
                      AutomationException
Replaces all existing vertices of this Path, Ring, Polyline, or Polygon with copies of the input points; or all existing points of this Multipoint, TriangleFan, or TriangleStrip with references to the input points (for C++ and VB users only).

Parameters:
count - The count (in)
newPoints - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPointCollection

public void setPointCollection(IPointCollection newPoints)
                        throws java.io.IOException,
                               AutomationException
Replaces all vertices of this Path, Ring, Polyline, or Polygon with copies of the points in the input collection; or all points of this Multipoint, TriangleFan, or TriangleStrip with references to points from the input collection.

Parameters:
newPoints - A reference to a com.esri.arcgis.geometry.IPointCollection (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removePoints

public void removePoints(int index,
                         int count)
                  throws java.io.IOException,
                         AutomationException
Removes vertices from a Path, Ring, Polyline, or Polygon, or references to points from a Multipoint, TriangleFan, or TriangleStrip.

Supported Platforms

Windows, Solaris, Linux

Description

Removes a specified number (Count) of Points from a PointCollection starting at a given index.

Parameters:
index - The index (in)
count - The count (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEnumVertices

public IEnumVertex getEnumVertices()
                            throws java.io.IOException,
                                   AutomationException
A new enumerator for this point collection.

Supported Platforms

Windows, Solaris, Linux

Description

Returns an EnumVertex for the vertices in the PointCollection.  The EnumVertex allows the Points to be tranversed in a sequential order.

Returns:
A reference to a com.esri.arcgis.geometry.IEnumVertex
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

replacePoints

public void replacePoints(int index,
                          int comingIn,
                          int goingAway,
                          IPoint newPoints)
                   throws java.io.IOException,
                          AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeometryEnvironment.replacePoints(com.esri.arcgis.geometry.IPointCollection4, int, int, com.esri.arcgis.geometry.IPoint[]).

Replaces vertices/points within a PointCollection.

Supported Platforms

Windows, Solaris, Linux

Description

Removes a specified number (goingAway) of Points from a PointCollection starting at a given index and replaces them (starting at the same index) with a specified number (comingIn) of Points from an array of Points.

 

If you are using attempting to use this method from a .NET enabled language, such as VB.NET, you may need to use the ReplacePoints method provided by the IGeometryBridge interface exposed on the GeometryEnvironment object.

Parameters:
index - The index (in)
comingIn - The comingIn (in)
goingAway - The goingAway (in)
newPoints - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

replacePointCollection

public void replacePointCollection(int index,
                                   int goingAway,
                                   IPointCollection newPoints)
                            throws java.io.IOException,
                                   AutomationException
Replaces vertices/points within a PointCollection.

Supported Platforms

Windows, Solaris, Linux

Description

Replaces a specified number (goingAway) of Points in the PointCollection begining at a given index with a PointCollection of Points (inserted at the given index).

Parameters:
index - The index (in)
goingAway - The goingAway (in)
newPoints - A reference to a com.esri.arcgis.geometry.IPointCollection (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryPoint

public void queryPoint(int index,
                       IPoint point)
                throws java.io.IOException,
                       AutomationException
Queries for a point in the PointCollection at given index.

Supported Platforms

Windows, Solaris, Linux

Description

Queries the ith Point from the PointCollection.  The first Point in the PointCollection has index 0, and the last Point has index equal to PointCount - 1.  (Alternatively, the last Point in the PointCollection can be referenced using index -1.).

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

Parameters:
index - The index (in)
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.