Select to view content in your preferred language

GeometryService.Relation NON-IDENTICAL?

631
3
11-05-2010 12:03 PM
TylerWaring
Frequent Contributor
Greetings Everyone,
I have been struggling to figure out how to perform a spatial test on a graphics layer and a featureset. 

What I am trying to do is extend the graphical search functionality in the search widget so that a user can press the ???A??? key and add additional features to both the graphics layer and the RecordData class object.

I have figured the main functions for this extension but now I am finding that if the added features overlap the existing graphics layer then duplicates will be produced in both the graphics layer and the RecordData class object.

To overcome this problem, I would like to use compare the existing in map graphicslayer to the new featureset that is produced when an additional graphical query is made. I think I am looking to use a GeometryService.relation method with the spatialRelationship parameter set to SPATIAL_REL_RELATION. However I have no Idea how to set up the comparisonString.

I???ve tried to jump into the Shape Comparison Language documentation but I must admit that it is completely over my head. I have tried my best to generate the correct parameters but I am obviously doing something wrong. Here is what I???ve got:

myGeometryService.relation(compareArray1, compareArray2,GeometryService.SPATIAL_REL_RELATION,"compareArray1 != compareArray2")

The Error I get whilst running this method is:

[FaultEvent fault=[RPC Fault faultString="Object reference not set to an instance of an object." faultCode="500" faultDetail="Unable to perform the relation operation"] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]     

Does anyone know what I may be doing wrong?

Thanks 
Tyler Waring
Tags (2)
0 Kudos
3 Replies
DasaPaddock
Esri Regular Contributor
Another option could be to try and prevent the duplicates by not letting the server return the features that have already been loaded. Try adding a NOT IN SQL clause to the Query.where property.

e.g. OBJECTID NOT IN (1, 2, 3, ...)
0 Kudos
TylerWaring
Frequent Contributor
Thanks, That's exactly what I needed. Thanks for finding the right size solution for my problem. 

I am curious though, how do you integrate the Shape Comparison Language with a Flex applicaiton using GeometryService.SPATIAL_REL_RELATION? It sounds both interesting and powerful.

Any information will be greatly appreciated.

Tyler
0 Kudos
nicogis
MVP Alum
in relation you can write
myGeometryService.relation(compareArray1, compareArray2,GeometryService.SPATIAL_REL_RELATION ,"G1 != G2")

you must use G1 (compareArray1) and G2(compareArray2)  and not compareArray1 and not compareArray2

confront is done for index:
compareArray1[0]  with compareArray2[0]
compareArray1[1]  with compareArray2[1]
.....


IDENTICAL (G1, G2) = TRUE
IDENTICAL (G1, G2) = FALSE
G1 == G2
G1 = G2
G1 != G2

you also can reverse order

G2 != G2
....
0 Kudos