-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete undesired tags with Lua transform #268
Comments
Isn't that done here already? |
Ah, I had missed that. Kind of - there are two differences from the C transforms. The first is it uses a different list, which is easily fixed. The second is that the method used (setting specific keys to nil) doesn't work for wildcards. |
Indeed, I overlooked those wildcards. I always wonder if we shouldn't compile a huge reqex for such a case. Anyways, as you have only two cases, fullmatch and startswith, I'd probably split that in two steps, first deleting the full matches as done in the current style and then check for a match as the beginning with the double loop (although with an early |
yes - provided you don't go the tag delete code for untagged nodes. My code snippet doesn't quite work - I screwed up the patterns. |
This is outdated, we will not do any larger changes on the pgsql output. The flex output has provisions for dropping tags. |
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
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.
The text was updated successfully, but these errors were encountered: