How to define a Shape Comparison Language ?

625
2
12-02-2012 09:03 PM
HaoHu
by
New Contributor II
I have a feature layer with polygons. And I create a spatial query task to query the polygon which contains the point clicked by the user on the map (similar as identify). In this case, I can specify the spatial relation as SPATIAL_REL_INTERSECTS.

Now instead of querying the polygon contains the clicked point, I want to query all the rest polygons(the polygons do not contains the point). I think I might need to use Shape Comparison Language to specify a new type of spatial relation, just a point to polygon relation opposite to SPATIAL_REL_INTERSECTS. I know I should start with SPATIAL_REL_RELATION, but I have no idea the following steps.

Anyone can help me? Or is there any other possible solutions to that problem? Thanks in advance.
2 Replies
by Anonymous User
Not applicable
Bump, I had this same question.  Has anyone done this?
0 Kudos
SteveCole
Frequent Contributor
Unfortunately I don't have any actual code to share but here's an idea-


  1. Query the polygons for the one poly that does intersect your point feature. Take note of the polygon's OBJECTID

  2. Select all polygons using a "1=1" query.

  3. Construct an array of OBJECTIDs for all polygons.

  4. Remove the OBJECTID from the array for the polygon that did overlap the point feature

  5. Reselect the polygons based on the array of OBJECTIDs


That should get you what you want. I think. 😄

[EDIT: this might make it easier. Once you have the overlapping polygon's OBJECTID, re-query the polygons for "OBJECTID <> (overlapping polygon OBJECTID)"]

Steve
0 Kudos