[mapserver-users] some questions regarding getFeatureInfo, SLD, PostGIS

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Fri Sep 21 03:50:44 PDT 2012


Hi,

So you have tried to define variables %SEX% and %BOD_ID%, used them inside your DATA and then fired  WMS GetMaps by adding &SEX=your_value&BOD_ID=your_id? Does in not work or why it is not powerful enough?

-Jukka Rahkonen-


Julien Cigar wrote:

> Hello,
> 
> I'm using Mapserver 6.0.1 with the following PostGIS layer:
> http://pastie.org/private/84042k84vmljbontls5xvq
> 
> The user has the possibility to select quite a lot of filters, which implies that
> the SQL query should, in theory ,be generated dynamically.
> As this is not possible with Mapserver (run-time substitution with HTTP
> parameters and VALIDATION ... END isn't powerful enough is my case), I'm
> dynamically generating an SLD
> (http://pastie.org/private/p66ml3uvqwcnphuuvera) to filter items and it
> works very well.
> 
> Some questions:
> 
> - Why does Mapserver doesn't have a very lightweight template language (or
> something similar) to dynamically build a string following given parameters? It
> could be really useful to avoid unnecessary JOIN, etc.
> For example something like:
> http://pastie.org/private/bojm3pi1dwrv18m2tvq (this is just an example, but
> the idea is there)
> 
> - I noticed in the PostgreSQL logs that sometimes Mapserver adds an
> additional condition to the WHERE clause when SLD is used. For example with
> the following <ogc:Filter> in my SLD:
> #########################################
> <ogc:Filter>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>basis_of_record_id</ogc:PropertyName>
> <ogc:Literal>1</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> </ogc:Filter>
> #########################################
> 
> Mapserver adds an additional "and (( ("basis_of_record_id"= 1) ))":
> 
> (...) AS q where geom && GeomFromText('POLYGON((-3.6860351557368
> -9.81732918571448,-3.6860351557368 9.81732918571447,47.6860351496117
> 9.81732918571447,47.6860351496117 -9.81732918571448,-3.6860351557368
> -9.81732918571448))',4326) and (( ("basis_of_record_id"= 1) ))
> 
> which is not bad as less rows have to be post-processed by the SLD engine.
> 
> However, as soon as I add an additional <ogc:or> (or <ogc:and>) as:
> #########################################
> <ogc:or>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>basis_of_record_id</ogc:PropertyName>
> <ogc:Literal>1</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>basis_of_record_id</ogc:PropertyName>
> <ogc:Literal>2</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> </ogc:or>
> #########################################
> 
> Mapserver doesn't add this additional AND/OR clause (and ((
> ("basis_of_record_id"= 1) OR ("basis_of_record_id" = 2) )) in this case).. Why
> ?
> 
> - Is it normal that my SLD is totally ignored when I'm using
> REQUEST=GetFeatureInfo? Is the SLD only processed with
> REQUEST=GetMap?
> If this is the case, what's the typical alternative way of doing it?
> Should I go through WFS .. ?
> 
> In advance, thank you for your answers :) Julien
> 
> --
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.



More information about the mapserver-users mailing list