[osmosis-dev] WayKeyFilter

Peter Körner osm-lists at mazdermind.de
Thu Nov 19 14:20:54 GMT 2009


> should entities belonging to entity types not being  
> filtered be passed through or thrown away? 

This is how I'd like it from the user perspective

remove all nodes
   osmosis \
    --read-xml in.xml \
    --exclude node \
    --write-xml out.xml

keep only ways
   osmosis \
    --read-xml in.xml \
    --include way \
    --write-xml out.xml

keep only ways and their nodes ( thus removing all nodes not in a way)
   osmosis \
    --read-xml in.xml \
    --include way-with-nodes \
    --write-xml out.xml

keep only highways and their nodes
   osmosis \
    --read-xml in.xml \
    --include way-with-nodes highway=* \
    --write-xml out.xml

keep only trunks and their nodes
   osmosis \
    --read-xml in.xml \
    --include way-with-nodes highway=trunk \
    --write-xml out.xml

keep only countries and islands
   osmosis \
    --read-xml in.xml \
    --include node place=country place=island \
    --write-xml out.xml

keep only nodes but no countries or islands
   osmosis \
    --read-xml in.xml \
    --include node
    --exclude node place=country place=island \
    --write-xml out.xml



Some sugar would be if we could have the CSS3 attribute selectors:
http://www.w3.org/TR/css3-selectors/#attribute-representation
http://www.w3.org/TR/css3-selectors/#attribute-substrings
e.g.

   --include node place=city is_in~=europe
which would include all cities that got europe in their is_in list

or

   --include way-with-nodes highway^=trunk
which would include all ways with a highway-tag that starts with trunk


Peter




More information about the osmosis-dev mailing list