[mapserver-users] queries

woodbri at swoodbridge.com woodbri at swoodbridge.com
Mon Sep 16 11:32:55 EDT 2002


Stefan,

I'm not sure what you are trying to achieve. Here is one layer that 
styles different attributes in different ways. Is this what you want?
I your case you could change CLASSITEM CFCC to CLASSITEM group
or CLASSITEM id and change the EXPRESSION statements appropriately.

In theory, you could do all of this dynamically in PHP/Mapscript 
without a mapfile if that is what you are asking.

-Steve

LAYER
  NAME landmark
  TYPE POLYGON
  STATUS ON
  TILEINDEX "tgrindex"
  DATA landmark
#  MAXSCALE 1999999
  MAXSCALE 800000
  CLASSITEM CFCC

  CLASS
    EXPRESSION /^D10/
    NAME "Military"
    # Military Installation or Reservation
    OUTLINECOLOR -1 -1 -1
    COLOR 153 153 102
  END
  CLASS
    EXPRESSION /^D4/
    NAME "Education"
    # Education and Religious institutions
    # includes academy, school, colleg or university
    OUTLINECOLOR -1 -1 -1
    COLOR 198 198 222
  END
  CLASS
    EXPRESSION /^D5/
    NAME "Transportation"
    # Transportation terminals (airport, airfield, train, bus, 
marine)
    OUTLINECOLOR -1 -1 -1
    COLOR 153 153 153
  END
  CLASS
    EXPRESSION /^D6/
    NAME "Centers"
    # Employment center, shopping or major retail center
    # Industrial bldg or park, office Bldg or park
    # Amusement Center, Government of other centers
    OUTLINECOLOR -1 -1 -1
    COLOR 153 102 102
  END
  CLASS
    EXPRESSION /^D81/
    NAME "Golf Course"
    OUTLINECOLOR -1 -1 -1
    COLOR 206 222 198
  END
  CLASS
    EXPRESSION /^D8[0345]/
    NAME "Parks"
    # Open Space, National Park, Forests
    # or other federal land, State or Local Park or forest
    OUTLINECOLOR -1 -1 -1
    COLOR 174 206 165
  END

  METADATA
    "DESCRIPTION" "Area Landmarks"
    "RESULT_FIELDS" "LAND CFCC NAME"
  END

  HEADER "html/land_header.html"
  FOOTER "html/land_footer.html"
  TEMPLATE "html/land.html"

  TOLERANCE 3
END


On 16 Sep 2002 at 16:22, Stefan Stern wrote:

> Hi,
> 
> Sorry, I missed the spot. ;-)
> 
> The dataset is very long and in order to cover all occurences (each
> single id, each group) I'd had to write one mapfile for each id or one
> layer per id.
> 
> Is there a way to make the mapfile more vital, e.g. by passing a
> parameter that decides which filter or expression to use? e.g. ####
> EXPRESSION "T1" ### could be used with a variable like : ## EXPRESSION
> "$filter" ##
> 
> That's where I thought about letting PHP create a temporary mapfile
> (with substituted filters in the EXPRESSION statement) and pass it to
> mapserver.
> 
> Does anybody se an alternative way?
> 
> Regards,
> Stefan
> 
> 
> 
> 
> 
> 
> 
> woodbri at swoodbridge.com wrote:
> 
> >Stefan,
> >
> >Yes, you can use CLASS EXPRESSIONS and I believe 
> >FILTER EXPRESSIONS. Check these out in the MapScript reference.
> >
> >-Steve W.
> >
> >On 16 Sep 2002 at 15:22, Stefan Stern wrote:
> >
> >>Hi all,
> >>
> >>I use a dataset of points (.shp) that looks similar to this:
> >>
> >>id     | group  | x_ccord   | y_coord
> >>T1     | T      | 1234      | 12234
> >>T2     | T      | 4321      | 4321
> >>F1     | F      | 4566      | 3211
> >>
> >>I created a mapfile that displays all points.
> >>
> >>Now I want to display just certain points according to "id" or
> >>"group". e.g. "display only T1" or "display all T".
> >>
> >>My first idea is to write a temporary mapfile with php on the
> >>harddrive and point mapserver to it.
> >>
> >>Is there an other way (implemented) in mapserver? ANd if so, where
> >>can I find some documentation about it?
> >>
> >>Regards,
> >>Stefan
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> 
> 
> 
> 





More information about the mapserver-users mailing list