systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.5k stars 232 forks source link

How to create tiles from Shp files? #783

Closed IceSakuraAzure closed 5 days ago

IceSakuraAzure commented 5 days ago

Excuse me, I have a confusing question. I'm using an osm.pbf file for a region as a base, but don't want any osm data, so I've introduced two shp files as a data source and created two layers. But when I specify only config.json, and execute the build command, it gives me an error saying “a layer named as ‘poi_detail’ doesn't exist”. I realized that it was process.lua that was causing the problem. So I proceeded to specify resources/process-coastline.lua, but all that was generated was an almost blank mbtiles file without any tile data. Therefore, I would like to ask how should I configure it so that there is only shp file data in the tile? Here is my config.json:

{
    "layers": {
        "boundary": { "minzoom":  0, "maxzoom": 7,"source": "/srv/workspace/shp/boundary.shp", "simplify_below": 12, "simplify_level": 0.0003, "simplify_ratio": 2},
        "building": { "minzoom":  0, "maxzoom": 7,"source": "/srv/workspace/shp/building.shp", "simplify_below": 12, "simplify_level": 0.0003, "simplify_ratio": 2}
    },
    "settings": {
        "minzoom": 0,
        "maxzoom": 7,
        "basezoom": 7,
        "include_ids": false,
        "combine_below": 7,
        "name": "tofuture letter map",
        "version": "3.0",
        "description": "Tile config based on dataV geojson schema",
        "compress": "gzip",
        "filemetadata": {
            "tilejson": "2.0.0", 
            "scheme": "xyz", 
            "type": "baselayer", 
            "format": "pbf", 
            "tiles": ["https://example.com/liechtenstein/{z}/{x}/{y}.pbf"]
        }
    }
}

and this is my process.lua:

-- Enter/exit Tilemaker
function init_function()
end
function exit_function()
end

node_keys = {}
function node_function()
end

function way_function()
end

function attribute_function(attr)
    return attr
end