Select to view content in your preferred language

Point Inside a buffer

1918
1
Jump to solution
03-24-2016 04:14 AM
NadirHussain
Frequent Contributor

               circle = new esri.geometry.Circle({center:clickedPt,geodesic: true,radius:parseInt($('#cmbBuffer').combobox('getText')),radiusUnit: strUnit});         

                query = new esri.tasks.Query();

                query.returnGeometry = true;

                query.outFields = ["*"];

                query.geometry = circle.getExtent();

                //query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;

                queryTask.execute(query,selectInBuffer1);

the above code i am using to draw a circle and then get the feature from inside the buffer.It returns me some points.Some are inside and some are out side.i dont want point outside from buffer.what can be the reason.i am using bing map as a base map.that can one of the reason might be.please help.the result map is attached.

thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Nadir,

  Your query geometry is the circles extent thus the points outside the circle. You should be using the circles extent for speed, but then you have to get the results of the query and look though then and use the circle.contains(points) to see if the pint is actually inside the circle.

View solution in original post

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Nadir,

  Your query geometry is the circles extent thus the points outside the circle. You should be using the circles extent for speed, but then you have to get the results of the query and look though then and use the circle.contains(points) to see if the pint is actually inside the circle.

0 Kudos