本文介绍了批量转换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
推荐答案
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!