GoogleEarth卫星地图影像数据获取与应用.docx

上传人:scccc 文档编号:13138862 上传时间:2021-12-16 格式:DOCX 页数:21 大小:308.67KB
返回 下载 相关 举报
GoogleEarth卫星地图影像数据获取与应用.docx_第1页
第1页 / 共21页
GoogleEarth卫星地图影像数据获取与应用.docx_第2页
第2页 / 共21页
GoogleEarth卫星地图影像数据获取与应用.docx_第3页
第3页 / 共21页
GoogleEarth卫星地图影像数据获取与应用.docx_第4页
第4页 / 共21页
GoogleEarth卫星地图影像数据获取与应用.docx_第5页
第5页 / 共21页
点击查看更多>>
资源描述

《GoogleEarth卫星地图影像数据获取与应用.docx》由会员分享,可在线阅读,更多相关《GoogleEarth卫星地图影像数据获取与应用.docx(21页珍藏版)》请在三一文库上搜索。

1、Google Earth卫星地图影像数据获取与应用Google公司通过Google Earth数字化平台和互联网络,向全世界免费发布其所拥有的全球卫星影 像数据。本文I述如何从Google Earth数字平台获得用户关心区域的地图卫星影像。1地图卫星影像获取方案通过重写Google Earth 的KML数据文件,将用户关心的区域以“路标”点阵的方式写入KML数据文件;然后利用 Google Earth提供的游览功能,自动播放KML文件;与此同时使用智能抓图软件,同步将播放图像保存为本地数据文件,完成地图卫星影像获取。1.1 “路标”点阵写入KMa件Google Earth 允许用户在地图上感兴

2、趣的特定位置处设置标志,即"路标" (Place Mark ),它是Google Earth定义的一种空间点类型,包括路标名称、位置(经纬度、高度) 、视角、等信息。为了能够一次获取一个地区的全部图像,需要在该地区所在的空间范围内布置“路标”点阵。Google Earth提供了添加和编辑“路标”的功能,但是要获取一个地区的地图卫星影像,就必须采用直接写入KML数据文件的方式,将区域所包含的大量的“路标”点阵写入Google Earth中。Google Earth的KML数据文件是一种通用非Z勾化数据文件(XML格式),通过KML数据文件,用户可以实现与Google Eart

3、h软件的沟通与交流。KML数据文件包括文件头、数据体、文件结束三部分。附件1是一个Google Earth软件使用的KML数据文件例子。KML数据文件的具体访问方法参考DQMA用程序KML写入部分及XMLU.PA卯元。写入KML数据文件时, 通过设置Placemark数据类型,将用户关心的区域进行覆盖。下图是 Placemark数据类型的格式,重要的是将Placemark的空间位置(经度、纬度、高度)设置正确,其中经度、纬度数据单位是度,高度和视距单位是 ni- <Placemark><name>DQ47_05_125_0«/name>- <Loo

4、kAt id=" khLookAt676 "><longitude> 125</longitude><latitude> 47.0833333333333 </latitude><range> 8000</range><tilt> 0</tilt><heading> 0</heading></LookAt>- <Style id=" khStyle677 ">- <LineStyle id="

5、; khLineStyle681 "><color> ffff00ff </color></LineStyle></Style>- <LineString id=" khLineString684 "><tessellate> 1 </tessellate>coordinates /></LineString></Placemark>经度、纬度的计算方法根据视距和每屏覆盖的经差范围和纬差范围确定。保证相邻图像适度重合, 然后计算每一幅图像的中心位

6、置。1.2 自动播放KML±件将KML调入Google Earth ,在Google Earth 的Option菜单中设置控制参数。关键是要根据网速,设置图像的停顿时间,以便让 Google Earth 有充足的时间将图像数据通过网络从远端图像数据服务器 传到本地。一般宽带网设置停顿时间为10-30秒,另外,为了加快抓图速度,可以先浏览一、两次,提前将数据下载到 Google Earth在本地的Cache数据文件中,在实际抓图时,Google Earth 可以以较快的速度从Cache数据文件中获取数据,此时可以将停顿时间缩短,一般 4秒即可。1.3 智能抓图智能抓图与播放 KML文件

