[OSM-dev] Osmosis patch for filtering ways

Brett Henderson brett at bretth.com
Thu Mar 27 12:26:16 GMT 2008


Hi Christoph,

I just checked out the patch and found something that I think we should 
fix prior to committing.

The UsedNodeFilter uses a HashSet<Long> to track the node ids.  Could 
you use a BitSetIdTracker or even better use the IdTracker interface and 
make the selection of BitSetIdTracker and ListIdTracker configurable 
with BitSetIdTracker as the default in a similar way to the bounding box 
task.  A HashSet is unlikely to scale very well to large data sets (ie. 
a planet) and will consume enormous amounts of memory very quickly.

Brett


Christoph Sommer wrote:
> Dear all,
>
> I recently needed to filter OSM data to only include motorways and trunk
> roads. Finding no easy way to achieve that in a batch run, I extended
> Osmosis to be able to filter ways and nodes to achieve this. Maybe the
> patch is of use to someone: 
> <http://www.deltadevelopment.de/users/christoph/download/sommer-wayfilter01.patch>
>
>
> Osmosis can then be run like this: 
> java -jar osmosis.jar --read-xml file="input.osm" --way-key-value
> keyValueList="highway.motorway,highway.motorway_link,highway.trunk,highway.trunk_link"
> --used-node --write-xml file="output.osm" 
>
> It will filter ways to only output those with given key.value combinations,
> then discard unused nodes. 
>
> Regards, 
>
>   Christoph
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
>   





More information about the dev mailing list