示例#1
0
    def render_tile(self, lols, coord, format):
        buff = StringIO()

        if type(lols) is list:
            get_feature_layer = lambda l : self.get_feature_layer(l, coord, format)
            feature_layers = map(get_feature_layer, lols)
            merge(buff, feature_layers, coord, format)
        else:
            bounds = u._bounds(coord, lols.srid)
            features = self.get_features(lols, coord, bounds, format)
            encode(buff, lols.name, features, coord, bounds, format)

        return buff.getvalue()
示例#2
0
    def render_tile(self, lols, coord, format):
        buff = StringIO()

        if type(lols) is list:
            get_feature_layer = lambda l: self.get_feature_layer(
                l, coord, format)
            feature_layers = map(get_feature_layer, lols)
            merge(buff, feature_layers, coord, format)
        else:
            bounds = u._bounds(coord, lols.srid)
            features = self.get_features(lols, coord, bounds, format)
            encode(buff, lols.name, features, coord, bounds, format)

        return buff.getvalue()
示例#3
0
 def get_feature_layer(self, layer, coord, format):
     bounds = u._bounds(coord, layer.srid)
     features = self.get_features(layer, coord, bounds, format)
     return {'name': layer.name, 'features': features}
示例#4
0
 def get_feature_layer(self, layer, coord, format):
     bounds = u._bounds(coord, layer.srid)
     features = self.get_features(layer, coord, bounds, format)
     return {'name': layer.name, 'features': features}