You can try using GeomToShapes. This: --SQL SELECT [mfd_id], SPLIT CALL GeomToShapes([geom]) FROM [1 trace]; ...splits each geom into shapes (called 'islands' in 8). The first branch of each shape is an outer contour, all other branches are inner contours. So, if you run: --SQL VALUE @shapes TABLE = ( SELECT SPLIT CALL GeomToShapes([geom]) FROM [1 trace] ); SELECT GeomConvertToLine([value]) INTO [outer] FROM ( SELECT SPLIT CALL GeomToBranches([value]) FROM @shapes ) WHERE [branch] = 0; SELECT GeomConvertToLine([value]) INTO [inner] FROM ( SELECT SPLIT CALL GeomToBranches([value]) FROM @shapes ) WHERE [branch] <> 0; ...you will get outer contours in [outer] and inner contours in [inner]. On your data, the call to GeomToShapes will take a fairly long time, because it has to normalize a huge area. I note though that you want to classify some of the outer contours as inner. If so, what is the criteria? If an outer contour is contained in some other outer contour, it should be marked as inner? Then it would probably make sense to first fill all holes, then convert each branch to a line and check whether the line is adjacent to the area with all holes filled or intersects it (use either GeomAdjacent or GeomIntersects). The former branches are outer, the latter are inner.
|