4

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"
1
  • 2
    Are you only trying to get rid of the tags or do you want to get rid of the ways that have certain tags? You might want to lock into Osmfilter: wiki.openstreetmap.org/wiki/Osmfilter
    – ustroetz
    Commented Oct 26, 2013 at 0:03

2 Answers 2

1

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
2
  • 1
    This is not a good way. You are losing valuable information. Instead you should configure you renderer (map displayer) to nor show the arrows and name.
    – neogeomat
    Commented Aug 20, 2013 at 15:14
  • @neogeomat, perhaps you could expand your comment into an answer? Commented Apr 30, 2016 at 15:19
1

If you just want the roads (and perhaps a little more information), there is a website called https://overpass-turbo.eu/ which helps build queries for extracting information from OSM.

To download only the street, click wizard and type highway=road. Run then export query as geoJSON and save as whatever file type you need in QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.