Home | Trees | Indices | Help |
|
---|
|
Main class for creating PDF print outs, basically contruct an instance with appropriate options and then call render_map with your mapnik map
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Method Details |
Creates a cairo surface and context to render a PDF with. pagesize: tuple of page size in meters, see predefined sizes in pagessizes dict (default a4) margin: page margin in meters (default 0.01) box: box within the page to render the map into (will not render over margin). This should be a Mapnik Box2d object. Default is the full page within the margin percent_box: as per box, but specified as a percent (0->1) of the full page size. If both box and percent_box are specified percent_box will be used. scale: scale helper to use when rounding the map scale. This should be a function that takes a single float and returns a float which is at least as large as the value passed in. This is a 1:x scale. resolution: the resolution to render non vector elements at (in DPI), defaults to 72 DPI preserve_aspect: whether to preserve map aspect ratio. This defaults to True and it is recommended you do not change it unless you know what you are doing scales and so on will not work if this is False. centering: Centering rules for maps where the scale rounding has reduced the map size. This should be a value from the centering class. The default is to center on the maps constrained axis, typically this will be horizontal for portrait pages and vertical for landscape pages. is_latlon: Is the map in lat lon degrees. If true magic anti meridian logic is enabled use_ocg_layers: Create OCG layers in the PDF, requires pyPdf >= 1.13 |
Postprocessing step to add geospatial PDF information to PDF file as per PDF standard 1.7 extension level 3 (also in draft PDF v2 standard at time of writing) one of either the epsg code or wkt text for the projection must be provided Should be called *after* the page has had .finish() called |
m: map to render scale for ctx: A cairo context to render the scale to. If this is None (the default) then automatically create a context and choose the best location for the scale bar. width: Width of area available to render scale bar in (in m) will return the size of the rendered scale block in pts |
m: map to render legend for ctx: A cairo context to render the legend to. If this is None (the default) then automatically create a context and choose the best location for the legend. width: Width of area available to render legend in (in m) page_break: move to next page if legen over flows this one collumns: number of collumns available in legend box attribution: additional text that will be rendered in gray under the layer name. keyed by layer name legend_item_box_size: two tuple with width and height of legend item box size in meters will return the size of the rendered block in pts |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Aug 3 18:07:11 2012 | http://epydoc.sourceforge.net |