[mapserver-users] OGC spatial filter + SLD

Julien Cigar jcigar at ulb.ac.be
Mon Nov 26 07:01:00 PST 2012


On 11/24/2012 14:23, Julien Cigar wrote:
> On 11/23/2012 19:12, Thomas Gratier wrote:
>> Hello,
>>
>
> Hello,
>
>> Don't know exactly your case but you can maybe rely on runtime 
>> substitution http://mapserver.org/cgi/runsub.html and spatial 
>> abilities of your database e.g 
>> http://postgis.refractions.net/docs/ST_Within.html
>> or on filter (support within 
>> http://mapserver.org/mapfile/expressions.html#spatial-expressions-that-return-a-logical-value-geos 
>> ) + runtime substitution
>> In all case, a bit dirty compare to SLD filter but no choice it seems.
>>
>
> I'm slowly progressing on this issue:
>
> - I can confirm that Mapserver supports OGC spatial filters to filter 
> WMS requests (so far I've tested with <ogc:BBOX> and <ogc:Within>. The 
> filter is converted to an EXPRESSION clause in the Mapfile by Mapserver
> for example: EXPRESSION ([shape]  within  fromText('POLYGON 
> ((24.2073126960992191 0.7680569582964826, 24.2968673039010241 
> 0.7680569582964826, 24.2968673039010241 0.8576025453261950, 
> 24.2073126960992191 0.8576025453261950, 24.2073126960992191 
> 0.7680569582964826))'))
>
> - it seems that there is an obscure bug in the parsing code for the 
> <gml:coordinates> tag:
>
> The following works:
> <ogc:BBOX>
> <ogc:PropertyName>geom</ogc:PropertyName>
> <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
> <gml:coordinates decimal="." cs="," ts=" ">24.207313,0.768057 
> 24.296867,0.857603</gml:coordinates>
> </gml:Box>
> </ogc:BBOX>
>
> BUT, if there is a space (or a newline) in the <gml:coordinates 
> decimal="." cs="," ts=" "> content it doesn't work, so the followings 
> don't work:
> <gml:coordinates decimal="." cs="," ts=" "> 24.207313,0.768057 
> 24.296867,0.857603 </gml:coordinates>
>
> <gml:coordinates decimal="." cs="," ts=" ">
>    24.207313,0.768057 24.296867,0.857603
> </gml:coordinates>
>
> (...)
>
> HOWEVER, this problem doesn't appear in an <ogc:Within>, in any case 
> the <gml:coordinates> is parsed correctly:
>
> So the following works:
>
> <ogc:Within>
> <ogc:PropertyName>geom</ogc:PropertyName>
> <gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
> <gml:outerBoundaryIs>
> <gml:LinearRing>
> <gml:coordinates decimal="." cs="," ts=" ">
>              24.20731269609922 0.7680569582964826,24.296867303901024
>              0.7680569582964826,24.296867303901024 
> 0.857602545326195,24.20731269609922
>              0.857602545326195,24.20731269609922 0.7680569582964826
> </gml:coordinates>
> </gml:LinearRing>
> </gml:outerBoundaryIs>
> </gml:Polygon>
> </ogc:Within>
>
> For readability I've pasted the code on http://pastie.org/5427465
>
> Could someone confirm this is a bug .. ?
>

Another problem now: it seems impossible to combine a spatial filter 
with a non-spatial filter (filters are simply ignored)
Any idea ..? My SLD file is here: http://pastie.org/5437516 and I've 
tried with GML2 and GML3

Julien

>> Regards
>>
>> ThomasG
>
> Regards,
> Julien
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users


-- 
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: jcigar.vcf
Type: text/x-vcard
Size: 292 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121126/050c96ab/attachment.vcf>


More information about the mapserver-users mailing list