[osmosis-dev] Using osmosis as a java library

Thomas BERNARD ramsestom at yahoo.fr
Wed Aug 30 21:57:52 UTC 2017


Hello.

   I would like to use osmosis directly as a lib into a java 
application. Unfortunately, there is no documentation whatsoever on how 
to do so. What I would like to do is to extract some ways from an osm 
pbf file based on some set of tags (like all "highways" of the tpe 
"motorway" or "trunk" for example), process these ways with my custom 
piece of java code (to add or remove some properties, split them in some 
cses...) and then store these modified ways and their associated nodes 
into a Postgresql database. But my problem is that I couldn't find:

- how to read a pbf file (given a java.io.File object)

- how is osmosis handeling nodes cache (when the "--used-nodes" option 
is used in command line mode, do osmosis actually store a cache of nodes 
already parsed somewhere or do it need to read the osm file once again 
to filter them based on the ways (or relations) filtered out?)

If someone knows the osmosis source code well enough to help me with 
this, it would be really nice ;)

Thanks

     Thomas


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20170830/3ac27033/attachment.html>


More information about the osmosis-dev mailing list