[osmosis-dev] Using osmosis as a java library

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[osmosis-dev] Using osmosis as a java library

Thomas BERNARD

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



_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev
Reply | Threaded
Open this post in threaded view
|

Re: [osmosis-dev] Using osmosis as a java library

Pascal Neis-4
Hi,

Am 30.08.17 um 23:57 schrieb Thomas BERNARD:
>
>    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...)
[...]

maybe too late, brief tutorial:
http://neis-one.org/2017/10/processing-osm-data-java/

All the best,
Pascal

_______________________________________________
osmosis-dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/osmosis-dev