2 Star 1 Fork 1

ten2net/tilemaker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
process.lua 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
Tim Sheerman-Chase 提交于 2017-06-27 09:20 +08:00 . Version with some roads
-- Nodes will only be processed if one of these keys is present
node_keys = { "amenity", "shop" }
-- Initialize Lua logic
function init_function()
end
-- Finalize Lua logic()
function exit_function()
end
-- Assign nodes to a layer, and set attributes, based on OSM tags
function node_function(node)
local amenity = node:Find("amenity")
local shop = node:Find("shop")
if amenity~="" or shop~="" then
node:Layer("poi", false)
if amenity~="" then node:Attribute("class",amenity)
else node:Attribute("class",shop) end
node:Attribute("name", node:Find("name"))
end
end
-- Similarly for ways
function way_function(way)
local highway = way:Find("highway")
local waterway = way:Find("waterway")
local building = way:Find("building")
if highway~="" then
way:Layer("transportation", false)
way:Attribute("class", highway)
-- way:Attribute("id",way:Id())
-- way:AttributeNumeric("area",37)
end
if waterway~="" then
way:Layer("waterway", false)
way:Attribute("class", waterway)
end
if building~="" then
way:Layer("building", true)
end
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gdsten2net/tilemaker.git
git@gitee.com:gdsten2net/tilemaker.git
gdsten2net
tilemaker
tilemaker
master

搜索帮助