Updated Mapnik Output Formats (markdown)
parent
9e9fb9a27d
commit
dbe90c6441
1 changed files with 16 additions and 6 deletions
|
@ -1,8 +1,3 @@
|
|||
<!-- Name: OutputFormats -->
|
||||
<!-- Version: 10 -->
|
||||
<!-- Last-Modified: 2011/09/05 04:32:30 -->
|
||||
<!-- Author: kkaefer -->
|
||||
|
||||
# Mapnik Output Formats
|
||||
|
||||
Mapnik supports rendering with both AGG and Cairo (see [[MapnikRenderers]] for more detail), and can create maps or map tiles in a variety of formats.
|
||||
|
@ -44,8 +39,23 @@ So to use new format i.e. in python:
|
|||
or other example in c++:
|
||||
save_to_file(vw, "test.png", "png256:t=1:c=128");
|
||||
|
||||
For more details see [mapnik-devel email](http://lists.berlios.de/pipermail/mapnik-devel/2010-March/001081.html and ticket [#477](https://github.com/mapnik/mapnik/issues/477)
|
||||
## Hextree details
|
||||
The m=h (hextree) method should give more smooth images in case of
|
||||
transparent maps i.e. hybrid like overlayed on some satellite images.
|
||||
Time and file size increase or decrease depends on content and image
|
||||
size, but shouldn't be much in common situation. Octree is still the default
|
||||
for png8 because for most maps without transparent
|
||||
background or elevation colored/shaded rasters, existing method should
|
||||
give acceptable and little bit smaller files.
|
||||
|
||||
With Hextree, using less than 64-94 colors is not recommended, because returned
|
||||
palette isn't optimal then. Using 96-128 should give acceptable quality
|
||||
with some file size reduction, but probably not more then 10%-20%.
|
||||
|
||||
For more details see [mapnik-devel email](http://lists.berlios.de/pipermail/mapnik-devel/2010-March/001081.html) and ticket [#477](https://github.com/mapnik/mapnik/issues/477)
|
||||
|
||||
|
||||
## render functions
|
||||
|
||||
Most render functions like `save_to_string` also take a third argument which must be a `rgba_palette` object. You can create palettes by passing a buffer with RGBA values (4 bytes), a buffer with RGB values (3 bytes) or an Adobe Photoshop .act file (generated by the "Save for Web" dialog") with exactly 772 bytes to the `rgba_palette` constructors. Note that palette objects are mutable and contain a lookup table that cache all values ever retrieved for faster encoding.
|
||||
|
||||
|
|
Loading…
Reference in a new issue