Using attribute info stored in MySQL tables

Matthew Haines matthew at PROPERTYRESEARCHPARTNERS.COM
Tue Aug 9 10:42:00 EDT 2005


In my Mapserver application I am generating my maps from shapefiles.  
Since my application is used for real estate, usually the shape files 
hold land parcel polygons, and usually the parcels will be uniquely 
identified by a parcel_id attribute.  There are usually some other 
attributes such as zoning class that I can use to color the map.

But sometimes I'd like to color the map based on attributes that are 
stored in a MySQL table that has the parcel_id has the primary key.  
However I don't have the polygons in the MySQL table -- they remain in 
the shape file.

Is this possible?  What would I put in my .map file to reference the 
MySQL tables?  Can someone sketch out an example of the crucial bits of 
a hypothetical .map file for this?  I looked in this Twiki page
    http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MySQL
for examples, but it seems to cover only the case where the polygons are 
stored in the MySQL table.

Thanks in advance,

Matthew



More information about the mapserver-users mailing list