- 积分
- 55955
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2016-10-18 22:35:19
|
显示全部楼层
参考此脚本:
- fn = 'D:/Temp/ascii/lighting/2009_06_06.txt'
- tf = open(fn)
- m_henan = shaperead('D:/Temp/Map/henan.shp')
- lats = []
- lons = []
- vs = []
- for aline in tf:
- datalist = aline.split()
- lat = float(datalist[3].split('=')[1])
- lon = float(datalist[4].split('=')[1])
- isin = inpolygon(lon, lat, m_henan.shapes()[0])
- if isin:
- v = float(datalist[5].split('=')[1])
- lats.append(lat)
- lons.append(lon)
- vs.append(v)
- lon = array(lons)
- lat = array(lats)
- v = array(vs)
- #Plot
- axesm()
- mlayer = shaperead('D:/Temp/map/bou2_4p.shp')
- geoshow(mlayer)
- ss = makesymbolspec('point', {'value':(-10000,0), 'color':'b', 'marker':'m', 'size':6, 'caption':'Negative'}, \
- {'value':(0,10000), 'color':'r', 'marker':'+', 'size':6, 'caption':'Positive'})
- layer = scatterm(lon, lat, v, symbolspec=ss)
- legend(legend=layer.legend(), loc='lower left')
- xlim(90, 130)
- ylim(20, 50)
- title('Lighting locations')
|
|