Select to view content in your preferred language

Writing SOAP returned results to table in file geodatabase

3911
0
01-26-2015 09:52 AM
GeoffreyWest
Occasional Contributor III

I have a script which prints the lat, lon of bus routes, how would I use arcpy to print this to a table in a file geodatabase?

Example of Output

45.266759 -75.741350

45.266221 -75.741675

45.311531 -75.739158

45.355146 -75.769231

45.412336 -75.718080

import xml.etree.ElementTree as ET
import urllib

u = urllib.urlopen('https://api.octranspo1.com/v1.1/GetNextTripsForStop', 'appID=7a51d100&apiKey=5c5a8438efc643286006d82071852789&routeNo=95&stopNo=3044')
data = u.read()

f = open('route3044.xml', 'wb')
f.write(data)
f.close()

doc = ET.parse('route3044.xml')

for bus in doc.findall('.//{http://tempuri.org/}Trip'):
   lat = bus.findtext('{http://tempuri.org/}Latitude')
  lon = bus.findtext('{http://tempuri.org/}Longitude')
   print lat, lon
Tags (3)
0 Kudos
0 Replies