bug in mapogcfilter.c

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


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], "SRS") == 0) {
      /* SRS is in format "EPSG:epsg_id" or "AUTO:proj_id,unit_id,lon0,lat0"
*/
      if (strncasecmp(values[i], "EPSG:", 5) == 0)
      {
        /* SRS=EPSG:xxxx */

          sprintf(srsbuffer, "init=epsg:%.20s", values[i]+5);
          sprintf(epsgbuf, "EPSG:%.20s",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(&(map->projection), srsbuffer) != 0)
          return msWMSException(map, nVersion, NULL);

        iUnits = GetMapserverUnitUsingProj(&(map->projection));
        if (iUnits != -1)
          map->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 <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 10:44

> This fixes the reprojection issue mentioned for:
> 
> 1) WFS requests
> 2) SLD WMS requests with &amp;SRS=[the data's native SRS]
> 
> but not for:
> 
> 3) SLD WMS requests with reprojection
> 
> Does anybody have an idea what other fix might be needed for 3) ?
> 
> 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: [UMN_MAPSERVER-DEV] bug in mapogcfilter.c
> Datum: 13/04/07 08:56
> 
> &gt; Hi list,
> &gt; 
> &gt; I've been trying to debug why BBOX filters in other SRS's (different
than
> &gt; the map's SRS) currently don't work in Mapserver.
> &gt; 
> &gt; In mapogcfilter.c, the box received (in the WFS or SLD WMS request)
will
> be
> &gt; projected if the projection differs, but the msProjectRect function
call
> &gt; currently is:
> &gt; 
> &gt; msProjectRect(&amp;amp;map-&amp;gt;projection, &amp;amp;sProjTmp,
&amp;amp;sQueryRect);
> &gt; 
> &gt; it should however be:
> &gt; 
> &gt; msProjectRect(&amp;amp;sProjTmp, &amp;amp;map-&amp;gt;projection,
&amp;amp;sQueryRect);
> &gt; 
> &gt; so the arguments are passed in in the wrong sequence.
> &gt; 
> &gt; Since bugzilla seems to be down I can't open a bug for this.
> &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; 
> 
> 



More information about the mapserver-dev mailing list