[OSM-dev] osm4scala v1.0 (osm pbf parser)

Marc Tobias mtm at opencagedata.com
Sun Dec 4 13:59:06 UTC 2016

[Angel Cervera Claudio is the author of the library. I'm not the
author and only copy&paste his announcement]


osm4scala v1.0

Few days ago, I released the first version of osm4scala. A library used 
to iterate easily over Open Street Map entities stored in a osm.pbf file.

I implemented a library to iterate over all entities easily, hiding all 
difficult of decoding, and with the powerful of the Scala Iterator. For 
example, to generate an iterator and count all elements of type "Node", 
it is so simple as:

EntityIterator.fromPbf(inputStream).count(_.osmModel == OSMTypes.Node)

Its performance surprised me.

For example, iterate over a the full planet data set with (near of 4,000 
millions of elements and 39GB) stored in a external USB3 drive and using 
only one thread takes only 40 minutes.

Other example is the iteration over all data of Spain: 32 seconds to 
iterate over near of 70 millions of elements

More information:

     GitHub: https://github.com/angelcervera/osm4scala

     Example: Tag extraction

     Example: Block extraction

     Example: Entities type counter

     Example: Primitives extraction

More information about the dev mailing list