how to get only x, y coordinate output from geocode

961
6
10-20-2010 08:57 AM
RaymondWen
New Contributor
Hi,

I've tried to search how to get x,y coordinate only in Script but not writing to shape files or feature classes as in GeoCodeAddress function specified. I've make a script worked but it's output to shape files which is not wanted for me. I've researched on this for several days but didn't get any progress. Can anyone please help? Thanks a lot~~

rwen
Tags (2)
0 Kudos
6 Replies
BradNiemand
Esri Regular Contributor
What locator are you using?

Brad
0 Kudos
BradNiemand
Esri Regular Contributor
You can get just x and y back if you use ArcGIS Online via REST.

Brad
0 Kudos
RaymondWen
New Contributor
Hi Brad,

Thanks a lot for your reply. I've created a geolocator based on data in ESRI media disk and published it as geocoding service from ArcGIS Server. However when I tried to use script embed in arctoolbox to access the locator published from the service, I found out that the function "geocodeAddresses_geocoding" has to have output parameter either a feature class or a shape file. How can I get only x and y instead of output to files?

RWen
0 Kudos
BradNiemand
Esri Regular Contributor
You are correct.  You would need to use REST or SOAP and then you could process the result to get just the X and Y values.  Why are you looking for just X and Y and what format would you like the result to be?
0 Kudos
RaymondWen
New Contributor
Hi Brad,

Originally the purpose is for testing the non-interupt connections to the gc service by calling the gc service numerous times to see if the connection will broke. And the result should be returned in x,y for latitude and longtitude(Client required). Now I've used soap in a console program for this. Just to confirm that in python script, there's no other way for achieving the same goal?

RWen
0 Kudos
BradNiemand
Esri Regular Contributor
I guess you have a few options when it comes to getting the X, Y values from the geocoding service and each one has its pros and cons:

1.  Use GP Geocode Addresses Tool within a model and post-process the geocoded featureClass to extract the X and Y values.  Within the model you can make the output geocoded featureClass an "Intermediate" or even "In Memory" output so that it does not stay around after.
2.  Use SOAP and the GeocodeAddresses method to get back a recordSet that will need to be post-processed to extract the X and Y values.  You will need to pass WriteXYCoordFields with a value of "true" in the PropMods PropertySet that you pass in GeocodeAddresses.
3.  Use SOAP and GeocodeAddress method to get back a PropertySet that contains the Geocoded Result of a single address and post-process the result to extract the X and Y values.  You would also need to have WriteXYCoordFields in the PropMods PropertySet as in option 2.
4.  Use REST and FindAddressCandidates method to geocode a single address and get multiple candidates that you will need to post-process and to find the best candidate and get the X and Y values from it.

As you can see, there are many options but I am not 100% sure what your requirements and your workflow look like.  I can give further direction if you can clarify your requirements and perferred workflow.

Brad
0 Kudos