
On Mon, Nov 28, 2011 at 12:45:30AM +0100, Olaf Hasemann wrote:
#def and #undef is IMO not so useful at all, cause you allways are able to prevent the execution of a rule by catching the element within another rule given before the rule you want to 'undef'.
You are right, the #undef would merely allow the OSM parser to drop uninteresting tags (saving memory). For a relatively rare tag, such as power=line, this should not make much difference. For more widely-used tags, you would probably be better off omitting the include/source/base-style for the tags you are not interested in.
Allowing an empty element type definition or a keyword 'next' or 'abort_element' comparable to the awk script 'next' statement would help much more keeping the style files simple and readable. Example:
highway=residential & mynamespace:not_usable=yes [ next ]
To my knowledge, this has not been implemented. I am not entirely convinced of the usefulness. This should be fairly easy to implement, basically replace the convertNode(), convertWay() calls with a no-op when the keyword is present. The [] stuff is parsed in osmstyle/TypeReader.java. Maybe we could simply have a special flag in GType that tells to omit the conversion in convertWay(), convertNode() and the like? Marko