(self)
return s
Template for tilemapresource.xml. Returns filled string. Expected variables:
          title, north, south, east, west, isepsg4326, projection, publishurl,
          zoompixels, tilesize, tileformat, profile
Template for tilemapresource.xml. Returns filled string. Expected variables:
          title, north, south, east, west, isepsg4326, projection, publishurl,
          zoompixels, tilesize, tileformat, profile
Template for tilemapresource . xml . Returns filled string . Expected variables : title north south east west isepsg4326 projection publishurl zoompixels tilesize tileformat profile
def generate_tilemapresource(self):
        """
        Template for tilemapresource.xml. Returns filled string. Expected variables:
          title, north, south, east, west, isepsg4326, projection, publishurl,
          zoompixels, tilesize, tileformat, profile
        """

        args = {}
        args['title'] = self.options.title
        (args['south'], args['west'], args['north'], args['east']) = \
            self.swne
        args['tilesize'] = self.tilesize
        args['tileformat'] = self.tileext
        args['publishurl'] = self.options.url
        args['profile'] = self.options.profile

        if self.options.profile == 'mercator':
            args['srs'] = 'EPSG:900913'
        elif self.options.profile == 'geodetic':
            args['srs'] = 'EPSG:4326'
        elif self.options.s_srs:
            args['srs'] = self.options.s_srs
        elif self.out_srs:
            args['srs'] = self.out_srs.ExportToWkt()
        else:
            args['srs'] = ''

        s = \
            """<?xml version="1.0" encoding="utf-8"?>
    <TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
      <Title>%(title)s</Title>
      <Abstract></Abstract>
      <SRS>%(srs)s</SRS>
      <BoundingBox minx="%(west).14f" miny="%(south).14f" maxx="%(east).14f" maxy="%(north).14f"/>
      <Origin x="%(west).14f" y="%(south).14f"/>
      <TileFormat width="%(tilesize)d" height="%(tilesize)d" mime-type="image/%(tileformat)s" extension="%(tileformat)s"/>
      <TileSets profile="%(profile)s">
""" \
            % args
        for z in range(self.tminz, self.tmaxz + 1):
            if self.options.profile == 'raster':
                s += \
                    """        <TileSet href="%s%d" units-per-pixel="%.14f" order="%d"/>\n""" \
                    % (args['publishurl'], z, 2 ** (self.nativezoom
                       - z) * self.out_gt[1], z)
            elif self.options.profile == 'mercator':
                s += \
                    """        <TileSet href="%s%d" units-per-pixel="%.14f" order="%d"/>\n""" \
                    % (args['publishurl'], z, 156543.0339 / 2 ** z, z)
            elif self.options.profile == 'geodetic':
                s += \
                    """        <TileSet href="%s%d" units-per-pixel="%.14f" order="%d"/>\n""" \
                    % (args['publishurl'], z, 0.703125 / 2 ** z, z)
        s += """      </TileSets>
    </TileMap>
    """
        return s
def generate_tilemapresource ( self ) : args = { } args [ 'title' ] = self . options . title ( args [ 'south' ] , args [ 'west' ] , args [ 'north' ] , args [ 'east' ] ) = self . swne args [ 'tilesize' ] = self . tilesize args [ 'tileformat' ] = self . tileext args [ 'publishurl' ] = self . options . url args [ 'profile' ] = self . options . profile if self . options . profile == 'mercator' : args [ 'srs' ] = 'EPSG:900913' elif self . options . profile == 'geodetic' : args [ 'srs' ] = 'EPSG:4326' elif self . options . s_srs : args [ 'srs' ] = self . options . s_srs elif self . out_srs : args [ 'srs' ] = self . out_srs . ExportToWkt ( ) else : args [ 'srs' ] = '' s = """<?xml version="1.0" encoding="utf-8"?>
    <TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
      <Title>%(title)s</Title>
      <Abstract></Abstract>
      <SRS>%(srs)s</SRS>
      <BoundingBox minx="%(west).14f" miny="%(south).14f" maxx="%(east).14f" maxy="%(north).14f"/>
      <Origin x="%(west).14f" y="%(south).14f"/>
      <TileFormat width="%(tilesize)d" height="%(tilesize)d" mime-type="image/%(tileformat)s" extension="%(tileformat)s"/>
      <TileSets profile="%(profile)s">
""" % args for z in range ( self . tminz , self . tmaxz + 1 ) : if self . options . profile == 'raster' : s += """        <TileSet href="%s%d" units-per-pixel="%.14f" order="%d"/>\n""" % ( args [ 'publishurl' ] , z , 2 ** ( self . nativezoom - z ) * self . out_gt [ 1 ] , z ) elif self . options . profile == 'mercator' : s += """        <TileSet href="%s%d" units-per-pixel="%.14f" order="%d"/>\n""" % ( args [ 'publishurl' ] , z , 156543.0339 / 2 ** z , z ) elif self . options . profile == 'geodetic' : s += """        <TileSet href="%s%d" units-per-pixel="%.14f" order="%d"/>\n""" % ( args [ 'publishurl' ] , z , 0.703125 / 2 ** z , z ) s += """      </TileSets>
    </TileMap>
    """ return s