Select to view content in your preferred language

Finding an address using Python

938
1
02-01-2013 07:26 AM
AdrianWelsh
MVP Honored Contributor
I'm getting back into Python coding and couldn't find any examples of this.  I basically want to write a script that displays an input box where the user will type in an address.  I want the address to be found and then zoomed to on the map.  Later on, this location will have a point added to it.  But my question is, is there a way to use Python to find one user-entered address?

Thanks!
Tags (2)
0 Kudos
1 Reply
MikeMacRae
Frequent Contributor
Hey Adrian,

You can start with the geocoding python example here:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002600000006000000.htm

I haven't played with this function yet, but I think the example will allow you to select an address from a table.

To zoom, depending on how you're setting things up, there is a zoomToSelectedFeatures () method when working with a dataframe in python. See this page and look at the Method section:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s300000003000000

To add a point, I would set an insert cursor in your python program and read in the x,y coordinates of your selected address and write it to the row you just inserted.

Hope this gets you on the right track.

Mike
0 Kudos