|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.carto.FeatureIndex
public class FeatureIndex
A feature class index.
The FeatureIndex object is used to build a spatial index of features from a FeatureClass in memory for the purpose of finding the intersected features, nearest features, and within features.
Since there is a fair amount of overhead required to build this index, it is not efficient to use this object if the spatial operation is only going to be applied once. However, if many spatial queries are to be performed over the same set of features, than you may gain some performance benefits using this object.
It is important to always make sure that the Spatial References between the FeatureClass used to build the FeatureIndex and the query shape are either the same or IFeatureIndex.OutputSpatialReference has been called. Otherwise, the results will not be correct.
Constructor Summary | |
---|---|
FeatureIndex()
Constructs a FeatureIndex using ArcGIS Engine. |
|
FeatureIndex(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. FeatureIndex theFeatureIndex = (FeatureIndex) obj; |
Method Summary | |
---|---|
boolean |
equals(Object o)
Compare this object with another |
static String |
getClsid()
getClsid. |
ISpatialReference |
getOutputSpatialReference(String fieldName)
The spatial reference in which to output geometry for a given field. |
IFeatureCursor |
getWithin(IGeometry pShape)
Finds all features that the input shape lies within. |
int |
hashCode()
the hashcode for this object |
void |
index(ITrackCancel pTrackCancel,
IEnvelope pQueryingGeometryFullExtent)
Creates index. |
void |
intersectedFeatures(IGeometry pShape,
Object[] pSAIds)
Finds all intersected features in index to the input shape. |
void |
nearestFeature(IGeometry pShape,
int[] pClosestFeatureFID,
double[] pDistance)
Finds the nearest feature in index to the input shape. |
void |
nearestFeatures(IGeometry pShape,
Object[] pSAIds,
double[] pDistance)
Finds all nearest features in index to the input shape (i.e. |
void |
setFeatureClassByRef(IFeatureClass rhs1)
FeatureClass to index. |
void |
setFeatureCursorByRef(IFeatureCursor rhs1)
Cursor on feature class, to reduce the number of feature indexed (optional). |
void |
setOutputSpatialReferenceByRef(String fieldName,
ISpatialReference outputSpatialReference)
The spatial reference in which to output geometry for a given field. |
int |
withinFeature(IGeometry pShape)
Finds the first feature that the input shape lies within. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public FeatureIndex() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic FeatureIndex(Object obj) throws IOException
FeatureIndex theFeatureIndex = (FeatureIndex) obj;
obj
to FeatureIndex
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void setFeatureClassByRef(IFeatureClass rhs1) throws IOException, AutomationException
setFeatureClassByRef
in interface IFeatureIndex
setFeatureClassByRef
in interface IFeatureIndex2
rhs1
- A reference to a com.esri.arcgis.geodatabase.IFeatureClass (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setFeatureCursorByRef(IFeatureCursor rhs1) throws IOException, AutomationException
setFeatureCursorByRef
in interface IFeatureIndex
setFeatureCursorByRef
in interface IFeatureIndex2
rhs1
- A reference to a com.esri.arcgis.geodatabase.IFeatureCursor (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void index(ITrackCancel pTrackCancel, IEnvelope pQueryingGeometryFullExtent) throws IOException, AutomationException
index
in interface IFeatureIndex
index
in interface IFeatureIndex2
pTrackCancel
- A reference to a com.esri.arcgis.system.ITrackCancel (in)pQueryingGeometryFullExtent
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ISpatialReference getOutputSpatialReference(String fieldName) throws IOException, AutomationException
getOutputSpatialReference
in interface IFeatureIndex2
fieldName
- The fieldName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOutputSpatialReferenceByRef(String fieldName, ISpatialReference outputSpatialReference) throws IOException, AutomationException
Sets the current Output SpatialReference. It is important that this is set to the same SpatialReference as the input Shape's SpatialReference used as input in the IIndexQuery methods.
setOutputSpatialReferenceByRef
in interface IFeatureIndex2
fieldName
- The fieldName (in)outputSpatialReference
- A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void nearestFeature(IGeometry pShape, int[] pClosestFeatureFID, double[] pDistance) throws IOException, AutomationException
Returns the nearest indexed feature and the distance to it based on the input shape.
Pass the returned long into IFeatureClass.GetFeature to get the corresponding feature.
nearestFeature
in interface IIndexQuery
nearestFeature
in interface IIndexQuery2
pShape
- A reference to a com.esri.arcgis.geometry.IGeometry (in)pClosestFeatureFID
- The pClosestFeatureFID (out: use single element array)pDistance
- The pDistance (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IFeatureCursor getWithin(IGeometry pShape) throws IOException, AutomationException
getWithin
in interface IIndexQuery
getWithin
in interface IIndexQuery2
pShape
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void nearestFeatures(IGeometry pShape, Object[] pSAIds, double[] pDistance) throws IOException, AutomationException
Returns the nearest indexed features in a variant array and the distance to them based on the input shape.
It is similar to the NearestFeature (no final S) method except that if two or more features are found as the closest and so are exactly at the same distance from the source geometry, then all those are returned in the array.
Pass the returned array into IFeatureClass.GetFeatures to get the corresponding features.
nearestFeatures
in interface IIndexQuery2
pShape
- A reference to a com.esri.arcgis.geometry.IGeometry (in)pSAIds
- A Variant (out: use single element array)pDistance
- The pDistance (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void intersectedFeatures(IGeometry pShape, Object[] pSAIds) throws IOException, AutomationException
Returns the indexed features in an variant array that intersect the input shape.
Pass the returned array into IFeatureClass.GetFeatures to get the corresponding features
intersectedFeatures
in interface IIndexQuery2
pShape
- A reference to a com.esri.arcgis.geometry.IGeometry (in)pSAIds
- A Variant (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int withinFeature(IGeometry pShape) throws IOException, AutomationException
Returns the ObjectID of the first feature in the spatial index for which the input shape is within. -1 is returned in the case where the input shape is not within any features in the index.
withinFeature
in interface IIndexQuery2
pShape
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |