I generate a tile from postgis. I'm trying to superimpose data from geojson. But when data is superimposed, an error occurs:

Mapnik LOG> 2018-02-12 14:33:14: feature_style_processor: Style=way_style required for layer=way_layer does not exist.

Tile is created, but without data from geojson. Here is the code I get the data from the GeoJson-file:

def _get_graph_way(self):
    s = mapnik.Style()
    r = mapnik.Rule()
    way_line = mapnik.LineSymbolizer()
    way_line.stroke = mapnik.Color('#ffffff')
    way_line.stroke_width = 4
    self.my_map.append_style('way', s)
    way_layer = mapnik.Layer('way_layer')
    ds = mapnik.GeoJSON(file="geo.json")
    way_layer.datasource = ds

This is an example of data in a GeoJson-file:

    "type": "FeatureCollection",
    "features": [
        {"id": 1,
            "type": "Feature",
            "geometry": {"type": "LineString", "coordinates": [[50.192642, 53.224538], [50.193331, 53.224360]]}, "properties": {"is_exit": true, "is_entry": true, "relations": [2, 3]}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.