Opened 16 years ago
Closed 15 years ago
#2577 closed defect (duplicate)
AGG FORMATOPTION PALETTE= Does not take a relative path
Reported by: | woodbri | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 5.4 release |
Component: | MapServer C Library | Version: | svn-trunk (development) |
Severity: | normal | Keywords: | |
Cc: | sdlime, assefa, dmorissette |
Description
If I use the following code in my mapfile everything works great, but if I remove the absolute path like this PALETTE=palette-ci-google-agg.txt"
it will cause mapserver to throw a server 500 error.
SHAPEPATH "/u/data/cayman_islands/" OUTPUTFORMAT NAME "agg/png24" MIMETYPE "image/png; mode=24bit" DRIVER "AGG/PNG" EXTENSION "png" FORMATOPTION "PALETTE_FORCE=TRUE" FORMATOPTION "PALETTE=/u/data/cayman_islands/palette-ci-google-agg.txt" END
This really needs to support a relative path from the SHAPEPATH or the location of the mapfile, you can create a complete mapserver application that resides in a single directory and be able to move or deploy it to a different directory and ONLY change the SHAPEPATH. There is a standard mapserver function msBuildPath3() and friends that does this for you.
In any case, it should not throw a server 500 error.
Change History (12)
comment:1 by , 16 years ago
Cc: | added |
---|---|
Milestone: | → 5.0.3 release |
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I would suggest we just fix the segfault issue as opposed to trying to deal with relative path support.
Steve
comment:4 by , 16 years ago
Agreed with fixing only the seg fault for 5.0.3.
Making the path relative to the mapfile could still be done in 5.2, that should be a simple fix using msBuildPath() (or were you suggesting that we do not do that at all?).
comment:5 by , 16 years ago
I'm suggesting to wait on the relative path fix. The problem is that as the functions are structured now the mappath is not available to use with msBuildPath(). We'd need to extend the outputFormatObj or the function calls to pass it in.
Steve
comment:6 by , 16 years ago
I think for now it would be adequate to just document for 5.0.3 that you must enter an absolute path as Steve L suggests and fix the relative path in 5.2. And trap and report the missing file instead of SEGV.
-Steve W
comment:7 by , 16 years ago
The palette processor does trap the error and bail appropriately, but it's not being checked somewhere else up the line. I'll track this down.
Steve
comment:8 by , 16 years ago
I fixed the segfault in main trunk and the 5.0 branch. Will leave the ticket to deal with the relative path issue.
Steve
comment:9 by , 16 years ago
Milestone: | 5.0.3 release → 5.2 release |
---|
What about the possiblity of an opaque pointer (I think that's the right term) from an outputFormatObj to it's parent mapfile? That would be one way to access the mappath.
Steve
comment:10 by , 16 years ago
Component: | AGG → MapServer C Library |
---|
Moving relative path issue to next milestone since there is a workaround (full path). Also changing component since this really isn't just an AGG issue.
Steve
comment:11 by , 16 years ago
Milestone: | 5.2 release → 5.4 release |
---|
Tagging for 5.0.3 since we get a seg fault if the palette file is not found (based on report from SteveW on mapserver-dev).