[Mapserver-users] Re: filter with shp

Eduardo Spremolla edspremolla at Antel.com.uy
Fri Mar 21 04:58:50 PST 2003


I'm trying to use dynamic expressions from CGI, but in:

<input type="hidden" id="clase" name="map_moviles_class_2_expression"
value="[map_moviles_class_2_expression]">

the value did not get substituted.

What I wont is to later modify the value with javascript prior to post.

By the way [map_moviles_data] works ok and I have 3 classes in moviles.

Thanks in advance

LALO 

On Thu, 2003-03-20 at 22:43, John Hagstrand wrote:
> Hi Jan,
> 
> Thank you very much.  I've got it working now.  Excellent. (I see I should 
> have been able to figure it out from the documentation.)
> 
> Thanks
> John
> -------------------------
> 
> John,
> As Steve says, you don't need FILTER to select from shapfiles. Just
> define a CLASS like:
> CLASS
> ...
> EXPRESSION "([TIMEBEG] < 1500 AND [TIMEEND] >= 1500)"
> END
> 
> Take care of the syntax! Quoting from the MapFile reference (under CLASS
> / EXPRESSION):
>  > Logical expressions allow you to build fairly complex tests based on
>  > one or more attributes and therefore are only available with
>  > shapefiles. Logical expressions are delimited by parentheses
>  > "(expression)". Attribute names are delimited by square brackets
>  > "[ATTRIBUTE]". These names are case sensitive and must match the items
>  > in the shapefile. For example: EXPRESSION ([POPULATION] > 50000 AND
>  > '[LANGUAGE]' eq 'FRENCH') ... The following logical operators are
>  > supported : =,>,<,<=,>=,=,or,and,lt,gt,ge,le,eq. As you might expect
>  > this level of complexity is slower to process.
> 
> On your second question: you can specify an expression dynamically in
> the calling URL:
> http://.../mapserv?map=my.map&layer=...&map_layer_0_class_0.expression="{...)"
> See the end of the MapFile reference for this very powerful mechanism.
> -------------------------------------------------------------------------
> BTW I'm not sure if the FILTER statement works as specified in the CVS
> version of MapServer. I tried the following on a world-map:
> FILTERITEM name
> FILTER France
> and got a map of France. However
> FILTER "name='France'"
> gave back the whole world. I tried various permutations of quotes,
> brackets and capitals, but always got back the whole world. Am I missing
> something?
> Jan
> 
> John Hagstrand wrote:
>  > Hi Steve,
>  >
>  > Thanks for the reply. I have a shapefile containing 500 polygons. For
>  > any given map request I want to pull out some two or three hundred
>  > polygons depending on the value of a field. So I tried doing this:
>  >
>  > FILTER 'TIMEBEG < 1500 AND TIMEEND >= 1500'
>  >
>  > That gets me an error. Is there some way I can accomplish this objective?
>  >
>  > Then of course there's another step: I want to vary the 1500 value
>  > dynamically. I wonder if there's a way to do that without rewriting the
>  > whole mapfile each time.
>  >
>  > How would you recommend I go about this?
>  > Thanks
>  > John
>  >
>  > At 05:26 PM 3/18/2003, Steve Lime wrote:
>  >
>  >> There's not much reason to use FILTER with shapefiles unless you're
>  >> doing itemquery's. Filters exist primarily as a mechanism to invoke
>  >> vendor specific SQL engines prior to MapServer getting access to
>  >> features.
>  >>
>  >> Steve
>  >>
>  >> >>> John Hagstrand <john.hagstrand at interageresearch.com> 03/16/03
>  >> 09:15PM >>>
>  >> Hi,
>  >>
>  >> Can you direct me to an example using a FILTER with a shapefile?
>  >>
>  >> Thanks
>  >> John
> 
> 
> _______________________________________________
> 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