Beispiel #1
0
        elif format in ('PNG'):
            content = self.content

        else:
            raise KnownUnknown(
                'FourSquare response only saves .png, .json, and .geojson tiles, not "%s"'
                % format)

        #
        # Encode
        #
        if format in ('GeoJSON'):
            #indent = self.verbose and 2 or None
            indent = 2

            encoded = JSONEncoder(indent=indent).iterencode(content)
            out.write(encoded)

        elif format in ('JSON'):
            out.write(content)

        elif format in ('PNG'):
            out.write(content)


if __name__ == '__main__':
    p = Provider(None)

    #This is done in an odd order where the Zoom is last
    p.renderTile(256, 256, '', Coordinate(3, 2, 3)).save('out.png')
            #else:
            #    del content['crs']

        elif format in ('PNG'):
            content = self.content
        
        else:
            raise KnownUnknown('FourSquare response only saves .png, .json, and .geojson tiles, not "%s"' % format)

        #
        # Encode
        #
        if format in ('GeoJSON'):
            #indent = self.verbose and 2 or None
            indent = 2
            
            encoded = JSONEncoder(indent=indent).iterencode(content)
            out.write(encoded)

        elif format in ('JSON'):
            out.write(content)

        elif format in ('PNG'):
            out.write(content)
    
if __name__ == '__main__':
    p = Provider(None)
            
    #This is done in an odd order where the Zoom is last
    p.renderTile(256, 256, '', Coordinate(3, 2, 3)).save('out.png')