[mapserver-users] Using EXPRESSION to display various data from MySQL database
Peter Rose
peter_rose at hotmail.com
Tue Mar 31 02:00:33 PDT 2009
Hi
I have a MapServer set up connected to a MySQL server via PHP/MapScript based on the example in Bill Kropla’s book ‘Beginning MapServer Open Source GIS Develpment’, chapter 9.
My data is therefore stored on the MySQL server and displayed as points in MapServer based on the queries I give it.
The data also have fiscal values which I would like to display with differently sized coloured points depending on their value. I know how to do this with an EXPRESSION in the mapfile if the data is stored as an attribute in a shapefile but I can’t get it to work with my data in the MySQL database.
Here is my mapfile:
#####################################
# POI layer - points of interest
#
LAYER
NAME "poi"
STATUS default
TYPE point
LABELCACHE on
CLASS
NAME "Large fiscal"
EXPRESSION ([fiscal] < 1)
STYLE
SYMBOL "Circle"
SIZE 8
COLOR 255 0 0
BACKGROUNDCOLOR 255 0 0
END
END # class
CLASS
NAME "Small fiscal"
EXPRESSION ([fiscal] > 1)
STYLE
SYMBOL "Circle"
SIZE 8
COLOR 0 255 0
BACKGROUNDCOLOR 0 255 0
END
END # class
END # layer poi
#####################################
The database connection and all querying takes place in the php-file as I want to allow the users to change their search criteria. I therefore don’t want to include any database connection in the mapfile if possible.
Thanks in advance for your help.
--
View this message in context: http://n2.nabble.com/Using-EXPRESSION-to-display-various-data-from-MySQL-database-tp2561898p2561898.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
More information about the MapServer-users
mailing list