1. 介绍

shp2mysql参考命令

ESRI Shapefile ==>MySQL
ogr2ogr -f “MySQL” MYSQL:”mydb,host=myhost,user=mylogin,password=mypassword,port=3306″ -nln “world” -a_srs “EPSG:4326″ path/to/world_adm0.shp

2. 安装 gdal-300-1911-x64-core.msi

3. 使用

管理员运行cmd,运行C:\Program Files\GDAL\GDALShell.bat, 相当于设置环境变量

c:\Program Files\GDAL>gdalshell.bat
Setting environment for using the GDAL Utilities.

执行类似命令
ogr2ogr -f “MySQL” MYSQL:”mydb,host=myhost,user=mylogin,password=mypassword,port=3306″ -nln “world” -a_srs “EPSG:4326″ path/to/world_adm0.shp

报错

ERROR 1: Can't load requested DLL: Z:\BroadSpectrumSQLTreeExtract\ogr2ogr\gdalplugins\ogr_MSSQLSpatial.dll

参考 https://trac.osgeo.org/gdal/ticket/6589
要装MS SQL Native Client 11 x64
我安装了 64位 Microsoft® SQL Server® 2012 Native Client – QFE 解决

 
 

1人点赞

 
 

作者:hyl铃儿响叮当
链接:https://www.jianshu.com/p/f9035f605b5b
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。