def __init__ (self, name, mapfile = None, projection = None, fonts = None, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.mapfile = mapfile self.mapnik = None self.projection = projection if fonts: self.fonts = fonts.split(",") else: self.fonts = []
def __init__(self, name, source_srs, dest_srs, scales, **kwargs): MetaLayer.__init__(self, name, **kwargs) # Type-cast scales (if coming from tilecache config file) if isinstance(scales, basestring): scales = [float(s) for s in scales.split(',')] self.set_resolutions(scales) self.source_srs = source_srs self.dest_srs = dest_srs self.set_bbox(self.bbox)
def __init__ (self, name, url = None, off_layers = "", projection = None, **kwargs): """ Accepts projection in one of two forms: * Raw string * String beginning with @, in which case string is treated as filename """ MetaLayer.__init__(self, name, **kwargs) self.url = url self.off_layers = off_layers self.projection = None if projection is not None: if projection.startswith("@"): self.projection = open(projection[1:]).read() else: self.projection = projection
def __init__ (self, name, file = None, filebounds = "-180,-90,180,90", transparency = False, scaling = "nearest", **kwargs): import PIL.Image as PILImage MetaLayer.__init__(self, name, **kwargs) self.file = file self.filebounds = map(float,filebounds.split(",")) self.image = PILImage.open(self.file) self.image_size = self.image.size self.image_res = [(self.filebounds[2] - self.filebounds[0]) / self.image_size[0], (self.filebounds[3] - self.filebounds[1]) / self.image_size[1] ] self.scaling = scaling.lower() if isinstance(transparency, str): transparency = transparency.lower() in ("true", "yes", "1") self.transparency = transparency
def __init__(self, name, file=None, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.ds = gdal.Open(file, gdal.GA_ReadOnly) #self.geo_transform = self.ds.GetGeoTransform() # if self.geo_transform[2] != 0 or self.geo_transform[4] != 0: # raise Exception("Image is not 'north-up', can not use.") self.geo_transform = (0.0, 1.0, 0.0, self.ds.RasterYSize, 0.0, -1.0) self.image_size = [self.ds.RasterXSize, self.ds.RasterYSize] xform = self.geo_transform self.data_extent = [ xform[0] + self.ds.RasterYSize * xform[2], xform[3] + self.ds.RasterYSize * xform[5], xform[0] + self.ds.RasterXSize * xform[1], xform[3] + self.ds.RasterXSize * xform[4], ]
def __init__ (self, name, file = None, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.ds = gdal.Open(file) self.geo_transform = self.ds.GetGeoTransform() if self.geo_transform[2] != 0 or self.geo_transform[4] != 0: raise Exception("Image is not 'north-up', can not use.") if self.geo_transform == (0.0, 1.0, 0.0, 0.0, 0.0, 1.0): self.geo_transform = (0.0, 1.0, 0.0, self.ds.RasterYSize, 0.0, -1.0) size = [self.ds.RasterXSize, self.ds.RasterYSize] xform = self.geo_transform self.data_extent = [ xform[0] + self.ds.RasterYSize * xform[2], xform[3] + self.ds.RasterYSize * xform[5], xform[0] + self.ds.RasterXSize * xform[1], xform[3] + self.ds.RasterXSize * xform[4] ]
def __init__(self, name, url=None, off_layers="", projection=None, **kwargs): """ Accepts projection in one of two forms: * Raw string * String beginning with @, in which case string is treated as filename """ MetaLayer.__init__(self, name, **kwargs) self.url = url self.off_layers = off_layers self.projection = None if projection is not None: if projection.startswith("@"): self.projection = open(projection[1:]).read() else: self.projection = projection
def __init__(self, name, file=None, filebounds="-180,-90,180,90", transparency=False, scaling="nearest", **kwargs): import PIL.Image as PILImage MetaLayer.__init__(self, name, **kwargs) self.file = file self.filebounds = map(float, filebounds.split(",")) self.image = PILImage.open(self.file) self.image_size = self.image.size self.image_res = [ (self.filebounds[2] - self.filebounds[0]) / self.image_size[0], (self.filebounds[3] - self.filebounds[1]) / self.image_size[1] ] self.scaling = scaling.lower() if isinstance(transparency, str): transparency = transparency.lower() in ("true", "yes", "1") self.transparency = transparency
def __init__ (self, name, url = None, user = None, password = None, expire=0, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.url = url self.user = user self.password = password self.expire = expire
def __init__ (self, name, url = None, styles = "", user = None, password = None, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.url = url self.styles = styles self.user = user self.password = password
def __init__(self, name, url=None, user=None, password=None, **kwargs): """Constructor""" MetaLayer.__init__(self, name, **kwargs) self.url = url self.user = user self.password = password
def __init__ (self, name, display='UTM', spacing=128, tick=8, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.display = display.lower() self.spacing = int(spacing) self.tick = int(tick)
def __init__(self, name, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.client = oam.Client(username, password)
def __init__ (self, name, mapfile = None, styles = "", **kwargs): MetaLayer.__init__(self, name, **kwargs) self.mapfile = mapfile self.styles = styles
def __init__(self, name, mapfile=None, styles="", expire=0, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.mapfile = mapfile self.styles = styles self.expire = expire
def __init__ (self, name, **kwargs): MetaLayer.__init__(self, name, **kwargs) self.client = oam.Client(username, password)