[gdal-dev] ogr2ogr: Import .dbf and .shp to MySQL in WKT format

Arielle Simmons Asimmons at PVPC.ORG
Tue Jan 29 11:40:08 PST 2013


Hi,

 

I have two goals:

1) Use ogr2ogr to get polygon data into MySQL in a non-blob format (i.e.
I was hoping for WKT)

2) Get the full polygon dbf table into the same database...

 

I have figured out a way to get data into a MySQL database using (in
FWTools Shell). It is a total hack (from what I can tell the '-update'
and '-overwrite' commands don't work for me, nor does the
engine=MYISAM):

 

Step 1 (FWTools Shell):

 

ogr2ogr -f "MySQL" MYSQL:"test,host=27.0.0.1,user=root,port=3306" -nln
test_poly -a_srs "EPSG:3857" <path to shapefile> 

 

Tables are generated, but no data....

 

Step 2 (MySql Workbench):

 

Go to the 'test_poly' table, and manually set it's engine to "MYIASM"
..

 

Step 3 (FWTools Shell):

 

C:>ogr2ogr -f "MySQL" MYSQL:"test,host=127.0.0.1,user=root,port=3306"

-nln test_poly -a_srs "EPSG:3857" -update -append <shapefile path>

 

Now I see the data (**as a BLOB...need WKT have to parse...unless there
is someway to parse Geometry from BLOB***) and can load it into
QGIS...but totally at a loss how to achieve getting the .dbf in the same
database and get to the WKT format in MySQL.

 

Can anyone share some guidance?

 

Thank ye!!!

 

Arielle Simmons

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130129/f314f1ae/attachment-0001.html>


More information about the gdal-dev mailing list