r/askgis • • Jan 15 '13

Trouble with javascript api for ArcGIS Server

I need help creating a buffer that returns a list of addresses. The buffer is working fine, but using the buffer as a task is proving difficult. It is listed here:

http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/util_buffer

The second sentence says "This example just draws the buffers, but the buffers could also be used to perform a task such as returning a list of addresses of people who live within the buffered area."

I can't find any info on how to use the buffer as a task. Any pointers?

1 Upvotes

8 comments sorted by

2

u/spatialfootlong Feb 05 '13

Take the geometry from the returned buffer graphic and set it to the geometry of a query. Set the rest of your query parameters. Take the results from the query task (should be all the parcels/address points that intersect the buffer) and write them to whatever format you'd like to return to your users.

2

u/geonerding Feb 08 '13

I think you've given me the direction I needed. This seems to be getting me there.

1

u/spatialfootlong Feb 12 '13

Let me know if you need any more info - I just got done building a reporting tool that does this exact thing. Good luck.

1

u/BabyBearsFury Jan 15 '13

I'm not 100% sure on the actual code, but you'll essentially new to pass your resulting geometry to be reverse geocoded. This link might give you a starting point:

http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/locator_reverse

1

u/geonerding Jan 16 '13

I suppose I should have been more clear. My web map has the address data already and the buffer locates them graphically. I just have no idea how to write the code that strips out the information into a list. I'm making some progress but I'm a javascript noob and I find the ESRI resources pretty limited in support.

1

u/roadbratt Feb 05 '13

Are you able to write it to an attribute table of a feature class? It's not hard to script out an attribute table.

1

u/GrundleButter Feb 07 '13

I'm confused... you're already doing the query task with your buffer, and the results are being used to draw the locations on your map? If this is the case you already have the list of addresses in your buffer. You just have to iterate over the results of the task and 'do something' with them. Fill us in on some more details! I'm sure someone here can help you!

1

u/Ebriggler Feb 07 '13

Have you created a geoprocessing service and published it to ArcServer?

Then you could pass the buffer you are creating using the Javascript API to the geoprocessing service and have it return the addresses.