Fining the nearest features

543
5
11-07-2011 10:57 AM
CoreyStokes
New Contributor
Hello all,

I am pretty new to the ArcGIS API for Silverlight. I want to be able to pull all features that is closest to an address that the user inputs. Basically, such as finding the nearest restaurant near your house. Can anyone point me in the right starting direction. I have already reviewed the ESRI tutorials on using the find task and address locator.
0 Kudos
5 Replies
ChrisBradberry
Occasional Contributor
Hey,

You should be able to use this sample to buffer the address point and query the adjacent points.

http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#BufferQuery

chris
0 Kudos
CoreyStokes
New Contributor
Thanks for the link!

But, now how would I use the buffer to find a feature that is within, lets say a 100 meters of a user input zip code?
0 Kudos
ChrisBradberry
Occasional Contributor
Instead of using the map point, you would use a query to select the zip code polygon.  Buffer the selected polygon and then query the data from the buffer graphic.  Check out this link for buffering a polygon:

http://forums.arcgis.com/threads/17766-buffer-problem
0 Kudos
CoreyStokes
New Contributor
Sorry if Im not following correctly, Im a novice programmer.

But I just want to return a list of the features that are closest to the entered Zip Code.

-Corey
0 Kudos
ChrisBradberry
Occasional Contributor
Corey,

You will have to use a couple of the samples and put them together.  The best way to learn is to take a sample and make it work for yourself.  Start out with a simple process, then add on to it.

Check out this sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AttributeQuery
and change searching for the state and search for the zipcode.  You will need a map service for zipcodes.

here is a link for buffering a polygon
http://forums.arcgis.com/threads/24077-how-to-create-a-buffer-around-a-feature-polygon-in-a-feature-...

Then you will need to use the results from the buffer to select the point features (restaurants) that you are interested in.  This link:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SpatialQuery

the last sample has you create the polygon, you will have to modify that.
0 Kudos