What are the limitations of touches()?

2687
3
09-29-2015 12:36 PM
LR
by
Occasional Contributor III

I have a rather large and complex shape I created from a flood raster in ArcMap*. When I imported it into CE and tried to test it with touches(), the function didn't trigger. I then simplified the shape in ArcMap and tried again, but that did nothing. I then created a few similar shapes manually in CE and they worked. What could be the problem here? Is there a limit on the shape size, geometry or complexity?

Screenshot:

1: Shape created in CE, 40 vertices

2: Shape created in CE, 78 vertices

3: Shape created in Arcmap which reports 117 vertices (according to CE's geometry.nVertices(): 101)

4: Shape created in ArcMap from the above one (simplified), ArcMap: 54, CE: 37 vertices

5: Shape created in ArcMap, 4 vertices

The cubes are the "touch-tester", with yellow indicating a touch.

shapes.png

*I tried two ways, "raster to polygon" and "raster domain", but both lead to the same results.

Tags (2)
0 Kudos
3 Replies
MatthiasBuehler
Occasional Contributor III

Hi,

try using touches with 3d geometries, so extrude the polygons you're working with.

once you have done the test and gotten the result, go back to the original face with comp(f)

Cheers,
Matt

0 Kudos
LR
by
Occasional Contributor III

Hi,

thanks, I already did that. The problem were the shape's multipart features - changing them to singlepart fixed the problem.

0 Kudos
CherylLau
Esri Regular Contributor

The help pages say that occlusion testing should only work on closed geometries:

In any case, tests can only be performed against geometries which form a closed surface (i.e. a waterproof mesh which has no boundary edges), other geometries are ignored.

Occlusion Query Functions

(end of the first paragraph after the table)

I'm not sure why the tests worked on the polygons.  (I tried to recreate your test 1 with just a rectangular shape and a cube, but I couldn't get the test to detect the occlusion.)

In any case, doing the extrude to create some 3D geometry followed by a component split should solve the problem as Matt suggested.  This works because the component split creates a ghost model (of the shape before the comp happens) that is used for occlusion testing.

0 Kudos