[mapserver-dev] MapServer 5.2 Beta 3 Available

Paul Ramsey pramsey at cleverelephant.ca
Fri Jun 27 17:17:17 EDT 2008


David, I agree, it's the relative shapepath case that is failing.

You may not like this but I replicated the old logic and just added
yours to the top. I think that your idea that in general things are
either absolute paths or work is correct, so this ugly code should not
be too slow. And I like that it actually falls back: if the file is
missing in one place, it'll check another.

Patch attached.

On Fri, Jun 27, 2008 at 1:53 PM, David Fuhry <dfuhry at acm.org> wrote:
> Paul,
>
>   For an absolute shapepath, the shapepath clobbers tiFileAbsDir (the
> absolute path of the tileindex file's directory), and I think things work
> correctly.
>
>   But the relative shapepath case is not handled correctly.  I'm thinking
> that the correct logic needs a branch, and should look like this:
>
>    if(layer->tileindex) {
>      if (map->shapepath)
>      {
>        msBuildPath(szPath, map->shapepath, filename);
>      } else {
>        msBuildPath(tiAbsFilePath, map->mappath, layer->tileindex); /*
> absolute path to tileindex file */
>        tiAbsDirPath = msGetPath(tiAbsFilePath); /* tileindex file's
> directory */
>        msBuildPath(szPath, tiAbsDirPath, filename);
>        free(tiAbsDirPath);
>      }
>    } else {
>      msBuildPath3(szPath, map->mappath, map->shapepath, filename);
>    }
>
>
>   Is the lower else clause still ok?
>
> Thanks,
>
> Dave
>
> Paul Ramsey wrote:
>>
>> This doesn't seem right to me:
>>
>>      msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename);
>>
>> If shapepath isn't set, you get the right answer, but if it *is* set,
>> you get something very odd indeed.
>>
>> P.
>>
>> On Fri, Jun 27, 2008 at 12:50 PM, Jeff McKenna
>> <jmckenna at gatewaygeomatics.com> wrote:
>>>
>>> Jim,
>>>
>>> There was indeed a change in beta3 regarding TILEINDEX layers, but it
>>> should
>>> not affect any existing indexes with SHAPEPATH set, which is your case.
>>>  I
>>> can duplicate your error with a file structure exactly like yours: with
>>> beta2 no error, with beta3 i get your exact errors.  Would you mind
>>> reporting this in the associated ticket?
>>> http://trac.osgeo.org/mapserver/ticket/2369  Also please include what OS
>>> you
>>> are testing on (I am testing on Windows).
>>>
>>> Good find!
>>>
>>>
>>>
>>> ---
>>> Jeff McKenna
>>> FOSS4G Consulting and Training Services
>>> http://www.gatewaygeomatics.com/
>>>
>>>
>>>
>>>
>>>
>>> On 27-Jun-08, at 11:54 AM, Jim Klassen wrote:
>>>
>>>> All,
>>>>
>>>> Beta3 seems to have broken my tiled raster layers. These layers all
>>>> worked
>>>> fine up through 5.2.0-beta2. Is there something I need to change in my
>>>> config?
>>>>
>>>> The error I get is "msDrawMap(): Image handling error. Failed to draw
>>>> layer named 'L10'. msDrawRaster(): Unable to access file.
>>>> L10/512000_0-1024000_512000.jpg using full path
>>>> L10/512000_0-1024000_512000.jpg"
>>>>
>>>> In map I have SHAPEPATH set to "PWTS/2006_00"
>>>> In the layers I have TILEINDEX "L10/TILEINDEX"
>>>> In the tileindex I have Locations such as
>>>> "L10/512000_0-1024000_512000.jpg"
>>>>
>>>> The file system layout is:
>>>>
>>>> ./AERIAL_2006/ramsey_2006.map
>>>> ./AERIAL_2006/PWTS/2006_00/L10/TILEINDEX.{shp,shx,dbf}
>>>> ./AERIAL_2006/PWTS/2006_00/L10/*.jpg
>>>>
>>>> Jim Klassen
>>>> City of St. Paul
>>>>
>>>>>>> "Steve Lime" <Steve.Lime at dnr.state.mn.us> 06/26/08 10:00 PM >>>
>>>>
>>>> - mapshape.c: Applied patch to make the location of tiled data relative
>>>> to
>>>> the
>>>>  tileindex directory if SHAPEPATH is not set. (#2369)
>>>>
>>>>
>>>> _______________________________________________
>>>> mapserver-dev mailing list
>>>> mapserver-dev at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>>>
>>> _______________________________________________
>>> mapserver-dev mailing list
>>> mapserver-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>>>
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tileshape.patch
Type: application/octet-stream
Size: 9462 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20080627/7ce9bac7/tileshape-0001.obj


More information about the mapserver-dev mailing list