[mapserver-users] OGR shapefile w/MySQL Join

Daniel Morissette dmorissette at mapgears.com
Thu Sep 3 09:34:12 EDT 2009


Steve Lime wrote:
> This isn't an instance where a JOIN block is particularly useful. I need the
> MySQL attributes for map making and JOINs are only used with query
> results. Plus the MySQL join driver assumes integer keys and I have strings.
> Hence my hope to do the join in OGR before the data even hit MapServer.
> 

Here is a post by Frank from a couple of years ago that explains how to 
join shapefile and ODBC data with an OGR SQL statement in the layer's 
DATA parameter:

http://lists.osgeo.org/pipermail/mapserver-users/2004-November/002149.html

It should be easy to adapt this example to connect to MySQL instead of 
ODBC for the join, but I didn't test it myself. (The MySQL driver docs 
are at http://gdal.org/ogr/drv_mysql.html)

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/


More information about the mapserver-users mailing list