[Mapserver-users] Multiple Layer Itemqueries?

David Fawcett David.Fawcett at state.mn.us
Thu Feb 19 15:50:38 EST 2004


Let me re-frame this to see if anyone has any creative answers.  

I am using CGI MS.  I have a shapefile with county polygons.  Through a
URL call, I would like to display selected polygons drawn with colors
that reflect of two possible classes.  The poly IDs have to be passed in
through the URL (like an item query).  The mapfile could contain one
layer with two classes or two layers with only one class.  

The data is dynamic and not stored in the shape file, it comes from an
Access database.  The final MS image is being requested through a
<cfhttp> tag in ColdFusion.  An itemquery for a selected list of polys
works great through this method.

Here is a story problem example.... ; )

In the past 5 years, about a third of the counties in this state held
interim elections.  Display the polys for the counties that held interim
elections, and color them red if they went Republican and blue if they
went Democratic.  

Any ideas?

David J. Fawcett
MN Office of Environmental Assistance

>>> "David Fawcett" <David.Fawcett at state.mn.us> 2/19/2004 9:02:46 AM
>>>
Is it possible to perform two itemnqueries in the same request? 
Something like:

http://0.0.0.0/cgi-bin/ms4/mapserv.exe?map=e%3A%5Cweb%2Fsc%5Cmulti.map&mode=itemnquery&qlayer=sub&qitem=FIPS&qstring=('[FIPS]'+IN+'27001,27003,27005')&qlayer=log&qitem=FIPS&qstring=('[FIPS]'+IN+'27007,27009,27011')"

I have a map file with two layers that both reference the same MN
counties poly shapefile.  I have classed each layer so one is red and
the other is blue.  And, I am using STYLE selected in my querymap
object.  

It works, but it appears that the second itemnquery overwrites the
first one in the URL string.  Is it possible to get the selected items
from each layer to show up in the same image?


Here is the Map Snippet:

  QUERYMAP
    SIZE 150 150
    STATUS ON
    STYLE SELECTED
    #COLOR 255 204 102
  END

  
LAYER
    NAME log
    STATUS ON
    TYPE POLYGON
    DATA score
	TEMPLATE "selectcounty.html"
	FOOTER "selectcountyfoot.html"
    CLASS 
	   COLOR 255 0 0
       OUTLINECOLOR 181 181 181   
    END
  END
  LAYER
    NAME sub
    STATUS ON
    TYPE POLYGON
    DATA score
	TEMPLATE "selectcounty.html"
	FOOTER "selectcountyfoot.html"
    CLASS 
	   COLOR 255 204 102
       OUTLINECOLOR 181 181 181  
    END
  END

David J. Fawcett
MN Office of Environmental Assistance
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu 
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list