AnsweredAssumed Answered

SPATIAL_REL_CONTAINS or SPATIAL_REL_INTERSECTS

Question asked by Dean.Wilson7232 on May 23, 2019
Latest reply on May 23, 2019 by Dean.Wilson7232

Good morning!

I'm trying to get this spatial query right, and as per the subject above, whats the difference between SPATIAL_REL_CONTAINS or SPATIAL_REL_INTERSECTS?  If spatial_rel_contains is for one polygon that's completely contained in another polygon, why does the description read "Part or all of a feature from feature class 1 is contained within a feature from feature class 2." ? Here's why I ask this....

 

I have a parcel geometry.  I'm trying to find out what survey area its in using the survey area geometry.  Well, when I use intersects, I'm getting 4 different survey areas.  It should only be showing one survey area that its in.  Here's the rub.  When I use contains instead of intersects, it doesn't find ANY SURVEY AREAS.  Isn't contains supposed to be able to allow for partial contains?  Here's how I'm putting my function together (I know I have the contains commented out.  So right now its using intersects and not contains):

 

_fetchVMSData: function(){
     let vmsQuery = new Query();
     vmsQuery.geometry = features[0].geometry;
     //vmsQuery.spatialRelationship = Query.SPATIAL_REL_CONTAINS;
     vmsQuery.outFields = ["VMS", "SEC_NUM", "TOWNSHIP", "RANGE"];

    let vmsQueryTask = new        QueryTask("https:// service where the survey geometries are");
return vmsQueryTask.execute(vmsQuery);
}

Outcomes