- 积分
- 4568
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-4-2
- 最后登录
- 1970-1-1
|
发表于 2016-10-24 15:43:04
|
显示全部楼层
neimeng_map.gs
file='D:\gc\shuju\nm.txt'
file2='D:\gc\shuju\nm_ms.txt'
aa=read(file)
a=sublin(aa,2)
lon1=subwrd(a,1)
lat1=subwrd(a,2)
'q w2xy 'lon1' 'lat1
x1=subwrd(result,3)
y1=subwrd(result,6)
x0=x1
y0=y1
point1=' 'x0' 'y0
'set line 6'
i=1
while(i<=945)
bb=read(file)
b=sublin(bb,2)
lon2=subwrd(b,1)
lat2=subwrd(b,2)
'q w2xy 'lon2' 'lat2
x2=subwrd(result,3)
y2=subwrd(result,6)
point1=point1%' 'x2' 'y2
'draw line 'x1' 'y1' 'x2' 'y2
i=i+1
x1=x2
y1=y2
endwhile
'set line 0'
ff=close(file)
'set line 5 1 4'
'q gxinfo'
rec=sublin(result,3)
xmin=subwrd(rec,4)
xmax=subwrd(rec,6)
rec=sublin(result,4)
ymin=subwrd(rec,4)
ymax=subwrd(rec,6)
xmin=xmin+0.02
xmax=xmax-0.03
ymin=ymin+0.03
ymax=ymax-0.02
point2=xmin' 'y0' 'xmin' 'ymin' 'xmax' 'ymin' 'xmax' 'ymax' 'xmin' 'ymax' 'xmin' 'y0' 'x0' 'y0
points=' '
points=points% point1' 'point2
'set line 0'
'draw polyf' points
ff=close(file)
'q gxinfo'
aa=read(file2)
a=sublin(aa,2)
lon1=subwrd(a,1)
lat1=subwrd(a,2)
'q w2xy 'lon1' 'lat1
x1=subwrd(result,3)
y1=subwrd(result,6)
'set line 1'
i=1
while(i<=2183)
bb=read(file2)
b=sublin(bb,2)
lon2=subwrd(b,1)
lat2=subwrd(b,2)
'q w2xy 'lon2' 'lat2
x2=subwrd(result,3)
y2=subwrd(result,6)
'draw line 'x1' 'y1' 'x2' 'y2
i=i+1
x1=x2
y1=y2
endwhile
ff=close(file2)
return
nm.txt和nm_ms.txt都是
97.078566 42.902591
98.188566 42.721314
99.501038 42.617842
99.780487 42.668167
99.964646 42.701973
100.264726 42.690837
100.322694 42.749447
100.865718 42.737139
...
gs是
'open D:\gc\shuju\lspr.ctl'
'set lon 60 160'
'set lat 20 70'
'set t 1'
'set grads off'
'd lsprate'
'run d:\gc\shuju\neimeng_map.gs'
这种状况只有内蒙古底图没有lsprate变量绘制的图
'run d:\gc\shuju\neimeng_map.gs'
'd lsprate'
这样没有底图,只有lsprate变量绘制的图
求指导
|
|