How to Import shape file into MySQL

2020-02-23 11:16发布

I need to import the spatial data in shape file into MySQL tables. I am able to import into PostGreSQL. Any pointers for MySQL. I need the data in MySQL table.

2条回答
三岁会撩人
2楼-- · 2020-02-23 11:23

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

查看更多
再贱就再见
3楼-- · 2020-02-23 11:43

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/

查看更多
登录 后发表回答