[mapserver-users] Query Layer out of DB
pucher at atlas.gis.univie.ac.at
Thu Sep 27 04:36:20 EDT 2001
sounds great to me, but:
a) can I do this with mapserver 3.4 ?
b) where to put/send the variable codelist ? Append it in the URL? Like
e.g.: http://path/to/mapserver.phtml?codelist=AT|DE|IT ? Doesn't work
The mapfile looks like this (it work, when I sustitute %codelist% with
e.g. AT|DE|IT - they turn red):
# LABELITEM "Arrgcdl0"
COLOR 255 0 0
COLOR 188 137 137
COLOR 188 182 137
COLOR 141 188 137
COLOR 137 175 188
COLOR 210 210 210
HEADER "Nurgcd NURGNM Link"
Stephen Lime wrote:
>Seems to me the easiest way to do this is to turn the results of the SQL query into a either an attribute query or a class expression that hilites the right polys. This assumes you have a primary key between the 2 systems, a county code or something. I'd recommend the class expression option since it's the most straight forward. 3.5 has a couple of nice features that make doing this sort of thing pretty easy. Basically you set up a map with 2 parts, layer descriptions that compose the background of the map and a single layer to use in displaying the right countries. That single layer is what you manipulate the class expression for. Set the status to OFF for that layer and set up a class like:
> EXPRESSION /%codelist%/
>Then in your other app you'd create a variable that cats all the country codes together (i.e. id1|id2|id3) called codelist. MapServer CGI will substitute the value of codelist for %codelist% and there you have it, a dynamic expression. Be sure to turn the layer on.
>No need to go to MapScript on this one...
>Data & Applications Manager
>500 Lafayette Road
>St. Paul, MN 55155
>>>>Alexander Pucher <pucher at atlas.gis.univie.ac.at> 09/26/01 07:11 AM >>>
>I want to explain my question with a little example.
>Let's presume, I have a map of Europe with all the european countries
>included. In addition to that, I have statistical data about the various
>countries - like population, area etc. - stored in a database system -
>say MySQL. I make a SQL query, showing me the 3 countries with the
>highest poulation figures (e.g. Germany, France, UK). The system gives
>me a button saying "Show in Mapserver". What I want to see is the map of
>Europe with the three countries hilited.
>I'm quite sure that this has to be done with a newLayerObj, that is
>simply put onto the "standard" layers. Can anybody give me some more
>detailed information about this. Any suggestions, code snippets, links
>or previously posted messages to mapserver-users-group would be great.
Institut fuer Geographie und Regionalforschung
Kartografie und Geoinformation
Departement of Geography and Regional Research
University of Vienna
Cartographie and GIS
Universitaetstr. 7, A-1010 Wien, AUSTRIA
Tel: (+43 1) 4277 48644
Fax: (+43 1) 4277 48649
E-mail: pucher at atlas.gis.univie.ac.at
"The toughest fight, was with my wife." -- Muhammad Ali
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mapserver-users