Re: [osmosis-dev] Example code for PBF reading

2014-04-15 Thread Brett Henderson
On 19 March 2014 06:44, Peter K peat...@yahoo.de wrote:

 Osmosis just uses this library, right?

 I mean, it is a nicely packaged version of LGPLed OSM-binary:
 https://github.com/openstreetmap/osmosis/tree/master/osmosis-osm-binary

 Use it in maven via:
 dependency
 groupIdorg.openstreetmap.osmosis/groupId
 artifactIdosmosis-osm-binary/artifactId
 version0.43.1/version
 /dependency

 Yes, Osmosis uses that.  But there's a little bit more to the story which
might be useful.

The osmosis-osm-binary project contains two pieces of code:

   - Auto-generated data model classes created by the protobuf protoc
   compiler.
   - Scott's common decoding logic that he designed to be shared by other
   projects outside of Osmosis.

Osmosis itself has two separate PBF decoders, one in its osmosis-pbf
project (--read-pbf task) and one in its osmosis-pbf2 project
(--read-pbf-fast task).  The osmosis-pbf project is Scott Crosby's original
implementation, and the osmosis-pbf2 project is my re-write which supports
decoding blocks using multiple threads to improve performance.

The osmosis-pbf project utilises all of the osmosis-osm-binary project and
only adds the Osmosis task code on top.  The osmosis-pbf2 project only
utilises the auto-generated protobuf classes and is an end-to-end decoding
implementation.

Finally, the osmosis-osm-binary project is not exactly Scott's original
code.  The original code is at https://github.com/scrosby/OSM-binary.  The
Osmosis version is mostly identical but modifies the package names to fit
within the osmosis namespace and avoid any conflicts with other builds of
the same code.  I did this so that I could publish to Maven Central without
fear of conflicts.

In summary, you have the choice of two independent implementations of a PBF
decoder, and both are available via Maven Central.  The osmosis-pbf2
implementation is more Osmosis specific, however it should be possible to
invoke the PbfReader class outside of the Osmosis pipeline as it performs
all of its thread management internally.
___
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osmosis-dev


Re: [osmosis-dev] Example code for PBF reading

2014-03-18 Thread Jochen Topf
On Di, Mär 18, 2014 at 01:29:57 -0600, Martijn van Exel wrote:
 Are there any examples known to you that use the osmosis code in
 another project? I am specifically interested in using the PBF reading
 code. Or is there perhaps an easier way to add OSM PBF reading to my
 own (Java) project?

There is some example PBF reading code in the OSM-binary repository
https://github.com/scrosby/OSM-binary/blob/master/src.java/crosby/binary/test/ReadFileExample.java

Also I think mkgmap (http://www.mkgmap.org.uk/) has its own PBF reading
code based on OSM-binary.

How good those implementations are, I don't know. Reading PBF files is not so
simple, there are undocumented details that can trip you up. So using either of
these might be more difficult than with Osmosis.

Jochen
-- 
Jochen Topf  joc...@remote.org  http://www.jochentopf.com/  +49-721-388298

___
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osmosis-dev


Re: [osmosis-dev] Example code for PBF reading

2014-03-18 Thread Peter K
Osmosis just uses this library, right?

I mean, it is a nicely packaged version of LGPLed OSM-binary:
https://github.com/openstreetmap/osmosis/tree/master/osmosis-osm-binary

Use it in maven via:
dependency
groupIdorg.openstreetmap.osmosis/groupId
artifactIdosmosis-osm-binary/artifactId
version0.43.1/version
/dependency

Regards,
Peter.

 On Di, Mär 18, 2014 at 01:29:57 -0600, Martijn van Exel wrote:
 Are there any examples known to you that use the osmosis code in
 another project? I am specifically interested in using the PBF reading
 code. Or is there perhaps an easier way to add OSM PBF reading to my
 own (Java) project?
 There is some example PBF reading code in the OSM-binary repository
 https://github.com/scrosby/OSM-binary/blob/master/src.java/crosby/binary/test/ReadFileExample.java

 Also I think mkgmap (http://www.mkgmap.org.uk/) has its own PBF reading
 code based on OSM-binary.

 How good those implementations are, I don't know. Reading PBF files is not so
 simple, there are undocumented details that can trip you up. So using either 
 of
 these might be more difficult than with Osmosis.

 Jochen


-- 
GraphHopper.com - Fast  Flexible Road Routing


___
osmosis-dev mailing list
osmosis-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osmosis-dev