MapInfo 地图数据格式转换陈 Esri Shp 和 Google Earth Kml 格式

有时候需要找些地图Shape文件来测试一下程序,分享一下我的步骤:

Shape文件可以由网络上搜索,比如新浪爱问(http://ishare.iask.sina.com.cn/)里面搜索"矢量地图",你可以得到上海矢量地图文件。

这个格式是MapInfo格式的,MapInfo是美国MapInfo公司的桌面地理信息系统软件,

上海矢量地图文件例子里面可以看到poi.tab, poi.id, poi.map, poi.dat

还是用上篇博客的老办法,利用 fwtools 2.4.7 里面的 ogr2ogr.exe 工具

1) 建立一个MapInfo2Shap目录,把poi.tab, poi.id, poi.map, poi.dat 放入那个目录

2)下载 fwtools ( fwtools.maptools.org) 并运行Fwtools shell

3)运行 ogr2ogr -f "ESRI Shapefile" Mapinfo2Shp\poi.shp Mapinfo2Shp\poi.tab

4)SET OGR_FORCE_ASCII=NO 设置这个环境变量的目的是可以显示中文信息
5)ogr2ogr.exe -f "KML" Mapinfo2Shp\poi.kml Mapinfo2Shp

6)Notepad 打开poi.kml 并用utf-8方式存盘转换一下

7)Google Earth可以打开poi.kml看结果了。

 

下面是别人写的英文步骤

 

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).

 

 

转载于:https://www.cnblogs.com/kuaishou/archive/2011/12/07/2279145.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值