




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
第4一但你在應(yīng)用中引入一張地圖,你可就要對(duì)其進(jìn)行一系列的操作。Map VisualBasictwips(緹)作為缺省的測(cè)量單位。你可以把窗體的單位改成點(diǎn)(pixels),ScaleMode屬性來實(shí)現(xiàn)自定義單位設(shè)置。但在我們的討其坐標(biāo)單位與窗體坐標(biāo)相同。地圖控件中的坐標(biāo)稱為"控件坐標(biāo)"(ControlCoordinate)圖層數(shù)據(jù)地圖坐標(biāo)系。遵循坐標(biāo)系原則。不同于VisualBasic窗體的控件坐標(biāo)系(左上角是0,0)地圖控件內(nèi)顯示的地圖坐標(biāo)范圍,時(shí)常在應(yīng)用期間改變。每次當(dāng)你移動(dòng)某一地圖區(qū)時(shí),Map控件內(nèi)地圖坐標(biāo)范圍就會(huì)變化。域很遠(yuǎn)以外的原點(diǎn)(origin)。應(yīng)當(dāng)記住,你的地圖控件只是地圖表面的一個(gè)小窗口。neCoordinateSystem)或麥卡脫坐標(biāo)系(UTM:UniversalTransverseMercator)以及其它坐標(biāo)系。關(guān)于坐標(biāo)系更細(xì)致的討論超出本書的范圍。但是值得注意的一點(diǎn)是應(yīng)用MapObjects時(shí)要確用一些其它軟件,如"ArcView"或"ArcGIS"來的地圖資料轉(zhuǎn)換成合適的坐標(biāo)系。該過程稱為"MapProjection"(投影變換”)。):OptionPrivateSubLabel3.Caption="Map1.Width="&Map1.WidthLabel4.Caption="Map1.Height="&Map1.HeightEndSubDimpt1AsNewMapObjects2.PointSetpt1=Map1.ToMapPoint(X,Y)lbX.Caption="經(jīng)度="&Format(pt1.X,"##.00")lbY.Caption="緯度="&Format(pt1.Y,"##.00")Label5.CaptionX&XLabel6.CaptionY&YEndSub,Dimpt1AsMapObjects2.PointSetrect=Map1.TrackRectangleSetpt1=rect.CenterMap1.FromMapPointpt1,x1,y1):):DimmoPt1AsMapObjects2.PointDimmoline1AsMapObjects2.LineIfNotrectIsNothingDimsymAsNewMapObjects2.Symbolsym.Style=moTransparentFillsym.OutlineColor=moBlueMap1.DrawShaperect,symsym.Style=moCircleMarker'moPointSymbol'moCircleMarkersym.Color=moRedMap1.DrawShapemoPt1,symEndIfIfNotmoline1IsNothingThensym.Style=moDashLine'Symbolsym.Color=moRedMap1.DrawShapemoline1,symEndIfEndSetmoline1=Map1.TrackLineMap1.TrackingLayer.RefreshTrueStatusBar1.Panels(3).Text="控件距離為;"+_ElseIfToolbar1.Buttons(2).Value=tbrPressedThenSetMap1.Extent=Map1.TrackRectangleElseIfToolbar1.Buttons(3).Value=tbrPressedThenSetrect=Map1.TrackRectangleSetmoPt1=rect.CenterEndEndDimmoPt2AsNewMapObjects2.PointStatusBar1.Panels(1).Text="地圖;X="+Format(moPt2.X,"#.00")+" Y="+_Format(moPt2.Y,"#.00")'CStr(moPt2.Y)StatusBar1.Panels(4).Text控件;XFormat(X#.00YFormat(Y,End IfButton.Key="btnFull"SetMap1.Extent=Map1.FullExtentEndIfEnd
地球除了繞公轉(zhuǎn)外,還繞著自己的軸線旋通過地軸垂直于赤道面的平面叫做經(jīng)面或子午(Mrdan(圖P點(diǎn)的法線。法線與赤道面的交P點(diǎn)的地理緯度(簡(jiǎn)稱緯度)稱經(jīng)度),通常用字母λ表示。國(guó)際規(guī)定通過英國(guó)天文臺(tái)的子午線為本初子午線(或叫首子午線)00-1800-180度叫門都要利用來推斷地理規(guī)律。地圖投影是將球面坐標(biāo)轉(zhuǎn)換成平面坐標(biāo)的數(shù)學(xué)方法??捎貌煌臄?shù)學(xué)將地球球體表面投已知的地理坐標(biāo)系來顯示坐標(biāo)數(shù)據(jù)。例如,1:1萬(wàn)、1:2.5萬(wàn)、1:5萬(wàn)、1:101:25萬(wàn)、1:50萬(wàn)比例尺地形圖,均采用在克拉基橢球體上的-投影。變形,不同的投影產(chǎn)生不同的變形,每一種投影都有其各自的適用方面。例如,投影適用GISGISGIS系統(tǒng)的坐標(biāo)系非常重要。GIS中的坐數(shù)確定,因此欲正確定義GIS系統(tǒng)坐標(biāo)系,首先必須弄清地球橢球體(Spheroids)、大地基準(zhǔn)面Flattening:DoublefabAxisDouble是否是面,我們通常稱謂的54坐標(biāo)系、西安80坐標(biāo)系實(shí)際上指的是我國(guó)的兩個(gè)大地基準(zhǔn)面。我國(guó)WGS1984WGS84GPSWGS1984 BeijingWGS球體不能代表基準(zhǔn)面,同樣的橢球體能定義不同的基準(zhǔn)面,如前的Pulkovo1942、非洲索馬里的Afgooye基準(zhǔn)面都采用了Krassovsky橢球體,但它們的基準(zhǔn)面顯然是不同的。影坐標(biāo)。如果有人說:該點(diǎn)54坐標(biāo)值為X= ,實(shí)際上指的是54基準(zhǔn)面下的投影坐標(biāo),也就是54基準(zhǔn)面下的坐標(biāo)在直角平面坐標(biāo)上的投影結(jié)果。
NameTransverseMercator=我國(guó)的GIS應(yīng)用工程所采用的投影一般與我國(guó)基本地形圖系列一致的地圖投影系統(tǒng),這就是大中比例尺(1:50萬(wàn)以上)的--投影(橫軸等角切橢圓柱投影)和小比例尺(1:100萬(wàn)以下)1:5000;Lambert投影中,地球表面上兩點(diǎn)間的最短距離(即大圓航線)表現(xiàn)為近于直線,這有利于地因此,我國(guó)的地理信息系統(tǒng)中配置投影和Lambert投影既適合我國(guó)的國(guó)情,也符合國(guó)際但要注意的是,地理信息系統(tǒng)中配置投影和Lambert投影,不是意味著系統(tǒng)僅處理這兩提供相應(yīng)的投影轉(zhuǎn)換模塊,例如,GEOSTAR提供了上百種投影方法?!队笆?1:1萬(wàn)、1:2.5萬(wàn)、1:5萬(wàn)、1:10萬(wàn)、1:25萬(wàn)、1:50萬(wàn)比例尺地形圖,均采經(jīng)差3度分帶在城市GIS系統(tǒng)中均采用6度或3度分帶的- 度或3度分帶的-投影坐標(biāo)。-投影以6度或3度分帶,每一個(gè)分帶構(gòu)成一個(gè)獨(dú)立的平面直角坐標(biāo)網(wǎng),投影帶經(jīng)線投影后的直線為X軸(縱軸,緯度方向),赤道投影后為Y軸(橫軸,經(jīng)度方向),為了防止經(jīng)度方向的坐標(biāo)出現(xiàn)負(fù)值,規(guī)定每帶的經(jīng)線西移500公 21即為帶號(hào),同樣所定義的東偽偏移值也需要加上帶號(hào),如21帶的東偽偏移值為米。其經(jīng)線為9E,其余類推COMVisualC++6.0中,usestheATLApplicationWizard.ChooseNewfromthe ,andselecttheProjectsEnteraprojectnameandpressInstep1ofthewizard,selectDynamicLinkLibraryradiobutton(donotselectanyoftheothercheckboxes),andpressFinish.In"NewProjectInformation"andpressFromthe selectNewATLObject,andselect"Objects"inlistofSelect"SimpleObject"inlistofObjects,andpress在ATL對(duì)象向?qū)傩钥蛑蠸electtheNamestabandenterthenameofyourprojectionclassinShortPressExpandthelistofclassesinyourproject,andyouwillseeaclassnamestartingwitha"C",likeRight-clickonthisclass,andchooseImplementPressOkinthewarningBrowsefortheTypePressBrowse,andfind"AFCust20.tlb",andthenselectPressImplementtheYouwillseealistoftheinterfacessupportedbyChecktheboxnexttoICustomProjection,andpressDouble-clickontheCMyProjectionclass,thiswillopenthefileMyProjection.hinaInMyProjection.h,locatetheimplementationsofGeogToProjandProjToGeog.Thesewilllooklikethis:STDMETHOD(GeogToProj)(DOUBLEaxis,DOUBLEflattening,DOUBLE*parms,LONGnumPoints,DOUBLE*points){if(points==NULL) returnE_NOTIMPL;}STDMETHOD(ProjToGeog)(DOUBLEaxis,DOUBLEflattening,DOUBLE*parms,LONGnumPoints,DOUBLE*points){if(points==NULL)returnE_POINTER;returnE_NOTIMPL;}Addyourcodetoimplementyourcustomprojection.BoththeGeogToProjandProjToGeogfunctionstakethesameparameters;whichincludeapointertoanarraycalledarms?Thisarrayholdsthevariousprojectionparametersthatcanbeset,asneeded,dependingontheprojectionthatistobeimplemented.Forexample,ifaprojectionrequirestwostandardparallelsthentheappropriatevaluesforthesetwoparallelswillalwaysbestoredinthe3rdand4thelementsoftheparmsarray.ThisisachievedbyMapObjectsusingParameterTypeConstants.Foryourcustomprojection,youshouldusethesameindexingmechanismtoretrievetherequired Seebelowforalistof parametertypenamesandappropriateindexvalues:#definePARM_X0 0//Falseeasting#define 1//False#definePARM_LAM0 2//Centralmeridian,Longitudeoforigin#definePARM_PHI1 3//Standardparallel1,Latitudeof1stpoint#definePARM_PHI2 4//Standardparallel2,Latitudeof2ndpoint#definePARM_K0 5//Scalefactor#definePARM_PHI0 6//Centralparallel,Latitudeoforigin#definePARM_ALPHA7//Azimuth#definePARM_LAM1 8//Longitudeof1stpoint#define 9//Longitudeof2ndThefollowingexampleimplementstheEquidistantCylindricalprojection.The1stStandardParallelisusedastheonlyparameter://Usefulmacrosandtheonlyparametertype#defineRAD2DEG(r)((r)*57. )//DegreestoRadians#defineDEG2RAD(d)((d)/57. )//RadianstoDegrees#definePARM_PHI1 3//Standardparallel1,Latitudeof1stpointSTDMETHOD(GeogToProj)(DOUBLEaxis,DOUBLEflattening,DOUBLE*parms,LONGnumPoints,DOUBLE*points){if(points==NULL)returndoublecosphi0=cos(DEG2RAD(parms[PARM_PHI1]));for(inti=0;i<numPoints;i++){points[i*2]=DEG2RAD(points[i*2])*axis*cosphi0;points[i*2+1]=DEG2RAD(points[i*2+1])*axis;}return}STDMETHOD(ProjToGeog)(DOUBLEaxis,DOUBLEflattening,DOUBLE*parms,LONGnumPoints,DOUBLE*points){if(points== returndoublecosphi0=cos(DEG2RAD(parms[PARM_PHI1]));for(inti=0;i<numPoints;i++){points[i*2]=RAD2DEG(points[i*2]/(axis*cosphi0));points[i*2+1]=RAD2DEG(points[i*2+1]/axis);}return}BuildyourcustomprojectionFromthe ,chooseSetActiveFromtheBuild ,chooseRebuildAlltobuildyourDLLYoucannowuseyournewCOMobjectwithinyour然后瀏覽并找到你自定義的投影對(duì)象(COMDLL).DimmeterAsNewMapObjects2.Unitmeter.Type=moUnit_Meter‘thesourcegeographiccoordsysforthemaplayerDimgcs84AsNewMapObjects2.GeoCoordSysgcs84.Type=moGeoCS_WGS1984‘CreateaMOprojectionobjectandsetittoaninstanceofmycustomprojectionDimMyProjAsNewCUSTOMPROJLib.MyProjectionDimCustProjAsNewMapObjects2.ProjectionSetCustProj.Custom=MyProj theProjectedcoordsysthatwillusethecustomprojectionDimCustPCSAsNewMapObjects2.ProjCoordSysSetCustPCS.Projection=CustProjSetCustPCS.GeoCoordSys=gcs84SetCustPCS.Unit=meter theoneandonlyparameter‘CreatethelayerandthemapscoordinatesystemsSetMap1.Layers(0).CoordinateSystem=gcs84SetMap1.CoordinateSystem=CustPCS初子午線,在MO中是由相應(yīng)的屬性PrimeMeridian來定義。坐標(biāo)系的單位由屬性Unit指定。
PrimeMeridian:Export.prj文件Object::Point,Line,Polygon,RectanglePoints將一個(gè)幾何對(duì)象(Point,Line,Polygon,RectanglePoints)從一個(gè)坐標(biāo)系轉(zhuǎn)換到另一個(gè)地理坐標(biāo)系或投影坐標(biāo)系,轉(zhuǎn)換的方法由參數(shù).GeoStransfomation指定,如果兩個(gè)坐標(biāo)系所依據(jù)的基準(zhǔn)面不同的話需要指定geoTrans參數(shù)BeijingWGSCreatenewGeoCoordSys,Unit,PrimeMeridian,DatumandSpheroidSetthepropertiesoftheSpheroidobject.UsetheTypepropertytospecifyapre-definedspheroid,orsettheAxisandFlatteningpropertiesandgivetheSpheroidauser-definedname.SettheSpheroidpropertyoftheDatumobjectequaltotheSpheroidobjectdefinedinstepSetthepropertiesofthePrimeMeridianobject,eitherbyspecifyingapre-definedTypeorbysettingtheLongitudeproperty.SetthepropertiesoftheUnitobject,eitherbyusinga pre-definedTypeorbysettingtheFactorproperty.SettheGeoCoordSysobject'sPrimeMeridian,UnitandDatumpropertieswiththenewobjectsfromsteps3,4and5.Projection指定。屬性Unit定義了投影坐標(biāo)系的單位。預(yù)先定義了一千多個(gè)投影坐標(biāo)系常數(shù)。此外,也可以將投影坐標(biāo)系對(duì)象的屬性GeoCoordSys,Projection及Unit設(shè)置為特定的對(duì)象來創(chuàng)建用戶自定義的投影坐標(biāo)系。具體的方法請(qǐng)參考MOCoordinateSystem進(jìn)行應(yīng)用,這個(gè)屬性定義了矢量數(shù)據(jù)進(jìn)行顯示所依據(jù)的坐標(biāo)系統(tǒng)。使用對(duì)象的方法Transform,一個(gè)單獨(dú)的幾何圖形也可以投影到其它的投影坐標(biāo)系或地理坐標(biāo)系下。使用方法Export可以將坐標(biāo)系的元數(shù)據(jù)在磁盤上以便于使用。
GeoGoordsys:Export.prj將給定的幾何圖形fromShape投影到指定的坐標(biāo)系下。返回的結(jié)果是幾何對(duì)象:Point,Line,Polygon,RectanglePointsBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneBeijing1954GKZoneCreatenewGeoCoordSys,UnitandProjectionSetthepropertiesoftheGeoCoordSysobjectbyspecifyingapre-definedType,orsettingthepropertiesasdescribedabove.SetthepropertiesoftheUnitobject,eitherbyusinga pre-definedTypeorbysettingtheFactorproperty.SetthepropertiesoftheProjectionobject,eitherbyusinga pre-definedTypeorbycreatingacustomprojectionandsettingtheCustomproperty.SettheProjCoordSysobject'sGeoCoordSys,ProjectionandUnitpropertieswiththenewobjectsfromsteps2,3and4.
DimstrPcsasNewMapObjects2.StringsDima1asString
PopulateWith…False(Default)ThePopulateWith...方法將返回有限數(shù)目的常數(shù),MO早TrueThePopulateWith...Add(str:String):Find(str:String,sPos:integer):Integer/
idx PrivateSubDimmoStrAsNewMapObjects2.StringsDimiAsIntegermoStr.PopulateUsingNewConstants=TrueLabel1.Caption橢球體CStr(moStr.Count2)Fori=0TomoStr.Count2-1NextFori=0TomoStr.Count2-1NextFori=0TomoStr.Count2-1NextFori=0TomoStr.Count2-1NextFori=0TomoStr.Count2-1NextFori=0TomoStr.Count2-1NextCombo1.Text="地圖單位"Fori0TomoStr.Count21NextCombo2.Text="經(jīng)線"Fori=0TomoStr.Count2-1NextIfmoStr.PopulateUsingNewConstantsThenCombo3.Text="投影變換方法"Fori=0TomoStr.Count2-1'EndIfCombo4.Text="投影參數(shù)(GaussKruger)"Fori=0TomoStr.Count2-1NextEndDimnewLayerAsNewMapObjects2.MayerDimcoordSysAsNewMapObjects2.ProjCoordSysDimcsDDAsNewMapObjects2.GeoCoordSysPrivateSubCommand1.Caption="導(dǎo)出"CommonDialog1.InitDir=App.PathCommonDialog1.DialogTitle="ExportProjectedShapefile"CommonDialog1.Filter="Shapefiles(.shp)|*.shp"DimprojCoordAsNewMapObjects2.StringsDimstrCSAsVariantForEachstrCSInprojCoordCombo1.AddItem"ProjCoordSys:"&strCSNextstrCSCombo1.ListIndex=0DimdcAsNewMapObjects2.DonnectionDimmlyrDDAsNewMapObjects2.Mayerdc.Database=App.PathSetmlyrDD.GeoDataset=dc.FindGeoDataset(" Map1.Layers.AddmlyrDDWith.Style=.Color=moDarkGreenEndWithEndPrivateSubIfCommonDialog1.FileName=""ThenExitDimnameAsname=Combo1.List(Combo1.ListIndex)IfnewLayer.ValidThenWithnewLayer.Symbol.Style=EndWithMsgBox新圖層無效vbExclamation錯(cuò)誤信息"EndIfEndPrivateSubcsDD.Type=moGeoCS_Beijing1954EndPrivateFunctionstripProjection(theProjectionAsString)AsLong'StriptheprojectionobjecttypenumberfromtheselectedstringDimopenBAsIntegerDimcodelenAscodelen=Len(theProjection)-openB-'stripProjection=CDbl(Left(Right(theProjection,Len(theProjection)-openB),Len(theProjection)-openB-1))'Right(theProjection,codelen+1)="12345]"Left("12345]",codelen)=12345End面的改變時(shí),需要使用GeoTransformation對(duì)象來實(shí)現(xiàn)地理變換或基準(zhǔn)面平移。Direction:Method:
通過設(shè)置屬性Type為一個(gè)指定的地理變換常數(shù),你可以使用很多預(yù)定義的地理變換類型.MapObjects實(shí)現(xiàn)了符合工業(yè)化標(biāo)準(zhǔn)的地理變換方法. 可以通過將屬性Type設(shè)置為一個(gè)合適的地理變換常數(shù)來定義之些方法。MO包括了千多個(gè)預(yù)定義的地理變換常數(shù),這些預(yù)定義WGS1984Direction屬WGS1984基準(zhǔn)面.SecondTypeSecondDirection來創(chuàng)建一個(gè)“兩步驟的變換”,從而完成在兩另外,通過設(shè)置GeoTransformation的屬性ToGeoCoordSys,FromGeoCoordSysMethod自FromGeoCoordSysToGeoCoordSys指定要進(jìn)行變換的源地理坐標(biāo)系和目標(biāo)坐標(biāo)系.用一個(gè)MethodConstant常數(shù)給屬性Method賦值來使用哪一種數(shù)據(jù)方法實(shí)現(xiàn)地理坐標(biāo)變換.每一個(gè)坐標(biāo)變換方法的參數(shù)可以對(duì)過使用方法SetParameter指定,可以使用方法GetParameter這些參數(shù).GetParameterMethod,NameToGeoCoordSysFromGeoCoordSys方法及屬性將返回值與對(duì)象,這些值和對(duì)象同樣可以通過屬性Type來設(shè)置.namedirection以外,不能提取關(guān)于自定義“兩步驟變換”的第二步的它信息兩“二步驟.變換”只能在預(yù)定義的GeoTrnasformation對(duì)象間進(jìn)行GeoTransformation對(duì)象GeoCoordSys(GeoTransformationFromGeoCoordSysToGeoCoordSys屬性GeoTransformationToGeoCoordSysFromGeoCoordSys屬性為上一步所定義的GeoCoordSys對(duì)象.GeoTransformationMethodMethodConstants.無無 moParm_RotationZ,moParm_DeltaScale moParm_RotationZ,moParm_DeltaScale 如果需要,GeoTransformationDirection,*4.4幾何圖形對(duì)象投影轉(zhuǎn)換(基于不同的基準(zhǔn)面GIS系統(tǒng)中的基準(zhǔn)面通過當(dāng)?shù)鼗鶞?zhǔn)面向WGS1984的轉(zhuǎn)換7參數(shù)來定義,轉(zhuǎn)換通過相似變換方法實(shí)現(xiàn),具體算法可參考科學(xué)1999年的《城市地理信息系統(tǒng)標(biāo)準(zhǔn)化指南》7686Xg、Yg、ZgWGS84Xt、Yt、Zt坐標(biāo)系的三坐標(biāo)軸,那么自定義基準(zhǔn)面的7參數(shù)分別為:三個(gè)平移參數(shù)ΔX、ΔY、ΔZ表示兩坐標(biāo)原點(diǎn)的平移值;三個(gè)旋轉(zhuǎn)參數(shù)εx、εy、εz表示當(dāng)?shù)刈鴺?biāo)系旋轉(zhuǎn)至與地心坐標(biāo)系平行時(shí),分別繞Xt、Yt、Zt的旋轉(zhuǎn)角;最后是比例校正因子,用于調(diào)整橢球大小。DimfromPtAsNewMapObjects2.PointDimtoPtAsNewMapObjects2.PointDimcurMapAsIntegerDimsymAsNewDimgcsAsNewMapObjects2.GeoCoordSysDimpcsAsNewPrivateSub'Map1shouldcontainaMayerbasedontheWGS1984Datum,forexampletheWorldCountriessampledataset.Dimdc1AsNewMapObjects2.D Dimmlyr1AsNewMapObjects2.MayerDimmlyr2AsNewMapObjects2.MayerMap1.Layers.Addmlyr1'Map2shouldcontainaMayerbasedonadifferent'YoushouldensuretheCoordinateSystemofbothlayersissetcorrectly.pcs.Type=moProjCS_Beijing1954GK_17NMap2.Layers(0).CoordinateSystem=pcsgcs.Type=moGeoCS_WGS1984Map1.Layers(0).CoordinateSystem=gcs'HeretheCoordinateSystemofeachmapissettotheCoordinateSystemofitsMaWithsym.Size=.Outline=EndWithEndPrivateFunctiontransformPoint(directionAsMapObjects2.DirectionConstants,ptInAsMapObjects2.Point)AsPoint'Here,anappropriateGeoTransformationiscreatedfortransformingthe'Point.ThisshouldbechangedappropriayfortheCoordinateSystemofyourMap2MaDimmyGTAsNewDimgcsBJ54AsNewMapObjects2.GeoCoordSysDimgcsWGS84AsNewMapObjects2.GeoCoordSysgcsBJ54.Type=moGeoCS_Beijing1954gcsWGS84.Type=moGeoCS_WGS1984SetmyGT.ToGeoCoordSys=gcsWGS84myGT.direction=moDirection_ForwardmyGT.Name="BJ54_To_WGS1984"'Settheappropriatedirection,FromGeoCoordSysand'ACoordinateSystemmaybeeitherProjCoordSysor'WeneedtocheckifthetypebeforeassigningtheFromGeoCoordSysandmap1Projected=Truemap1Projected=FalseEndIfmap2Projected=Truemap2Projected=FalseEndIf'IfchangingfromBj54toWGS1984Ifdirection=moDirection_ForwardThenIfmap2ProjectedThenmyGT.FromGeoCoordSys=Map2.CoordinateSystem.GeoCoordSysEndIfIfmap1ProjectedEndIfSettransformPoint=_Map1.CoordinateSystem.Transform(Map2.CoordinateSystem,fromPt,,myGT)ElseIfdirection=moDirection_ReverseThenIfmap2ProjectedThenEndIfIfmap1ProjectedmyGT.FromGeoCoordSys=Map1.CoordinateSystem.GeoCoordSysEndIfSettransformPoint=_Map2.CoordinateSystem.Transform(Map1.CoordinateSystem,fromPt,,myGT)EndIfEndSettoPt=transformPoint(moDirection_Reverse,fromPt)curMap=1EndSettoPt=transformPoint(moDirection_Forward,fromPt)curMap=2EndIf(NotfromPtIsNothing)AndcurMap=1Thensym.Color=moBlueEndIf(NottoPtIsNothing)AndcurMap=2Thensym.Color=moRedEndIfEndIf(NotfromPtIsNothing)AndcurMap=2Thensym.Color=moBlueEndIfIf(NottoPtIsNothing)AndcurMap=1Thensym.Color=moRedEndIfEndPrivatedcAsNewMapObjects2.DonnectionPrivatemlyrDDAsNewMapObjects2.MayerPrivatemlyrBJ54AsNewMapObjects2.MayerPrivategcsDDAsNewMapObjects2.GeoCoordSysPrivatepcsBJ54AsNewMapObjects2.ProjCoordSysPrivateshpDDAsObjectPrivateshpBJ54As'sym(22toDimiOpenBracketIndexAsIntegerDimiCodeWidthAsIntegeriOpenBracketIndex=InStr(strCoordSys,"[")+1iCodeWidth=InStr(strCoordSys,"]")-iOpenBracketIndexlCoordSysCode=CLng(Mid(strCoordSys,iOpenBracketIndex,iCodeWidth))ReturnCoordSysCode=lCoordSysCodeEndDimgcsAsNewMapObjects2.GeoCoordSysDimstrDescAsStringIfcode<4001ReturnGCSdescription="MapObjectscannotresolvethecontentsofthePRJ.ADF"&"withavalidCoordinateSystemconstant. "&codeEndIfgcs.Type=codeForm1.MousePointer=vbHourglassstrDesc地理坐標(biāo)系名稱&vbCrLf&strDesc=strDesc&vbCrLf&"地理坐標(biāo)系Code: strDesc=strDesc&vbCrLf&""strDesc=strDesc&vbCrLf&"基準(zhǔn)面 "&strDesc=strDesc&vbCrLf&"參考橢球: "&gcs.Datum.Spheroid.NamestrDesc=strDesc&vbCrLf&"橢球長(zhǎng)半軸:"&gcs.Datum.Spheroid.AxisstrDesc=strDesc&vbCrLf&"1/橢球扁率1/f: "&1/gcs.Datum.Spheroid.FlatteningstrDesc=strDesc&vbCrLf&"子午經(jīng)線名稱: "&gcs.PrimeMeridian.NamestrDesc=strDesc&vbCrLf&"子午線經(jīng)度:"&gcs.PrimeMeridian.LongitudestrDesc=strDesc&vbCrLf&"地圖單位: "&gcs.Unit.NamestrDescstrDesc&vbCrLf&1Unit=?米:&gcs.Unit.factorForm1.MousePointer=vbDefaultEndPrivateFunction DimpcsAsNewMapObjects2.ProjCoordSysDimstrDescAsStringIfcode<2100 Sdescription="MapObjectscannotresolvethecontentsofthePRJ.ADF"&_"withavalidCoordinateSystem "&EndIfpcs.Type=codeForm1.MousePointer=vbHourglass "&strDesc=strDesc&vbCrLf&"投影坐標(biāo)系Code: strDesc=strDesc&vbCrLf&""strDesc=strDesc&vbCrLf&"地理坐標(biāo)系名稱:"&pcs.GeoCoordSys.NamestrDesc=strDesc&vbCrLf&"Code:"&pcs.GeoCoordSys.TypestrDesc=strDesc&vbCrLf&""strDesc=strDesc&vbCrLf&"地圖投影: "&pcs.Projection.NamestrDesc=strDesc&vbCrLf&"投影CODE:"&pcs.Projection.TypestrDesc=strDesc&vbCrLf&"地圖單位: "&pcs.Unit.NamestrDescstrDesc&vbCrLf&1Unit=?米:&pcs.Unit.factorstrDesc=strDesc&vbCrLf&""strDesc=strDesc&vbCrLf&"東偏: "&pcs.GetParameter(moParm_FalseEasting)strDesc=strDesc&vbCrLf&"北偏: strDesc=strDesc&vbCrLf&"經(jīng)線: "&strDesc=strDesc&vbCrLf&"STANDARDPARALLEL1:"&strDesc=strDesc&vbCrLf&"STANDARDPARALLEL2:"&strDesc=strDesc&vbCrLf&"SCALEFACTOR:"&strDesc=strDesc&vbCrLf&"CENTRALPARALLEL:"&strDesc=strDesc&vbCrLf&"原點(diǎn)經(jīng)度: "&strDesc=strDesc&vbCrLf&"原點(diǎn)緯席: "&strDesc=strDesc&vbCrLf&"AZIMUTH: strDesc=strDesc&vbCrLf&"LATITUDEOFFIRSTPOINT:"&strDesc=strDesc&vbCrLf&"LATITUDEOFSECONDPOINT:"&strDesc=strDesc&vbCrLf&"LONGITUDEOFFIRSTPOINT:"&strDesc=strDesc&vbCrLf&"LONGITUDEOFSECONDPOINT:"Form1.MousePointer=vbDefault EndPrivateSub'ProjecttheMap1unprojectedshape,anddraw'ontotheMap2projectedmap.IfNotshpDDIsNothingLabel5.Caption=shpDD.Parts(0).CountEndIfEndPrivateSubOptCS(0).Value=TrueSetmlyrBJ54.GeoDataset=dc.FindGeoDataset("bou2_4p")mlyrBJ54.Symbol.Color=moLightGraymlyrDD.Symbol.Color=moLightGrayEndPrivateSubDimlCoordSysCodeAsLongIfCombo1.ListIndex=-1ThenExitSubEndlCoordSysCode=End
IfOptCS(0).Value=TrueThenSetMap1.CoordinateSystem=gcsDDElseIfOptCS(1).Value=TrueThenSetMap2.CoordinateSystem=pcsBJ54EndIfPrivateSubDimfso1AsNewDimlyr3AsNewMapObjects2.MayerpcsBJ54.ExportApp.Path&"\bou2_4p_prj.prj"DimrecsAsMapObjects2.RecordsetSetrecs='Exporttheshapefileouttoanewshapefile,'projectingitontheway.Dimg
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 中醫(yī)慢病培訓(xùn)試題及答案
- 工業(yè)互聯(lián)網(wǎng)平臺(tái)與AR交互技術(shù)在工業(yè)機(jī)器人編程與調(diào)試中的應(yīng)用報(bào)告
- 中醫(yī)三基試題庫(kù)及答案
- 中醫(yī)試題及答案解析
- 康復(fù)醫(yī)療服務(wù)體系與康復(fù)輔助器具結(jié)合的運(yùn)營(yíng)模式研究報(bào)告
- 2025年事業(yè)單位工勤技能-安徽-安徽林木種苗工三級(jí)(高級(jí)工)歷年參考題庫(kù)含答案解析
- 2025年事業(yè)單位工勤技能-安徽-安徽動(dòng)物檢疫員四級(jí)(中級(jí)工)歷年參考題庫(kù)含答案解析
- D-Lactose-monohydrate-13C12-生命科學(xué)試劑-MCE
- 海星科技求職者面試實(shí)戰(zhàn)模擬題及答案解析
- 求職指南:汽車制造廠面試題與答案
- 三甲醫(yī)院醫(yī)療退費(fèi)管理制度
- 數(shù)學(xué)人教A版(2019)選擇性必修第一冊(cè)2.5.1 直線與圓的位置關(guān)系 教案
- 精選芭蕾舞男女演員之間的潛規(guī)則匯總
- 慢阻肺隨訪記錄表格模板
- J-STD-020D[1].1中文版
- SF∕T 0124-2021 錄像過程分析技術(shù)規(guī)范
- 四講業(yè)主業(yè)主大會(huì)業(yè)主委員會(huì)PPT課件
- 永磁渦流傳動(dòng)器的應(yīng)用示范及產(chǎn)業(yè)化20150706
- EPC項(xiàng)目—承包人建議書、承包人實(shí)施計(jì)劃
- 被執(zhí)行人財(cái)產(chǎn)申報(bào)表
- 赫章縣地質(zhì)災(zāi)害防治規(guī)劃
評(píng)論
0/150
提交評(píng)論