コード例 #1
0
 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 = []
コード例 #2
0
ファイル: Mapnik.py プロジェクト: vovoma/geocloud2
 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 = []
コード例 #3
0
ファイル: tile.py プロジェクト: frankk00/openblock
    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)
コード例 #4
0
ファイル: tile.py プロジェクト: christaggart/openblock
    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)
コード例 #5
0
ファイル: ArcXML.py プロジェクト: ALDean/tilecache
 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
コード例 #6
0
ファイル: Image.py プロジェクト: ALDean/tilecache
 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
コード例 #7
0
    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],
        ]
コード例 #8
0
ファイル: GDAL.py プロジェクト: llerradyoh/tilecache
 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]
     ]   
コード例 #9
0
ファイル: ArcXML.py プロジェクト: wood-chris/medin-portal
 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
コード例 #10
0
    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
コード例 #11
0
ファイル: WMS.py プロジェクト: vovoma/geocloud2
 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
コード例 #12
0
ファイル: WMS.py プロジェクト: drakontas-llc/TileCache
 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
コード例 #13
0
ファイル: WMS.py プロジェクト: trentford/iem
 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
コード例 #14
0
ファイル: UTMGrid.py プロジェクト: migurski/GridTile
 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)
コード例 #15
0
ファイル: tilecache.py プロジェクト: fevzidas/oam
 def __init__(self, name, **kwargs):
     MetaLayer.__init__(self, name, **kwargs)
     self.client = oam.Client(username, password)
コード例 #16
0
ファイル: MapServer.py プロジェクト: DOE-NEPA/mapwarper
 def __init__ (self, name, mapfile = None, styles = "", **kwargs):
     MetaLayer.__init__(self, name, **kwargs) 
     self.mapfile = mapfile
     self.styles = styles
コード例 #17
0
ファイル: MapServer.py プロジェクト: vovoma/geocloud2
 def __init__(self, name, mapfile=None, styles="", expire=0, **kwargs):
     MetaLayer.__init__(self, name, **kwargs)
     self.mapfile = mapfile
     self.styles = styles
     self.expire = expire
コード例 #18
0
ファイル: tilecache.py プロジェクト: aaronr/oam
 def __init__ (self, name, **kwargs):
     MetaLayer.__init__(self, name, **kwargs) 
     self.client = oam.Client(username, password)