[Gdal-dev] OGR MySQL development

Howard Butler hobu at iastate.edu
Mon Jan 16 11:13:26 EST 2006


List,

I have been making improvements to OGR's MySQL driver.  These 
improvements including being able to natively read MySQL geometries 
and eventually will include write support for MySQL.  I have been 
testing with MySQL 5.0.18 on both OS X and Fedora Core 3.  No 
guarantees for anything less than that at this point.

A summary of what has been completed so far:
- Detect geometry columns
- Read geometries from MySQL using AsBinary()
- Read geometry column from geometry_columns table
- Detect geometry type from geometry_columns table
- Read srid and srtext from spatial_ref_sys

If you are interested in playing with this, look at the load2mysq.py 
script in pymod/samples.  This can be used to load an OGR layer into 
MySQL.   It will create a spatial index as well as geometry_columns 
and spatial_ref_sys tables.  I have been testing with Schuyler's 
world_borders.shp <http://mappinghacks.com/data/world_borders.zip>, 
and you may have to edit the 4326 SRID values in the script if your 
data is in something different.

MySQL in CVS should be considered unstable until some point in the 
near future once these additions are complete.  If you decide to play 
around with it, I'd be interested in hearing how it goes and what 
troubles you have.  As always, I'm on #gdal on IRC.

Howard






More information about the Gdal-dev mailing list