Selected features within a buffer not getting accurate results

4286
3
06-02-2015 10:42 AM
JssrRR
by
Occasional Contributor II

I am working on a Javascript application where I have a MSD published on ArcGIS server and I am using the URL from it's REST services. I am trying to select census block points that fall within a defined buffer distance and get a summary of number of blocks and housing units. I have it working but I am not getting consistent or accurate results, especially as the number of selected features increase.

I have the buffer circle set like this:

circleBuffer = new Circle({ center: mapPoint, geodesic: true, radius: radius, radiusUnit: "esriMiles" });.

BlockPoints.PNG

When I check the number of blocks selected within a 10 mile buffer around the same block point in ArcMap, I get different results. I tried with changing  this,  mode: FeatureLayer.MODE_AUTO,  to ONDEMAND and SELECTION but still no difference in results.

I have attached the JS file for the application if anyone can take a look at that and suggest what needs to be changed to correct this.

Thanks

0 Kudos
3 Replies
thejuskambi
Occasional Contributor III

Quick question, why are you passing circleBuffer.getExtent, and then looping through the response to find if it is within the circle. pass the circle directly and get the result.

I am not sure how the client contains logic is implemented. nor if the point size is considered to identify if it is within or not.

0 Kudos
JssrRR
by
Occasional Contributor II

Hi Thejus,

I am using this sample from the API reference and that is how it is done here:

Select with Feature Layer | ArcGIS API for JavaScript

If you can show me how to do that as per your suggestion I can try and see if that works.

Thanks

RobertScheitlin__GISP
MVP Emeritus

The reasoning behind the esri sample using the circle extent is that the query operation on an extent is much faster and less data is sent to the server. The client side operation of determining if a geomerty is in a polygon or not is very efficient.