Take a look at the code for my XAPI servlet:<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="https://github.com/iandees/xapi-servlet/blob/master/src/main/java/com/yellowbkpk/geo/xapi/servlet/XapiServlet.java">https://github.com/iandees/xapi-servlet/blob/master/src/main/java/com/yellowbkpk/geo/xapi/servlet/XapiServlet.java</a></div><div><br></div><div>There's a lot of HTTP and XAPI-related stuff in there, but the Osmosis classes are there:</div><div>Line 130 and the "makeRequestIterator()" method create a data source (querying the database)</div><div>Line 153 creates a data sink (a data output mechanism)</div><div>Line 162 and 164 process the data into the sink. (writes XML to the client)</div><div><br>On Wednesday, June 29, 2011 9:51:14 AM UTC-5, Robert Greil wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi!<p>I am currently trying to use OSMOSIS as a lib for our java project. I <br>have already checked out the svn repository and downloaded the latest <br>osmosis zip from the website. I included all *.jar found in the <br>Osmosis/lib directory as libs for our java project because of the <br>dependencies between the jars.<br>I want to use the example command line argument 'osmosis --read-pbf <br>file="data_in.osm.pbf" --bounding-box left="90" right="90" --write-xml <br>file="data_out.osm"' with direct access to the corresponding classes <br>inside the java project.<br>I think I have identified the jars I need for that:<br>osmosis-pbf-0.39.jar - command: --read-pbf file="data_in.osm.pbf"<br>osmosis-areafilter-0.39.jar - command: --bounding-box left="90" right="90"<br>osmosis-xml-0.39.jar - command: --write-xml file="data_out.osm"</p><p>I had a look inside the source code from the svn to see how to call <br>theses classes directly without using the commandline parsing and <br>pipeline and so on. I am not sure which classes are the correct ones, <br>but according to the TaskFactories I tried using these:<br>crosby.binary.osmosis.<wbr>OsmosisReader<br>org.openstreetmap.osmosis.<wbr>areafilter.v0_6.<wbr>BoundingBoxFilter<br>org.openstreetmap.osmosis.xml.<wbr>v0_6.XmlWriter.</p><p>But I am really struck on how to access them directly or how to create <br>and connect their input and outputstreams. I also do not know how to <br>call the OsmosisReader directly, because it is set to protected and <br>therefore not accessable from outside the package. I spent already hours <br>coding and failing and slowly I am feeling like I am doing it the <br>completely wrong way.</p><p>That is why I am asking here, if anybody has done something similiar in <br>the past (and point me to an example) or if anybody can give me a hint <br>in the right direction or maybe some simple code examples/snipplets.</p><p>Any help would be greatly appreciated!</p><p>Thanks,<br>Robert</p><p>______________________________<wbr>_________________<br>dev mailing list<br><a>d...@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/listinfo/dev" target="_blank">http://lists.openstreetmap.<wbr>org/listinfo/dev</a><br></p><p></p><p></p><p></p><p></p><p></p><p></p></blockquote></div>