Monday, September 8, 2008

Identifying duplicate Spatial Features in GeoMedia

Many times we have a feature class that has the same feature duplicated, and we want to identify which they are, so we can delete them.

Here is one method that works that has been applied in City of Milpitas GIS.

Let us have a feature class F which is a simple geometry class with an ID.

Step 1. Create a Spatial Intersection query between F and F (yes, with itself) for the geometries that are "Spatially equal"; We will call this Query 1

Step 2. Look at the results of Query 1 in a Data table. You will see ID and ID1 Columns. The number of entries in the table should be equal to or greater than the number of features in F

Step 3. Create an Attribute Query of Query 1 such that ID - ID1 < 0. We will call this Query 2. (This step is not obvious: What we want is ID < ID1, but GeoMedia does not accept that a valid expression, but ID-ID1 < 0 serves the same purpose.)

Step 4. Look at the result of Query 2 in a Data Table. If there are 0 entries, it means that there are no duplicate geometries in the Feature Class F. Each line in the Data Table of Query 2 shows a pair of features in F that are Spatially equal, where ID is the feature with the lower value ID, and ID1 is the feature with higher value ID.

Note that these are pairwise comparisons. So 2 features Spatially Equal show in 1 record, 3 features Spatially Equal will show 3 records, 4 features spatially equal will show 6 records, and so on.

The result is that we have now identified features that are Spatially Equal. The next step may be to keep one of the features, and delete the rest of the features that are spatially equal. This will be described in an upcoming post if there is enough interest.

3 comments:

Philip Scott said...

Thanks alot this was very useful

Phil Scott said...

Thanks alot this was very useful

Geomedia Analysis Blogmaster said...

Phil,
Would you be kind enough to indicate how you found it useful, and if there are any suggestions for changes or alternate methods?