7、同时进行,抓图功能由DQMA歆件提供。DQMA阿以卞据Google Earth播放KML数据文件的进程,抓到最清晰的图像,并保存到设置的文件夹中。为了保证抓图与播放动作同步,DQMA歉件在写KML文件和抓图时,在安排“路标”阵列与抓图数据文件名称时,采用一对一的关系。“路标”阵列的安排如下:With DQ800CurrentSec doFor j:=0 to ACol -1 dobeginLon:=LonSt+j*DLon;For i:=0 to ARow-1 dobeginLat:=LatSt-i*DLat;XMLDoc_WritePlaceMark(F,Prefix+FormatDegSe

8、cRound(Lat)+'_'+FormatDegSecRound(Lon),Lon,Lat,DQ800CurrentSec.Scale,False);end;end;由定时器和图像自动识别单元组成的抓图图像文件列表安排如下:With DQ800CurrentSec doFor j:=0 to ACol -1 dobeginLon:=LonSt+j*DLon;For i:=0 to ARow-1 dobeginLat:=LatSt-i*DLat;fn:=GetImageFileNameRound(Path,Prefix,Lat,Lon,NameLen,CheckBox1.Che

9、cked);Inc(k);SetLength(BMPFName,k);BMPFNamek-1:=fn;end;end;2图像数据的组织与使用2.1 ImageSect数据类型它们具声明了两个实例 DQ800,DQUnits:TImageSecArr ,分别代表区域数列和当前区域的图像数列。有相同的数据类型。TImageSecArr=Array of TImageSec;TImageSec=recordLatSt,LonSt:Real;/LatEn,LonEn:Real; /DLat,DLon:Real;/NERange:RangeType; /其中ImageSect是为了描述一个区域或图像数据

