Open winsento opened 6 years ago
After last update 3.0.20 i get this error. Ping @talaj @flippmoke
There is no such option as
<Parameter name="band">auto</Parameter>
The band
parameter needs to be an integer - band number. It should give some sensible error however.
My only idea now is that some regression happened after the changes with overviews.
Can you offer the raster.tif
file so I can reproduce it easily?
@talaj here archive with geotif and python script (138Mb) https://drive.google.com/open?id=1wF84PnNM8Tud6NvfCpY44eEkvU0_w_j3
UPD:
<Parameter name="band">-1</Parameter>
RuntimeError not show.Thank you @winsento. I'm able to reproduce it now.
I've found and fixed the problem in https://github.com/mapycz/mapnik/commit/9a57592d7ba19686ea1a72d143fa675742a51d75. I haven't made a pull request to Mapnik yet as it needs some test coverage.
@winsento, can you build it with this patch yourself or should I try to merge it into Mapnik asap?
@talaj oh cool. I'll try to build and test.
@talaj it became better, but not completely fixed and rasters on small zoom became cloudy (before was sharp).
OK, I now noticed that the tiff is being reprojected "on the fly". I think I'm able to reproduce it:
Output seems fine when I reprojected the tiff to the Mercator by GDAL prior to rendering, including overviews:
@talaj yes the tiff reprojected "on the fly" from EPSG:4326
to EPSG:3857
. If something else is needed you for the tests - let me know.
@winsento, I hopefully figured it out finally. Please, cherry-pick additional commits from https://github.com/mapycz/mapnik/commits/fix-overviews.
@talaj cool. I'm going to try now.
@talaj i confirm now everything is ok.
Great, I will try to merge it to Mapnik.
@talaj Excellent. when I'm will be in the Czech republic, pint's on me)
@winsento, fine, looking forward!
It would be also great reward if you can offer that tiff file as a test case for Mapnik. In much smaller resolution or a part of it.
@talaj maybe for not increase the amount of test data, to the existing geotiff (in test data) add overview via gdaladdo (http://www.gdal.org/gdaladdo.html)?
@winsento, you are right, that will be better.
GDALDataset::GetRasterBand(4) - Illegal band Nir = data.GetRasterBand(4).ReadAsArray().astype(np.float32) # near infrared AttributeError: 'NoneType' object has no attribute 'ReadAsArray'
There are several problems when rendering an image:
On version mapnik=3.0.13 and python-mapnik=3.0.x - all OK. Tested on Mac and Ubuntu.
Code example: