[osmosis-dev] Informations about osmosis
brett at bretth.com
Wed Jan 27 12:55:10 GMT 2010
On Wed, Jan 27, 2010 at 10:43 PM, sorel <johann.sorel at geomatys.fr> wrote:
> The main reason I see to split osmosis in modules is to achieve a
> separation of tasks for
> a better integration in third party application/library.
How does a single jar prevent integration into other apps/libraries?
> My current work is to write the code to read/write osm files and
> communicate with the server in geotoolkit.
> I see osmosis has most of the functional code for thoses purposes so it
> would be a waste of effort
> to duplicate everything.
> Actualy osmosis is the only java library that we can potentialy rely on, in
> fact the geotoolkit library is under LGPL
> and JOSM or the salesman-traveler application dont have a compatible
> license (GPL) nor a functional maven build.
It used to be GPL, so you're lucky there ;-)
As for the maven build, it's a bit experimental at the moment and the ant
build is still the standard way of building it. But it appears to work so
will hopefully work for you as well.
> Our objective is to be able to acces OSM datas with normalized data models
> like ISO 19109 (Feature), ISO 19107 (Geometry)
> GML, WFS, WMS and so on ... we already have all this, reprojection,
> rendering engines, styling (SLD / SE) ...
> We just lack the "connection" part to OSM datas :).
Okay, sounds great.
> I believe there are plenty of stuff usefull in geotoolkit that could be
> used in osmosis, some exemple would be
> exporting to shapefile, gml or dynamicly generate image tiles, swing map
> viewer and editor and all stuff related to reprojection capabilities.
That sounds interesting. These aren't things that I'm able to tackle, but
perhaps others might.
> Back to the main subject :
> I hope to be able to reuse osmosis code without importing unnecessary code
> like pipelines, database exporter, command line parser
> and so one.
Again, is the problem just a size issue. Having classes you don't use isn't
a problem other than it takes up additional disk space.
I'm not opposed to the idea of breaking up the jar into smaller pieces, but
unless you have some spare time to do it yourself it's unlikely to happen
any time soon.
> By the way I can't find any java code exemples anywhere, reading/writing
> osm and so on ?
> I can only find command line exemples.
There aren't any unfortunately. While I wrote most of the code with the
idea of osmosis being used as a library, other than Travelling Salesman I'm
not aware of it happening anywhere. The current docs are focused on command
line usage as you've discovered.
If you do need code examples, the best I can suggest is to find a command on
the following wiki page that does something similar, then find the source
code for it.
To find the source code, open the TaskRegistrar class, look for the task
name you're interested in, and next to the name will be the factory that
creates the task implementation. For example to read in an xml file, use
the --read-xml example, find it in TaskRegistrar listed as "read-xml", the
factory implementation is XmlReaderFactory, and it creates a class called
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osmosis-dev