10、而定义的数据类型。区域或图像的起点,左上区域或图像的终点,右下区域或图像的范围纬差,经差区域或图像的范围(MinP (左下),MaxP(右上)Rows,Cols:Integer; /图像的行数、列数Scale:Real;/视距,视野宽度Lats,Lons:TpVector; /图像行阵列的纬度、图像行阵列的经度NameLen:Integer; /2 for DD_MM,3 for DD_MM_SSSecDir, Path, Prefix, /图像的存放目录SecName:String;/区域名称SizeX,SizeY:Integer; /图像单元的像素尺寸,图像的宽度、高度像素数Width,H

11、eight:Integer; /区域图像尺寸(估计),宽度、高度像素数PixelToX,PixelToY:Real; /水平像素系数,垂直像素系数WidToHei:Real;/ImageLoaded:Boolean;垂直一水平比例(估计)MinScale,MaxScale:Real; /可见图像的比例尺范围ID:String16;/数据库中区域的ID号end;2.2 数据库DQ80吸据将DQ800,DQUnits数据存放到数据库文件中,以便访问。附录3是从数据库文件中读取的程序段。下面是写当前Section的程序段。With ASec doFor i := 0 to Rows doFor j

12、:= 0 to Cols doBeginFName:=GetImageFileNameRound(Path,Prefix,Lats.veci,Lons.vecj,NameLen,IsGrided);FieldByName('ID').asString:=UnitID;FieldByName('SectName').asString:=FName;FieldByName('SectDir').asString:=SecDir;FieldByName('MainPath').asString:=Path;UnitLatSt:=LatS

13、t-DLat*i;UnitLonSt:=LonSt+DLon*j;FieldByName('LatSt').asFloat:=UnitLatSt;FieldByName('LonSt').asFloat:=UnitLonSt;Deg2DMS(UnitLatSt,DD,MM,SS);FieldByName('LatStDD').asinteger:=DD;FieldByName('LatStMM').asinteger:=MM;FieldByName('LatStSS').asinteger:=SS;Deg2DMS(

14、UnitLonSt,DD,MM,SS);FieldByName('LonStDD').asinteger:=DD;FieldByName('LonStMM').asinteger:=MM;FieldByName('LonStSS').asinteger:=SS;UnitLatEn:=LatSt-DLat*(i+1);UnitLonEn:=LonSt+DLon*(j+1);FieldByName('LatEn').asFloat:=UnitLatEn;Deg2DMS(UnitLatEn,DD,MM,SS);FieldByName(&

15、#39;LatEnDD').asinteger:=DD;FieldByName('LatEnMM').asinteger:=MM;FieldByName('LatEnSS').asinteger:=SS;FieldByName('LonEn').asFloat:=UnitLonEn;Deg2DMS(UnitLonEn,DD,MM,SS);FieldByName('LonEnDD').asinteger:=DD;FieldByName('LonEnMM').asinteger:=MM;FieldByName(

16、'LonEnSS').asinteger:=SS;FieldByName('DLat').asFloat:=DLat;FieldByName('DLon').asFloat:=DLon;FieldByName('Rows').asFloat:=Rows;FieldByName('Cols').asFloat:=Cols;FieldByName('Scale').asFloat:=Scale;FieldByName('NameLen').asInteger:=NameLen;Field

17、ByName('Prefix').asString:=Prefix;FieldByName('SizeX').asInteger:=SizeX;FieldByName('SizeY').asInteger:=SizeY;FieldByName('Width').asInteger:=Width;FieldByName('Height').asInteger:=Height;FieldByName('PixelToX').asFloat:=PixelToX;FieldByName('Pixel

18、ToY').asFloat:=PixelToY;FieldByName('WidToHei').asFloat:=WidToHei;l:=1;For m:=i-1 to i+1doFor n:=j-1 to j+1doIf (m<>i)or(n<>j) thenBeginXUnitID:=ID+I2S0(m,3)+I2S0(n,3);XFName:=GetImageFileNameRound(Path,Prefix,Lats.vecm,Lons.vecn,NameLen,IsGrided);IfFileExists(XFname)thenBegi

19、nFieldByName('ID'+Inttostr(l).AsString:=XUnitID;End;Inc(l);End;Post;End;下面是读当前Section的程序段。LoadAUnit(ATable,ASec)With ATable,ASec,ImageSecOfs dobeginSecName:=FieldByName('SectName').asString;SecDir:=FieldByName('SectDir').asString;Path:=FieldByName('MainPath').asString

20、;LatSt:=FieldByName('LatSt').asFloat;LonSt:=FieldByName('LonSt').asFloat;LatEn:=FieldByName('LatEn').asFloat;LonEn:=FieldByName('LonEn').asFloat;DLat:=FieldByName('DLat').asFloat;DLon:=FieldByName('DLon').asFloat;NERange.MinP:=Get3DPoint(LatEn+DLat/2+M

21、inP.Y/3600)*PI/180,(LonSt-DLon/2+MinP.X/3600)*PI/180,0);NERange.MaxP:=Get3DPoint(LatSt+DLat/2+MaxP.Y/3600)*PI/180,(LonEn-DLon/2+MaxP.X/3600)*PI/180,0);NameLen:=FieldByName('NameLen').asInteger;Prefix:=FieldByName('Prefix').asString;SizeX:=FieldByName('SizeX').asInteger;SizeY:

22、=FieldByName('SizeY').asInteger;Width:=FieldByName('Width').asInteger;Height:=FieldByName('Height').asInteger;PixelToX:=FieldByName('PixelToX').asFloat;PixelToY:=FieldByName('PixelToY').asFloat;WidToHei:=FieldByName('WidToHei').asFloat;ImageLoaded:=Fal

23、se;end;读DQUnits数据Procedure LoadUnit(ATable:TAdoQuery;SecTbName,SecDir:String;IsGrided:Boolean);OverLoad;Vark:Integer;SqlStr:String;beginWith ATable dobeginTryOpen;First;k:=0;If RecordCount=0 then exit;SetLength(DQUnits,RecordCount);While Not eof dobeginLoadAUnit(ATable,DQUnitsk,IsGrided);Inc(k);Next

24、;end;exceptend;end;end;2.3 图像显示包括可缩放的图像显示和原始尺寸图像显示。图像显示重点解决图像映射、图像变形等问题。图像映射需要考虑用户坐标、屏幕坐标和图像坐标之间的对应关系,参考附件4。(1)图像缩放显示图像缩放显示的原理是同步处理图像覆盖的实际用户区域与屏幕显示区域的关系以及实际图像与 缩放后图像之间的关系。图像覆盖的实际用户区域与屏幕显示区域的关系用MapScreen实现;实际图像与缩放后图像之间的关系是通过Mapimage实现。见附件5。显示流程如下:1)使用MapScreen将图像的范围映射到屏幕上对应的区域Dest (可见部分);2)如果Dest为空,退

