Use intersect on one layer and find the duplicated geometries

2160
8
Jump to solution
02-07-2013 05:31 AM
ShayanNikoohemat
New Contributor
Hi Friends,

I want to use this intersect sample code of arcobject vba to catch duplicates in lines and polygons : http://edndoc.esri.com/arcobjects/9.1/componenthelp/esricarto/IBasicGeoprocessor_Intersect_Example.h...

1:The problem is that when I apply it on the same layer to find duplicated features it doesn't work, while through toolbox> overlay> intersect it works properly. Here is a sample image:
[ATTACH=CONFIG]21546[/ATTACH]

2: Do you have any other workaround for catching duplicates in polylines and polygons, I thought about a: TopologicalOperator::simplify, b: RelationalOperator::equals,  c: finding centroids and midlines, but I don't know which one is a correct solution.

Note: I don't want use attribute table to remove duplication, I need a geometrical solution.

Thanks.
0 Kudos
1 Solution

Accepted Solutions
AlexanderGray
Regular Contributor II
Firstly you need arcinfo license, ArcView won't do.

Find Identical info is here:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000054000000

delete identical
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Delete_Identical/001700000053000000/

the vb.net help might be of use to show how to call the tool, it will be a little different in VBA.
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000m0s000000

VBA support is being phased out by esri so there is not a lot of info on it and expect to see it disappear (I would not used VBA for new development.)

View solution in original post

0 Kudos
8 Replies
AlexanderGray
Regular Contributor II
Hi there, would the geoprocessing tool "find identical" using only the shape field not do this for you?  Shape field would compare geometries...
0 Kudos
WeifengHe
Occasional Contributor II
I'd use IRelationalOperator::equals to find out whether or not 2 geometries are duplicate.
0 Kudos
AlexanderGray
Regular Contributor II
IRelationalOperator::equals is a good idea but in my experience you need to compare all geometries to all other geometries it can be very slow for large feature classes.  You can try to be smarter and check if the index intersects first but it is still quite slow.   I build a tool to do this back in 9.1 for a client.  I used featureindex to narrow down the search and then IRelationalOperator.equals.  I have found the featureindex to be somewhat finicky.  If I had to do it again I would try to use the find intersect tool.
0 Kudos
ShayanNikoohemat
New Contributor
Agray1,

Thanks for your reply, I think "find identical" could be a good solution, but do you have any clue for my first problem regarding not only identical but also partly duplication such as a segment duplication of a polyline. Because with intersect tool we can identify them in the same layer, but from the code it doesn't work.

Thanks.
0 Kudos
AlexanderGray
Regular Contributor II
The basic geoprocessor is pretty much obsolete.  I believe it came out in the 8.x series as a replacement for the geoprocessing tools that ArcView GIS 3.2 had at the time.  Back then, the toolbox was a separate application from ArcMap and ArcCatalog and ArcView 3.x had these tools in the main application so they needed that too.  You can't really compare them to the Geoprocessing tools, they are completely different.  You can call GP tools from ArcObjects though but that is very different from using IBasicGeoprocessor.

IBasicGeoprocessor provides access to the methods and properties of the BasicGeoprocessor object.  The functionality of the BasicGeoprocessor object had been superseded by the new Geoprocessing framework of ArcGIS starting at version 9.0.  Developers should utilize the new tools whenever possible.
0 Kudos
ShayanNikoohemat
New Contributor
Agray1,

Then how can I use "find & delete identical" in my vba code?
It is really appreciated if to be specific because I am not advanced in arcobjects.

Thanks,
Shayan
0 Kudos
AlexanderGray
Regular Contributor II
Firstly you need arcinfo license, ArcView won't do.

Find Identical info is here:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000054000000

delete identical
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Delete_Identical/001700000053000000/

the vb.net help might be of use to show how to call the tool, it will be a little different in VBA.
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000m0s000000

VBA support is being phased out by esri so there is not a lot of info on it and expect to see it disappear (I would not used VBA for new development.)

View solution in original post

0 Kudos
ShayanNikoohemat
New Contributor
I know ArcObj. VBA is deprecated but for some reasons I need to use it.
Thanks for your reply.

SHayan
0 Kudos