[osmosis-dev] preprocessing for turn-restrictions usins an osmosis-plugin
Brett Henderson
brett at bretth.com
Wed Feb 18 21:04:05 GMT 2009
marcus.wolschon at googlemail.com wrote:
> Hello,
>
> I am planning to add a new plugin-task to osmosis
> that turns nodes with turn-restrictions into
> an equivalent graph of oneway-roads.
> This may enable routing-engines that cannot deal with
> restrictions or cost on graph-nodes to deal with
> turn-restrictions.
>
> I just think it may be usefull to others as well. ;)
>
> Brett:
> how do you think I may do this using ormosis
> architecture?
> Can a task read from an entity-stream and write
> to a DataSet that is also needs to read from and
> remove entities from?
> (Stream all nodes and ways to the DataSet,
> then process the incomming relations and change
> ways already written to the DataSet. This includes
> ways that may have been in there before osmosis started.)
>
> Marcus
>
> http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage#--induce-ways-for-turnrestrcitions_.28-iwtt.29
> http://sourceforge.net/tracker2/?func=detail&aid=2612536&group_id=203597&atid=986234
>
I haven't read the links (currently offline), so I may have missed
something.
As I understand it, you want to be able to process an entity stream and
update a database. As far as osmosis is concerned, wouldn't your task
only implement the Sink interface? The Dataset interface is only a way
of allowing multiple database implementations to be read in a common
way, it doesn't provide any mechanisms for updating a dataset so isn't
relevant here. From the osmosis point of view your task can expose the
same external interface as a MysqlWriter, but the internal
implementation performs complex database updates rather than just inserts.
The fact that your task reads and writes to the dataset doesn't need to
be exposed to the rest of osmosis. Within your task you will be
querying for existing ways/nodes while processing relations which is
probably identical to your existing dataset reading code, but that
dataset reader implementation could be instantiated directly within your
task implementation, I wouldn't think that would need to be exposed to
the rest of the pipeline in any way.
So the pipeline would be as simple as:
osmosis --read-xml myfile.osm --my-turn-restriction-task
dbConnectionDetails=xxx
Do you have reasons why this won't work or isn't desirable?
Brett
More information about the osmosis-dev
mailing list