How to Import shape file into MySQL

烈酒焚心 提交于 2019-11-30 07:18:24

try this whit FWtool instaled

ogr2ogr -f MySQL MySQL:database_name,host=localhost,user=root,password=1234 C:\route_path\line.shp -nln datatable_name -update -overwrite -lco engine=MYISAM

try install for better result in any proces Osgeo4w

http://trac.osgeo.org/osgeo4w/

I have just used the ogr2ogr command line tool to import the shape file into the mysql database. Make sure that the database server allows external connections. If doesn't, then it throws all sorts of errors.

Once you have that you can use -

Select ASTEXT(Shape) POLYGON from world to get an array of the polygon coordinates etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!