Skip to content

Instantly share code, notes, and snippets.

@danabauer
Last active December 17, 2015 11:38
Show Gist options
  • Save danabauer/5603205 to your computer and use it in GitHub Desktop.
Save danabauer/5603205 to your computer and use it in GitHub Desktop.
ULRS geocoder SOAP
#!/usr/bin/env python
#import suds
from suds.client import Client
#WSDLURL = 'http://lr01.internal.xxxxx.com/HUDSON_ULRSWebServices_581/GISService.asmx?WSDL'
WSDLURL = 'http://lr05.internal.xxxxx.com/ULRS.WebServices2/GISService.asmx?WSDL'
_ulrsws = Client(WSDLURL, cache=None)
def geocode(address):
return _ulrsws.service.Geocode(clientName='test', input=address)
if __name__ == '__main__':
#get addresses
addresses = ['321 south st', '340 12th st', '999 mystery lane']
#create table
table = []
for address in addresses:
result = geocode(address)
if result.Locations:
for location in result.Locations[0]:
table.append({ 'OriginalAddress': address, 'StandardizedAddress': location.Address.StandardizedAddress, 'X': location.XCoord, 'Y': location.YCoord});
else:
table.append({ 'OriginalAddress': address, 'StandardizedAddress': 'NO MATCH', 'X': 0, 'Y': 0});
print table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment