Identyfikacja duplikatów obiektów klasy w GeoMedia
Tomasz Bartuś
OPROGRAMOWANIE
Geomedia Professional: 06.01.11.13
PROBLEM:
Identifying duplicate Spatial Features in GeoMedia
ROZWIĄZANIE:
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.
- 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,
- 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,
- 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.)
- 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.