25、出;3)使用CopyRect,将屏幕上 Dest对应的内容复制到临时图象Temp中;4)使用Mapimage ,将Dest对应的范围映射到原始图像上对应的区域Source;5)使用CopyRect,将原始图像上区域Source对应的部分复制到 TempO;6)使用 DistortPic ,将 TempO、Temp 合成(暂存在 Temp 中);7)使用CopyRect,将Temp中的图象复制到目标Canvas上。下文是显示图像的程序段。Procedure ShowMapImage(Var BBMP:TBitMap;Image:TRasterImage);OverLoad;VarDest,Sou

26、rce:TRect;DestO,SourceO:TRect;Temp,TempO:TBitMap;VisRange:RangeType;Scale:Real;With BBMP,Canvas,Image,XYRange doBeginDest:=MapScreenP(XYRange);/Scale:=abs(Dest.Top-Dest.Bottom)/Height; /Dest:=RectAnd(Dest,Rect(O,O,Width,Height); /DestO:=RectTrim(Dest);/If (DestO.Right>O) and (DestO.Bottom>O) t

27、hen /If Scale>ImageZoomScale then/beginTemp:=TBitmap.Create;/求图象在屏幕中的显示区域显示比例尺求能见的图像显示区,交集归一化为局部区域目标区域不空时才显示,important在可见范围才显示临时图像,存放当前屏幕内容TrySetBMPSize(Temp,Dest0);/Temp.Canvas.CopyRect(Dest0,Canvas,Dest);/VisRange:=AndRange(XYRange,CurrentRelPort.RVRange); /Source:=MapImage(VisRange,XYRange,BMP

28、.Width,BMP.Height); /Source0:=RectTrim(Source);/If (Source0.Right>0) and (Source0.Bottom>0) then /beginTemp0:=TBitmap.Create;TrySetBMPSize(Temp0,Source0);/Temp0.Canvas.CopyRect(Source0,BMP.Canvas,Source); /用Dest0设置临时图像尺寸将屏幕对应区复制到临时图像 TEMP求图象在UCS中的可见区域映射UCSW见区到图像坐标系将Source归一化用设置临时图像尺寸将Source。复制

29、到Temp0中DistortPic(Temp0.Handle,Temp.Handle,Temp.Canvas.Handle,0,Transparent);/缩放后存 TempCopyRect(Dest,Temp.Canvas,Dest0);/将 Temp中的图象复制至U 目标 CanvasFinallyTemp0.Free;end;end;FinallyTemp.Free;end;end;end;(2)图像变形显示处理图像变形更复杂,需要考虑视角、球面与平面之间的映射等问题。通过设置局部用户坐标,可 以在某种程度绕过处理图像变形显示的问题。(3)阵列显示作为底图显示时,通常需要显示大量的图像阵

30、列。在显示大量的图像时,需要重点解决的问题是显 示反映的速度和减少对内存的过度需求。实际上,上述需求是相互矛盾的,为了加速显示速度,通常采用双缓存机制,这需要开辟一个内存 区,用于后台的图像调入,这必然占用大量的内存。实际上,对于图像处理的硬件要求中,内存是一个 关键数据。因此,好的解决方案在于寻求一个折衷的方案,在速度和内存上都能够达到用户的需求。(4)由定时器控制显示With CurrentMap,DM1 doBeginNE:=XY2BL(PR2.Y,PR2.X);If AutoRasterImageSec thenBeginNewSec:=SectionExists(NE);If New

31、Sec<>CurrentSec thenIf NewSec>=0 thenBeginFreeAllRasterImage;CurrentSec:=NewSec;ImageSecName:=DQ800CurrentSec.SecName;LoadImageOfs(AdoQuery1,'Sections',ImageSecName);LoadUnit(AdoQuery1,'Units',ImageSecName,ImageGridFormat);End;End;CurrImage:=ImageExists(NE);If CurrImage<0

32、 then exit;With DQUnitsCurrImage,CurrentRelPort.RVRange doBeginIf ImageLoaded then exit;If ImageGridFormat then Fn:=Path+'Grid'elseFn:=Path+''Fn:=fn+SecName;If FileExists(Fn) ThenBeginAppendRasterImage(Fn,LayerNo('底图'),NERange);ImageLoaded:=True;GMapLoaded;LocalShowScater;End

33、;End;End;end;3图像重定位正确显示图像,需要对获得的图像进行重定位。通过调整图像范围(XYRange)、核心区域尺寸(SizeX、 SizeY)或重叠区宽度(DX、DY)、图像偏移(Ofs)、图像的长宽比例( WidetoHeight)等。3.1图像偏移ImageSec的ImageSecOfs从数据库中取数据的程序体。With ImageSecOfs doBeginMinP.X:=FieldByName('OfsMinE').AsFloatMinP.Y:=FieldByName('OfsMinN').AsFloatMaxP.X:=FieldByNam

34、e('OfsMaxE').AsFloatMaxP.Y:=FieldByName('OfsMaxN').AsFloatend;With ImageSecOfs2 doBeginMinP.X:=FieldByName('OfsMinE2').AsFloatMinP.Y:=FieldByName('OfsMinN2').AsFloatMaxP.X:=FieldByName('OfsMaxE2').AsFloatMaxP.Y:=FieldByName('OfsMaxN2').AsFloatend;If Us

35、eLocalCentreLon thenWith ImageSecOfs doBeginMinP.X:=MinP.X+ImageSecOfs2.MinP.X;MaxP.X:=MaxP.X+ImageSecOfs2.MaxP.X;MinP.Y:=MinP.Y+ImageSecOfs2.MinP.Y;MaxP.Y:=MaxP.Y+ImageSecOfs2.MaxP.Y;End;With ASec,ImageSecOfs dobeginLatSt:=FieldByName('LatSt').asFloat;LonSt:=FieldByName('LonSt').asF

36、loat;LatEn:=FieldByName('LatEn').asFloat;LonEn:=FieldByName('LonEn').asFloat;DLat:=FieldByName('DLat').asFloat;DLon:=FieldByName('DLon').asFloat;With NERange doBeginMinP:=Get3DPoint(LatEn+DLat/2+MinP.Y/3600)*PI/180,(LonSt-DLon/2+MinP.X/3600)*PI/180,0);MaxP:=Get3DPoint

