Home | Trees | Indices | Help |
|
---|
|
object --+ | ??.instance --+ | Layer
A Mapnik map layer.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
Class Variables | |
__instance_size__ = 64
|
|
__safe_for_unpickling__ = True
|
Properties | |
abstract Get/Set the abstract of the layer. |
|
active Get/Set whether this layer is active and will be rendered. |
|
clear_label_cache Get/Set whether this layer's labels are cached. |
|
datasource The datasource attached to this layer. |
|
maxzoom Get/Set the maximum zoom lever of the layer. |
|
minzoom Get/Set the minimum zoom lever of the layer. |
|
name Get/Set the name of the layer. |
|
queryable Get/Set whether this layer is queryable. |
|
srs Get/Set the SRS of the layer. |
|
styles The styles list attached to this layer. |
|
title Get/Set the title of the layer. |
|
Inherited from |
Method Details |
__getinitargs__( (Layer)arg1) -> tuple : C++ signature : boost::python::tuple __getinitargs__(mapnik::Layer) |
__getstate__( (Layer)arg1) -> tuple : C++ signature : boost::python::tuple __getstate__(mapnik::Layer) |
__init__( (object)arg1, (str)arg2 [, (str)arg3]) -> None : Create a Layer with a named string and, optionally, an srs string. The srs can be either a Proj.4 epsg code ('+init=epsg:<code>') or of a Proj.4 literal ('+proj=<literal>'). If no srs is specified it will default to '+proj=latlong +datum=WGS84' Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr <mapnik._mapnik.Layer object at 0x6a270> C++ signature : void __init__(_object*,std::string [,std::string])
|
helper for pickle
|
__setstate__( (Layer)arg1, (tuple)arg2) -> None : C++ signature : void __setstate__(mapnik::Layer {lvalue},boost::python::tuple) |
envelope( (Layer)arg1) -> Envelope : Return the geographic envelope/bounding box. Determined based on the layer datasource. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.envelope() Envelope(-1.0,-1.0,0.0,0.0) # default until a datasource is loaded C++ signature : mapnik::Envelope<double> envelope(mapnik::Layer {lvalue}) |
visible( (Layer)arg1, (float)arg2) -> bool : Return True if this layer's data is active and visible at a given scale. Otherwise returns False. Accepts a scale value as an integer or float input. Will return False if: scale >= minzoom - 1e-6 or: scale < maxzoom + 1e-6 Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.visible(1.0/1000000) True >>> lyr.active = False >>> lyr.visible(1.0/1000000) False C++ signature : bool visible(mapnik::Layer {lvalue},double) |
Property Details |
abstractGet/Set the abstract of the layer. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.abstract '' # default is en empty string >>> lyr.abstract = 'My Shapefile rendered with Mapnik' >>> lyr.abstract 'My Shapefile rendered with Mapnik'
|
activeGet/Set whether this layer is active and will be rendered. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.active True # Active by default >>> lyr.active = False # set False to disable layer rendering >>> lyr.active False
|
clear_label_cacheGet/Set whether this layer's labels are cached. Usage: TODO
|
datasourceThe datasource attached to this layer. Usage: >>> from mapnik import Layer, Datasource >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.datasource = Datasource(type='shape',file='world_borders') >>> lyr.datasource <mapnik.Datasource object at 0x65470>
|
maxzoomGet/Set the maximum zoom lever of the layer. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.maxzoom 1.7976931348623157e+308 # default is the numerical maximum >>> lyr.maxzoom = 1.0/1000000 >>> lyr.maxzoom 9.9999999999999995e-07
|
minzoomGet/Set the minimum zoom lever of the layer. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.minzoom # default is 0 0.0 >>> lyr.minzoom = 1.0/1000000 >>> lyr.minzoom 9.9999999999999995e-07
|
nameGet/Set the name of the layer. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.name 'My Layer' >>> lyr.name = 'New Name' >>> lyr.name 'New Name'
|
queryableGet/Set whether this layer is queryable. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.queryable False # Not queryable by default >>> lyr.queryable = True >>> lyr.queryable True
|
srsGet/Set the SRS of the layer. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.srs '+proj=latlong +datum=WGS84' # The default srs if not initialized with custom srs >>> # set to google mercator with Proj.4 literal ... >>> lyr.srs = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over'
|
stylesThe styles list attached to this layer. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.styles <mapnik._mapnik.Names object at 0x6d3e8> >>> len(lyr.styles) 0 # no styles until you append them lyr.styles.append('My Style') # mapnik uses named styles for flexibility >>> len(lyr.styles) 1 >>> lyr.styles[0] 'My Style'
|
titleGet/Set the title of the layer. Usage: >>> from mapnik import Layer >>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84') >>> lyr.title '' >>> lyr.title = 'My first layer' >>> lyr.title 'My first layer'
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Nov 8 09:00:50 2009 | http://epydoc.sourceforge.net |