AnsweredAssumed Answered

Using jQuery for Intersects

Question asked by adinnouti on Aug 27, 2013
Latest reply on Aug 27, 2013 by adinnouti
I am trying to do a intersect between a Polygon and Points, the first step I get the polygon goAjaxCountry() and then with the results I try to get the points inside of the polygon goAjaxPoints(). However the points are not being filtered, I think the problem is with my rest parameters in  goAjaxPoints(). Do you have any advice?

 var url = 'someurl'; var country_response; var points_response;  function goAjaxCountry(){  restURL = url+'2/query';  restParm = {   where:"ISO3='MDG'",   f:'pjson'  };   $.post(restURL, restParm, function(data, textStatus) {   console.log('goAjaxCountry - ' + textStatus);   console.log(data);   $('#country_json').html('done');   country_response = data;   goAjaxPoints(data)  }, "json"); }  function goAjaxPoints(geo_country){   restURL = restURL = url+ '0/query';  restParm = {   where:"acq_date='2013-08-20'",   f:'pjson',   geometry: geo_country.features[0].geometry,   geometryType: geo_country.geometryType,     spatialRel: 'esriSpatialRelIntersects'  };    $.post(restURL, restParm, function(data, textStatus) {   console.log('goAjaxPoints - ' + textStatus);   console.log(data);   console.log(data.features.length)   points_response = data;  }, "json"); }



Thanks,
--Alex

Outcomes