[Tile-serving] [osm2pgsql] Delete undesired tags with Lua transform (#268)
Paul Norman
notifications at github.com
Tue Jan 27 19:41:00 UTC 2015
The C tag transform can drop tags like created_by, odbl, note, source, tiger:* and others specified in the style file. The sample Lua transform, style.lua, should do the same.
The following Lua might be helpful
```lua
delete_tags = {'INT-*', 'note', 'note:*', 'source', 'source_ref', 'source:*',
'attribution', 'comment', 'fixme', 'created_by', 'odbl',
'odbl:note', 'SK53_bulk:load', 'tiger:*', 'NHD:*', 'nhd:*',
'gnis:*', 'geobase:*', 'accuracy:meters', 'sub_sea:type',
'waterway:type', 'KSJ2:*', 'yh:*', 'osak:*', 'kms:*', 'ngbe:*',
'naptan:*', 'CLC:*', '3dshapes:ggmodelk', 'AND_nosr_r',
'import', 'it:fvg:*'}
function preprocess_tags (kv)
tags = {}
for k, v in pairs (kv) do
match = false
for _, d in ipairs(delete_tags) do
match = match or string.find(k, d)
end
if not match then
tags[k] = v
end
end
end
```
It takes num tags * num deletes iterations through the loop, but does short-circuit the string.find call if it's already matched a delete.
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/268
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150127/bc348c84/attachment-0001.html>
More information about the Tile-serving
mailing list