bug in mapogcfilter.c

Bart van den Eijnden (OSGIS) bartvde at OSGIS.NL
Fri Apr 13 10:40:42 EDT 2007


This is getting more tricky and brittle ....

Whether or not it works depends on the sequence of parameters, and
especially SLD versus BBOX.

If SLD is after BBOX, it works fine.

If SLD is before BBOX, it does not work (the selection won't be applied,
msQueryByRect will return no results).

This works:
http://test.intranet.rijkswaterstaat.nl/services/geoservices/overzichtskaartnl?&ttt=1&LAYERS=NL%2Dprov&REQUEST=GetMap&SERVICE=WMS&FORMAT=image%2Fpng&SLD_BODY=&STYLES=default&HEIGHT=450&QUERY_LAYERS=NL%2Dprov&VERSION=1.1.0&SRS=EPSG:4326&WIDTH=750&BBOX=%2D11%2E4978209692%2C47%2E29982228038%2C16%2E1647439812%2C63%2E89736125062&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&sld=http://test.intranet.rijkswaterstaat.nl/apps/geoservices/chameleon/../ms_tmp/sld/hadessldxml9E6NgJ

This does not:
http://test.intranet.rijkswaterstaat.nl/services/geoservices/overzichtskaartnl?&ttt=1&LAYERS=NL%2Dprov&REQUEST=GetMap&SERVICE=WMS&FORMAT=image%2Fpng&SLD_BODY=&STYLES=default&HEIGHT=450&QUERY_LAYERS=NL%2Dprov&VERSION=1.1.0&SRS=EPSG:4326&WIDTH=750&sld=http://test.intranet.rijkswaterstaat.nl/apps/geoservices/chameleon/../ms_tmp/sld/hadessldxml9E6NgJ&BBOX=%2D11%2E4978209692%2C47%2E29982228038%2C16%2E1647439812%2C63%2E89736125062&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage

Haven't found a fix yet though.

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Bart van den Eijnden OSGIS <bartvde at OSGIS.NL>
Naar: MAPSERVER-DEV at LISTS.UMN.EDU <MAPSERVER-DEV at LISTS.UMN.EDU>
Onderwerp: Re: [UMN_MAPSERVER-DEV] bug in mapogcfilter.c
Datum: 13/04/07 12:09

> Okay, tracked no. 3 down to mapwms.c. Somehow in my use case it doesn't
get
> to the code where the map gets reprojected.
> 
> There is a comment in the code that the reprojection code used to be at a
> higher level, if I uncomment that part (and change buffer into srsbuffer)
> all is fine:
> 
>     else if (strcasecmp(names[i], &quot;SRS&quot;) == 0) {
>       /* SRS is in format &quot;EPSG:epsg_id&quot; or
&quot;AUTO:proj_id,unit_id,lon0,lat0&quot;
> */
>       if (strncasecmp(values[i], &quot;EPSG:&quot;, 5) == 0)
>       {
>         /* SRS=EPSG:xxxx */
> 
>           sprintf(srsbuffer, &quot;init=epsg:%.20s&quot;, values[i]+5);
>           sprintf(epsgbuf, &quot;EPSG:%.20s&quot;,values[i]+5);
> 
>         /* we need to wait until all params are read before */
>         /* loding the projection into the map. This will help */
>         /* insure that the passes srs is valid for all layers. */
> 
>         if (msLoadProjectionString(&amp;(map-&gt;projection), srsbuffer)
!= 0)
>           return msWMSException(map, nVersion, NULL);
> 
>         iUnits = GetMapserverUnitUsingProj(&amp;(map-&gt;projection));
>         if (iUnits != -1)
>           map-&gt;units = iUnits;
> 
>       }
> 
> Any ideas from the mapwms.c cracks?
> 
> Best regards,
> Bart
> 
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
> 
> 
> --------- Oorspronkelijk bericht --------
> Van: Bart van den Eijnden OSGIS &lt;bartvde at OSGIS.NL&gt;
> Naar: MAPSERVER-DEV at LISTS.UMN.EDU &lt;MAPSERVER-DEV at LISTS.UMN.EDU&gt;
> Onderwerp: Re: [UMN_MAPSERVER-DEV] bug in mapogcfilter.c
> Datum: 13/04/07 10:44
> 
> &gt; This fixes the reprojection issue mentioned for:
> &gt; 
> &gt; 1) WFS requests
> &gt; 2) SLD WMS requests with &amp;amp;SRS=[the data's native SRS]
> &gt; 
> &gt; but not for:
> &gt; 
> &gt; 3) SLD WMS requests with reprojection
> &gt; 
> &gt; Does anybody have an idea what other fix might be needed for 3) ?
> &gt; 
> &gt; Best regards,
> &gt; Bart
> &gt; 
> &gt; --
> &gt; Bart van den Eijnden
> &gt; OSGIS, Open Source GIS
> &gt; http://www.osgis.nl
> &gt; 
> &gt; 
> &gt; --------- Oorspronkelijk bericht --------
> &gt; Van: Bart van den Eijnden OSGIS &amp;lt;bartvde at OSGIS.NL&amp;gt;
> &gt; Naar: MAPSERVER-DEV at LISTS.UMN.EDU
&amp;lt;MAPSERVER-DEV at LISTS.UMN.EDU&amp;gt;
> &gt; Onderwerp: [UMN_MAPSERVER-DEV] bug in mapogcfilter.c
> &gt; Datum: 13/04/07 08:56
> &gt; 
> &gt; &amp;gt; Hi list,
> &gt; &amp;gt; 
> &gt; &amp;gt; I've been trying to debug why BBOX filters in other SRS's
(different
> than
> &gt; &amp;gt; the map's SRS) currently don't work in Mapserver.
> &gt; &amp;gt; 
> &gt; &amp;gt; In mapogcfilter.c, the box received (in the WFS or SLD WMS
request)
> will
> &gt; be
> &gt; &amp;gt; projected if the projection differs, but the msProjectRect
function
> call
> &gt; &amp;gt; currently is:
> &gt; &amp;gt; 
> &gt; &amp;gt; msProjectRect(&amp;amp;amp;map-&amp;amp;gt;projection,
&amp;amp;amp;sProjTmp,
> &amp;amp;amp;sQueryRect);
> &gt; &amp;gt; 
> &gt; &amp;gt; it should however be:
> &gt; &amp;gt; 
> &gt; &amp;gt; msProjectRect(&amp;amp;amp;sProjTmp,
&amp;amp;amp;map-&amp;amp;gt;projection,
> &amp;amp;amp;sQueryRect);
> &gt; &amp;gt; 
> &gt; &amp;gt; so the arguments are passed in in the wrong sequence.
> &gt; &amp;gt; 
> &gt; &amp;gt; Since bugzilla seems to be down I can't open a bug for this.
> &gt; &amp;gt; 
> &gt; &amp;gt; Best regards,
> &gt; &amp;gt; Bart
> &gt; &amp;gt; 
> &gt; &amp;gt; --
> &gt; &amp;gt; Bart van den Eijnden
> &gt; &amp;gt; OSGIS, Open Source GIS
> &gt; &amp;gt; http://www.osgis.nl
> &gt; &amp;gt; 
> &gt; &amp;gt; 
> &gt; 
> &gt; 
> 
> 



More information about the mapserver-dev mailing list