Nicolas, Thanks for the additional info. With it I was able to replicate your problem, and yes indeed it is a subtle bug in the gdal plugin changes for 0.7.0.
If you take away the map buffer_size your image should render correctly. Can you confirm this? I cannot imagine any reason you need to use a buffer_size >0 for rendering raster images - can you remove this parameter or let me know why you are using it? What is happening is that when the buffer is added to the Map the scaled image returned from gdal does not honor it the buffer size (based on limitations in the mapnik::Query class) and returns an image that is two small and is resampled incorrectly. This should only occur when two conditions are met: 1) you are at or near the resolution limit of the input raster image and 2) you are using a buffer_size > 0 Overall, with the 0.7.0 release we switched to letting GDAL handle the image scaling and resampling rather than the previous behavior of having Mapnik request a full resolution image no matter the map scale, then scaling that image down during the rendering process. As you can imagine the previous behavior had very poor performance with large images. So, your options to workaround this issue, for now, are to set the buffer_size = 0 or use the raster input plugin. Dane On Jan 25, 2010, at 1:26 AM, Nicolas Gillet wrote: > > Hello Dane, > > Thank you for your invest. > > I did not put my XML at first as it was deadly simple : > > <?xml version="1.0"?> > <Map bgcolor="#94BAD4"> > </Map> > > Actually I made a C++ application using mapnik lib and that recieves > - an xml for styles > - a BBox (top left bottom right srid) > - a width / heigth > - and some shapes files and/or rasters > > Inside my application I build the map with those informations using > mapnik > objects and output a map. > My application also provides a default style for rasters and that's > why the > xml is "empty". > > So I made a test with a complete xml including almost all the > parameters I > usually give to my application separately : > <?xml version="1.0"?> > <Map bgcolor="#94BAD4" buffer_size="256" srs="+proj=merc +a=6378137 > +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 > +nadgri...@null +no_defs"> > <Style name="smalltile"> > <Rule> > <RasterSymbolizer /> > </Rule> > </Style> > <Layer name="bigraster" srs="+proj=merc +a=6378137 +b=6378137 > +lat_ts=0.0 > +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgri...@null +no_defs"> > <StyleName>smalltile</StyleName> > <Datasource> > <Parameter name="type">gdal</Parameter> > <Parameter name="file">C:\temp\0.png</Parameter> > </Datasource> > </Layer> > </Map> > > This XML is the configuration to create a small tile out of my png > raster. > Tile and raster are both in png (not png256) > > The output with this XML and my application is still wrong with gdal > plugin > 0.7.0 (and still right with 0.6.1) > > The BBox of the tile is: > top : 6540563.63593437 > left : 528332.738612503 > bottom : 6535671.666125 > right : 533224.708421878 > > When I said "I build mapnik lib and plugins myself under 0.6.1 and > 0.7.0 " ; > I meant : > I used sources from svn (without a change) and built it myself under > VC++. > I did not use the windows binaries available in the mapnik web site. > (actually I tried to use them before but my application doesn't > work at all > with them) > > One last point, when I compare the gdal.input given with the win32 > binaries > and my gdal plugins I noticed a huge difference in file' size : > win32 : 3.82 Mo > mine 0.6.1 : 60 Ko > mine 0.7.0 : 84 Ko > But as my plugin in 0.6.1 works, I don't think we should care about > this > difference. > > Let me know if you need anything else. > > Thank you again for your help. > > Nicolas. > -- > View this message in context: > http://old.nabble.com/Bug-in-gdal-plugin-in-0.7.0-tp27274892p27303982.html > Sent from the Mapnik - Users mailing list archive at Nabble.com. > > _______________________________________________ > Mapnik-users mailing list > [email protected] > https://lists.berlios.de/mailman/listinfo/mapnik-users _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

