10 Replies Latest reply: Oct 3, 2013 1:57 PM by Siva Ravada

# working with topology

Hello experts

I want to check geometry gaps between polygons, lines in the present in same table and with polygons and lines present in different tables.

I have built topology and loaded all geometries into topology and tried with following sql.

SQL> select c.feature_name from topo_states c, topo_states s where s.feature_name='New York' and sdo_touch(c.feature, s.feature)='TRUE';

(1) As i need to select geometries that do not touch, so i tried with 'FALSE', but there is error. Is there any other method to do this ?

(2) If two adjacent polygons have 4 common vertices  and 2 are not common vertices (means touching with resepct to 4 vertices and not touching with resepct to 2 vertices), whether sdo_touch can detect this kind of gaps / errors ?

request your help with right approach..

• ###### 1. Re: working with topology

1. Right, you can only use TRUE for the value. Here you have the "positive" version:

SQL> select c.feature_name from topo_states c, topo_states s where s.feature_name='New York' and sdo_touch(c.feature, s.feature)='TRUE';

You have a few options. The simplest solution is to just use a NOT to make it "negative" such as:

SQL> select c.feature_name from topo_states c, topo_states s where s.feature_name='New York' and NOT sdo_touch(c.feature, s.feature)='TRUE';

From the manual:

NOT: Returns TRUE if the following condition is FALSE. Returns FALSE if it is TRUE. If it is UNKNOWN, it remains UNKNOWN.

If that performs poorly, we can give you something more complex.

2. I'm not sure exactly what you are asking. Yes, sdo_touch will shows those that touch, or you can use NOT to show those that do not.

Bryan

• ###### 2. Re: working with topology

Thanks Bryan

(1) I have included NOT in sql and it is fine.

(2) I want to check whether all vertices shared by two adjacent polygons are same or not so that any gaps in adjacent polygons can be identified. I have tested with sdo_touch, as you said it is showing as touch.

regards

• ###### 3. Re: working with topology

Bryan, In one word i want to identify sliver polygons

regards

• ###### 4. Re: working with topology

don123 wrote:

(2) I want to check whether all vertices shared by two adjacent polygons are same or not so that any gaps in adjacent polygons can be identified. I have tested with sdo_touch, as you said it is showing as touch.

Don,

That is because they do TOUCH, if not for all of the sides of the polygon. With the default operators there is no way to find slivers or gaps between polygons (I've searched for this myself). You'll have to analyze the sides yourself (of the top of my head you could try to examine the intersection: if that is one contiguous line then there is no gap, if it consists of two or more lines you are likely to have a gap/sliver).

Or you could turn your polygons into a Topology and use SDO_TOPO_MAP.VALIDATE_TOPOLOGY. I haven't used that myself, but looking at the docs it seems this might do what you want to achieve.

HTH,

Stefan

• ###### 5. Re: working with topology

Thanks Stefan,

I have loaded two tables with polygon geometry in to topology to check for gaps.

I have intentionally created some gap between polygons. When i run validate_topology as mentioned by you, it is returning true.

It is not clear what it is validating ?

regards

• ###### 6. Re: working with topology

Validate_topology does not report these issues as the topology is valid even if there are gaps between these geometries.

In topology model, these gaps are treated as faces.

You can create one feature geometry for each of the faces in the topology and analyze these feature geometries. If you find very small area polygons

then you know there are gaps. Similarly, you can look for very small edges to see if there are slivers.

siva

• ###### 7. Re: working with topology

Thanks Siva

FACES tables have MBR geometry as sdo_geometry, i can measure area of these rectangles. Kindly elaborate on the following.

(1) Do I need to create feature geometry from faces before measuring area ?

(2) In analyzing polygons, small area definition varies...any suggestions on this ?

In the case of lines, edges with small length can be analyzed for overshoot, but how to identify if edge is not snapping (or not touching ) with other line or polygon.

Do I need to use the spatial operator TOUCH in this case ? Is there any other way of doing this ?

regards

• ###### 8. Re: working with topology

It all depends on what level of accuracy you want for gap detection.

You can measure the area of the MBR geometry: but you know this is approximate area. So if this is ok for your

application, then you can go with this approach.

If you go with the features for faces, any geometry that has an area close to the tolerance can be considered a small polygon.

Any any polygon with a perimeter close to 4 times the tolerance is also very small.

But this all depends on your application and what is considered a gap by the application.

siva

• ###### 9. Re: working with topology

Thanks for the details. You have answered my question.

Kindly explain why (what is the application) do we do need MBR geometry in face table ?

regards

• ###### 10. Re: working with topology

The loadWindow operation queries the FACE\$ table to find the faces that should be loaded into the TopoMap.

That query does a sdo_anyinteract operator call against the MBR_GEOMETRY column.

Since there is no explicit geometry stored for the faces, the MBR_GEOMETRY column is the column we use for spatial queries.

siva