layer->project defaulted to MS_TRUE.
Brian Peschel
brianp at OCCINC.COM
Mon Feb 13 10:32:55 EST 2006
> For http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1645 there was
> a problem with getting NONSQUARE mode to work.
Frank,
As the submitter of the bug, I tried what you suggested in the bug itself:
> The workaround in 4.8 is to set a projection on the layer and map.
> Iterating through the layers manually and setting layer->project to
> MS_TRUE in advance would also work.
So, in my test program after setting the config option, I added this code:
// Set the image size
map->height = static_cast<int>(PIXEL_HEIGHT);
map->width = static_cast<int>(PIXEL_WIDTH);
// Allow non-square pixels
msSetConfigOption(map, "MS_NONSQUARE", "YES");
// Hack for 4.8.x version of MapServer
for(unsigned j = 0; j < map->numlayers; j++)
map->layers[j].project = true;
// Set the Rect Hull of the image
map->extent.minx = rh[SW].x();
map->extent.maxx = rh[SE].x();
map->extent.miny = rh[SW].y();
map->extent.maxy = rh[NW].y();
The resulting image is completely white (which is the background color if my
image according to my mapfile).
I have never gotten projection working correctly with MapServer (which is
why I didn't have projection in my mapfile). if I add projection layers
into my map file (even with all the projections set to the same), I get a
MapServer error:
msProcessProjection(): Projection library error. no system list, errno: 2
which confuses me because I use PROJ.4 in another program of mine without
problems (althought I do use a different file in /use/local/share/proj)
So, I am stuck again. If I try to add a projection layer to my map file
(like the bug suggests), I get runtime errors. If I try to just add the
code hack the bug suggests, I get a blank white image.
Any thoghts?
More information about the mapserver-dev
mailing list