In message <[EMAIL PROTECTED]>
"Matt Hanson" <[EMAIL PROTECTED]> wrote:
> I looked more into this. Mapnik utilizes plugins for input which creates
> a problem because there's no direct interface to the GDAL plugin. When you
> open a GDAL file in Mapnik it goes through each band and checks the
> GDALColorIntrep field for each RasterBand. If it finds a band set to each
> of red/green/blue then you'll get an RGB band. If even one is missing
> you'll get a grayscale image. Note that if color info is not set the
> grayscale band used for rendering will always be the last band in the file.
> It's during this time that the data is actually read in for these bands, so
> there's no hope for setting color bands in styles as at that point it's too
> late. I also noted that the entire datafile is read in for the bands on
> open, the GDAL file handle is not kept around, simply read in and then
> ditched. I don't think this is all that desirable because you are reading
> in the file at full resolution (what if you have a 10Kx10K raster?) and
> only downsized later during the rendering process.
I can't pretend to understand most of this because I don't know anything
about GDAL but I don't see why the fact that a plugin is used should have
any effect on anything.
As far as repeated reopening of the file goes, the solution is probably
just some sort of pool/cache in the plugin much as the postgis plugin
does for database connections.
> I think this is an inherent problem in Mapnik's design because it greatly
> reduces its flexibility and has introduced some serious limitations. I'm
> not sure the plugin method is the best approach especially with the
> existence of the GDAL/OGR library there isn't a need for other plugins.
> The plugin design should be replaced simply with a fixed dependency on
> GDAL/OGR. After all GDAL fairly easily supports addition of custom formats
> so adding a format to GDAL would extend to Mapnik.
That would be a rather radical design change...
> I'd like to do this but it'd likely be a large job and difficult due to the
> general lack of documentation and comments.
I would suggest that you would want to get Artem's agreement before
starting on such a project - there doesn't seem to be much point if
he has good reasons for the current architecture.
For what it's worth it sounds to me like the real solution to your
problem is an extension to the RasterSymbolizer to allow a colour
to be specified to override that which comes from the source raster
data. That's if I've understood the problem correctly.
To be honest I think mapnik's real target is rendering of vector
data, which may be why the support for raster data is quite limited.
Tom
--
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users