Exemplo n.º 1
0
    def transform(self, values):
        for value in values:
            polygon = loads(value['geom'])
            coordinates = polylabel(polygon['coordinates'][0])
            value['geom'] = Point(coordinates, crs={'type': 'name', 'properties': {'name': 'EPSG:3857'}})

        return values
Exemplo n.º 2
0
    def transform(self, values):
        features = []
        for value in values:
            polygon = loads(value['geom'])
            coordinates = polylabel(polygon['coordinates'][0])
            point = proj_point(Point(coordinates), 'EPSG:3857', 'EPSG:4326')
            features.append(
                Feature(geometry=point,
                        properties={'osm_ref': value['osm_way_id'] + 'w'}))

        return features