MapInfo 地圖數(shù)據(jù)格式轉(zhuǎn)換陳 Esri Shp 和 Google Earth Kml 格式
有時(shí)候需要找些地圖Shape文件來測試一下程序,分享一下我的步驟:
Shape文件可以由網(wǎng)絡(luò)上搜索,比如新浪愛問(http://ishare.iask.sina.com.cn/)里面搜索"矢量地圖",你可以得到上海矢量地圖文件。
這個(gè)格式是MapInfo格式的,MapInfo是美國MapInfo公司的桌面地理信息系統(tǒng)軟件,
上海矢量地圖文件例子里面可以看到poi.tab, poi.id, poi.map, poi.dat
還是用上篇博客的老辦法,利用 fwtools 2.4.7 里面的 ogr2ogr.exe 工具
1) 建立一個(gè)MapInfo2Shap目錄,把poi.tab, poi.id, poi.map, poi.dat 放入那個(gè)目錄
2)下載 fwtools ( fwtools.maptools.org) 并運(yùn)行Fwtools shell
3)運(yùn)行 ogr2ogr -f "ESRI Shapefile" Mapinfo2Shp\poi.shp Mapinfo2Shp\poi.tab
4)SET OGR_FORCE_ASCII=NO 設(shè)置這個(gè)環(huán)境變量的目的是可以顯示中文信息
5)ogr2ogr.exe -f "KML" Mapinfo2Shp\poi.kml Mapinfo2Shp
6)Notepad 打開poi.kml 并用utf-8方式存盤轉(zhuǎn)換一下
7)Google Earth可以打開poi.kml看結(jié)果了。

下面是別人寫的英文步驟
For a while now I've been searching for a way to convert MapInfo files to ESRI shape format so that I can use them in MapWindow GIS and today I came across an open source GIS/RS binary kit called FWTools (created by Frank Warmerdam) which you can find at [fwtools.maptools.org]
After installing FWTools you should have a new FWTools menu group in Start->All Programs list. From there you can launch a command shell with the environment all setup to run the various commands for GDAL, OGR, PROJ, MapServer, etc.
I've attached a zip file that contains a set of MapInfo files that represents the boundary of Lincolnshire in the UK (where I live) so that those of you who want to try the example below can do so.
In the C:\Program Files\FWTools directory create a new folder named 'Mapinfo2Shp' and unzip the attached file there; you should find four files with extensions .DAT, .ID, .MAP and .TAB
Now double-click the FWTools shortcut on your desktop. This opens a command window. Copy and paste the following command into the window and press the enter key to run it.
ogr2ogr -f "ESRI Shapefile" Mapinfo2Shp\LincsBoundary.shp Mapinfo2Shp\Lincolnshire.tab
NOTE: In the command above the first file is the file format and filename you want to convert to, while the second is the one you're converting from.
You should now see the ESRI shape fileset appear in the folder so run MapWindow and load the LincsBoundary.shp file.
Also, if you want to change the projection at the same time then this is the command:
ogr2ogr -f "ESRI Shapefile" -t_srs "EPSG: 4269" Mapinfo2Shp\LincsBoundary.shp Mapinfo2Shp\Lincolnshire.tab (although I've not tried this).
posted on 2011-12-07 13:30 時(shí)空地圖-TimeGIS-com 閱讀(1253) 評論(0) 收藏 舉報(bào)
浙公網(wǎng)安備 33010602011771號