37、(LatSt+DLat/2+MaxP.Y/3600)*PI/180,(LonEn-DLon/2+MaxP.X/3600)*PI/180,0);End;End;附件附件1 Google Earth的KML数据文件<coordinates /></LineString></Placemark>- <Placemark><name>DQ46_57_125_00</name>-<LookAt id=" khLookAt676 "><longitude> 125</longitude

38、><latitude> 46.95 </latitude><range> 8000</range><tilt> 0</tilt><?xml version="1.0" encoding="UTF-8" ?>-<kml xmlns=" http:/earth.google.Com/kml/2.0 ">- <Document>-<LineStyle id="<color> ffff00ff</

39、LineStyle></Style>-<LineString id="-<LineStyle id="<color> ffff00ff</LineStyle></Style>-<LineString id="-<Style id=" khStyle702 ">-<IconStyle id=" khIconStyle703 ">- <Icon><href> root:/icons/palette-3.png

40、</href><x> 224</x><w>32</w><h> 32</h></Icon></IconStyle>-<LineStyle id=" khLineStyle706 "><color> ffff00ff </color></LineStyle></Style>- <Folder><name>My Places </name><open> 1 </

41、open>- <Folder><name>DQ_125_00</name><open> 1 </open>-<Placemark><name>DQ46_49_125_00</name>-<LookAt id=" khLookAt676 "><longitude> 125</longitude><latitude> 46.8166666666667 </latitude><range> 8000</

