[GIS] How to manage the osmosis filters

openstreetmaposmosis

I am a complete beginner in OSM and osmosis, and I am trying to build a stripped down version of a local map, in order to add nodes of public lights that would be used for maintenance. I have used the following command line in order to keep only streets and roads, but there are still plenty of one way signs (arrows) cluttering the narrow streets in the center of the village, and I would like to get rid of them. I could not find any way to eliminate them (or to make them invisible in the output) I am also trying to get rid of the names of the streets, since most tend to consume too much space in some areas where I will need to add nodes.

osmosis --read-xml file="Source-Map.osm.xml" --tag-filter accept-ways highway=* --tag-filter reject-ways highway=track --tag-filter reject-nodes highway=bus_stop --tag-filter reject-nodes highway=one_way --tag-filter reject-nodes barrier=* --tag-filter reject-nodes highway=untagged --tag-filter reject-relations --used-node --write-xml file="FilteredMap.osm"

Best Answer

I have finally found that the job could be done by deleting from the xml file all the following lines:

<tag k="oneway" v="yes"/>

There are still a few arrows left in the roundabouts, different and curved. They are not a problem anyway for visibility of other items. I have done this by piping the data stream, immediately after downloading, applying the osmosis filters afterwards with:

sed '/<tag k="oneway" v="yes"/d'

The complete command (including a final conversion into svg format) was:

curl http://api.openstreetmap.org/api/0.6/map?bbox=1.98,49.145,1.992,49.15
| sed '/<tag k="oneway" v="yes"/d' 
| osmosis --read-xml file=- 
--tag-filter accept-ways highway=* --tag-filter reject-ways highway=track 
--tag-filter reject-nodes highway=bus_stop 
--tag-filter reject-nodes highway=one_way 
--tag-filter reject-nodes barrier=* 
--tag-filter reject-nodes highway=untagged 
--tag-filter reject-relations --used-node --write-xml file=- 
| xsltproc osm-map-features-z17.xml - > SimpleMap.svg