批量转换mif为shp [英] batch convert mif to shp

查看:126
本文介绍了批量转换mif为shp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



您知道将具有多个* .mif文件的目录转换为shapefile的任何有效方法吗?请注意我的文件是*。 mif格式不是mapinfo标签之一。将所有转换为mapinfo选项卡然后转换为shapefile的解决方案也是可以接受的。

提前感谢



Eh237

Dear all,

Do you know any effective way to convert a directory with several *.mif files to shapefiles? Please note that my files are in *. mif format not mapinfo tab one. A solution to convert all to mapinfo tab then to shapefile is also acceptable.
thanks in advance

Eh237

推荐答案

您可能希望参考这个帖子,其中某人已经这样做了:http://social.msdn.microsoft.com/Forums/en-US/sqlspatial/thread/0cc4b50e-7dcd-4bbf-982f-3e9346b3dcab [<一个href =http://social.msdn.microsoft.com/Forums/en-US/sqlspatial/thread/0cc4b50e-7dcd-4bbf-982f-3e9346b3dcabtarget =_ blanktitle =New Window> ^ ]
You may wish to refer to this thread where someone has done this: http://social.msdn.microsoft.com/Forums/en-US/sqlspatial/thread/0cc4b50e-7dcd-4bbf-982f-3e9346b3dcab[^]


仅限转换:

For convert only:
for %%i in (.\mid\*.mif) do (
for %%n in (POINT LINESTRING POLYGON MULTIPOLYGON MULTIPOINT MULTILINESTRING) do (
"ogr2ogr" -skipfailures .\shp\%%~ni_%%n.shp %%i -nlt "%%n" -where "OGR_GEOMETRY='%%n'"
)
)



用几何体将几何体添加到一个shapefile尝试输入类型:


And for add geometry to one shapefile by geometry type:

for %%g in (POINT LINESTRING POLYGON MULTIPOLYGON MULTIPOINT MULTILINESTRING) do (
for %%s in (.\shp\*%%g.shp) do (
if not  EXIST .\all_shp\all_%%g.shp (
"ogr2ogr" -skipfailures .\all_shp\all_%%g.shp %%s
) else (
"ogr2ogr" -skipfailures -update -append .\all_shp\all_%%g.shp %%s -nln all_%%g
)
)
)



。\\\ - mif文件夹,。\\\\ [ - - 转换后的shapefile文件夹,。\ all_shp \结果文件夹


.\mid\ - mif file folder, .\shp\ - converted shapefile folder, .\all_shp\ result folder


这篇关于批量转换mif为shp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