[Mapserver-dev] MySQL feature data joins

Stephen Woodbridge woodbri at swoodbridge.com
Wed Jun 16 15:47:47 EDT 2004


David Horowitz wrote:

> Hello all,
> 
> I'm writing an application which gets its spatial data from shapefiles but its feature data from a SQL data source (either MySQL or Oracle).  I have read the Wiki topic "JoinDatasources" but did not find its explanation of how to go about this sufficient.  Any help here would be appreciated.
> 
> To be more specific, I have all my data loaded into a MySQL database (using the shp2mysql tool).  Supposing the source shapefile is "statemap.shp" and the feature column I wanted to access in my database was called "title" what would my mapfile entry look like?  Is using a join the way to go about solving this problem?

I have a similar situation where all my spatial data is in shapefiles 
and I have Summary File 1 data in MySQL. How would I set up a layer to 
to JOIN MYSQL_ZIPCODE to DBF_ZIPCODE attributes and then specify 
MYSQL_INCOME as the CLASSITEM so I can color polygons based on INCOME 
values from Summary File 1.

I read the docs on this but the details were not obvious and there was a 
phrase about MYSQL JOINs only being supported in a query template which 
did not make any sense to me.

-Steve




More information about the mapserver-dev mailing list