Brett,<br><br>I have in the works another method to filter ways based on tag content. Cristoph's method is straightforward and simple and can be completely contained on the command line, which is nice. Mine is file-based because I plan to use the same file to control how tiling works and also how routable Garmin GPS maps are generated. With this method you could have a single rule file which could be used for all these things--filtering to select the elements you want, slicing an OSM file into tiles, then creating routable maps from those tiles.<br>
<br>I have my work-in-progress rule file format here: <a href="http://wiki.openstreetmap.org/index.php/User:SiliconFiend/Ruleset">http://wiki.openstreetmap.org/index.php/User:SiliconFiend/Ruleset</a><br>There are a few things I don't really like about it, and I'm definitely open to suggestions. I'm thinking the filter would operate on the tests in the <match> elements that are an immediate child of the <action> definition.<br>
<br>Anyway, I just wanted to make you aware of my (pending) alternate implementation when you're looking to incorporate this patch.<br><br>Thanks,<br><br>Karl<br><br><div class="gmail_quote">On Wed, Mar 26, 2008 at 5:48 AM, Brett Henderson <<a href="mailto:brett@bretth.com">brett@bretth.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Christoph,<br>
<br>
Thanks for the patch. I haven't had a chance to look at it yet but I<br>
will get to it eventually.<br>
<br>
Brett<br>
<br>
Christoph Sommer wrote:<br>
> Dear all,<br>
><br>
> I recently needed to filter OSM data to only include motorways and trunk<br>
> roads. Finding no easy way to achieve that in a batch run, I extended<br>
> Osmosis to be able to filter ways and nodes to achieve this. Maybe the<br>
> patch is of use to someone:<br>
> <<a href="http://www.deltadevelopment.de/users/christoph/download/sommer-wayfilter01.patch" target="_blank">http://www.deltadevelopment.de/users/christoph/download/sommer-wayfilter01.patch</a>><br>
><br>
><br>
> Osmosis can then be run like this:<br>
> java -jar osmosis.jar --read-xml file="input.osm" --way-key-value<br>
> keyValueList="highway.motorway,highway.motorway_link,highway.trunk,highway.trunk_link"<br>
> --used-node --write-xml file="output.osm"<br>
><br>
> It will filter ways to only output those with given key.value combinations,<br>
> then discard unused nodes.<br>
><br>
> Regards,<br>
><br>
> Christoph<br>
><br>
><br>
> _______________________________________________<br>
> dev mailing list<br>
> <a href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
> <a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev" target="_blank">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev</a><br>
><br>
<br>
<br>
_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev" target="_blank">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev</a><br>
</blockquote></div><br>