42、range><tilt> 0</tilt><heading> 0</heading></LookAt><heading> 0</heading></LookAt><Style id=" khStyle677 ">khLineStyle681 "></color>khLineString684 "><tessellate> 1 </tessellate><coordinates />&

43、lt;/LineString></Placemark>- <Placemark><name>DQ47_13_125_00</name>-<LookAt id=" khLookAt676 "><longitude> 125</longitude><latitude> 47.2166666666667 </latitude><range> 8000</range><tilt> 0</tilt><heading&g

44、t; 0</heading></LookAt><Style id=" khStyle677 ">khLineStyle681 "></color>khLineString684 "><tessellate> 1 </tessellate><Style id=" khStyle677 ">-<LineStyle id="<color> ffff00ff</LineStyle></Style>

45、-<LineString id="khLineStyle681 "></color>khLineString684 "><coordinates /></LineString></Placemark>- <Placemark><name>DQ47_21_125_00</name>-<LookAt id=" khLookAt676 "><tessellate> 1 </tessellate><longit

46、ude> 125</longitude><latitude> 47.35 </latitude><range> 8000</range><tilt> 0</tilt><heading> 0</heading></LookAt><Style id=" khStyle677 ">- <LineStyle id="<color> ffff00ff</LineStyle></Style>- &l

47、t;LineString id="khLineStyle681 "></color>khLineString684 "><Style id="<LineStyle id="<color> ffff00ff</LineStyle></Style><LineString id="<tessellate><coordinates /></LineString>khStyle677 ">khLineStyle681

48、 "></color>khLineString684 ">1 </tessellate><tessellate> 1 </tessellate></Placemark><Placemark><name>DQ47_45_125_00</name><LookAt id=" khLookAt676 "><coordinates /></LineString></Placemark>- <Placema

49、rk><name>DQ47_29_125_00</name>- <LookAt id=" khLookAt676 "><longitude> 125</longitude><latitude> 47.4833333333333 </latitude><range> 8000</range><tilt> 0</tilt><longitude> 125</longitude><latitude> 47.75

50、 </latitude><range> 8000</range><tilt> 0</tilt><heading> 0</heading></LookAt><Style id=" khStyle677 "><heading> 0</heading></LookAt>- <LineStyle id="<color> ffff00ff</LineStyle></Style>- <L

51、ineString id="khLineStyle681 "></color>khLineString684 ">- <Style id=" khStyle677 "><tessellate> 1 </tessellate>- <LineStyle id="khLineStyle681 "><color> ffff00ff</color></LineStyle></Style>- <LineStrin

52、g id="khLineString684 "><tessellate> 1 </tessellate><coordinates /><coordinates /></LineString></Placemark></Folder></Folder></Document></kml></LineString></Placemark>- <Placemark><name>DQ47_37_125_00<

53、;/name>-<LookAt id=" khLookAt676 "><longitude> 125</longitude><latitude> 47.6166666666667 </latitude><range> 8000</range><tilt> 0</tilt><heading> 0</heading></LookAt>附件2写入KML数据文件的程序体FName:=DirectPath+'MyPlaces.kml'CreateTFile(FName,F);XMLDoc_WriteBegin(F);XMLDoc_WriteMainFolderBegin(F);LoadImageSec(DQ800CurrentSec,Latst,LonSt,LatEn,LonEn,DLat,DLon);XMLDoc_WriteSubFolderBegin(F,DQ800CurrentSec.SecDir);With DQ800CurrentSec doFor j:=0 to ACol -1 dobeginLon:=LonSt+j*DLon;For i:=0 to ARow-1 dobeginLat

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1