标签:bat ext level lib turn tap .com list [1]
import json import urllib import arcpy def getAddress(lng,lat): url= ‘http://restapi.amap.com/v3/geocode/regeo?key=9f8bd8c2574ed9000d1e995b894c4c12&location={},{}&poitype=&radius=1000&extensions=base&batch=false&roadlevel=‘ url=url.format(lng,lat) req = urllib.urlopen(url) ret = req.readlines() ret = json.loads(ret[0]) ret =ret[‘regeocode‘][‘formatted_address‘] return ret def mainFunc(): mxd = arcpy.mapping.MapDocument("CURRENT") layers = arcpy.mapping.ListLayers(mxd) fields = [‘FID‘,"SHAPE@XY","地址"] with arcpy.da.UpdateCursor(layers[0], fields) as cursor: for row in cursor: addr = getAddress(row[1][0],row[1][1]) row[2]=addr cursor.updateRow(row)
ArcGIS中Python逆地理编码,根据坐标获取实际的地址
标签:bat ext level lib turn tap .com list [1]
原文地址:https://www.cnblogs.com/lwngreat/p/10199527.html