[OSM-dev] Find a shortest path with OSMOSIS API (Traveling Salesman)

Oleg Demchenko oleg.demchenko at gmail.com
Sun Jun 20 17:30:22 BST 2010


Hi Dear All.

I'm quite new in OSM area and hope somebody of you will point me a proper
direction.

I'm developing a server side Java method  which should estimate shortest
vehicle path between any 2 points placed within 1 country.

On the first stage I've downloaded country shape file from CloudsMade,
import it into PostgreSQL database, load it into GEOTolls graph converting
features into LineString and intersect them each other afterwards.
DijsktraShortestPathFinder from GeoTools was not efficient enough. It was
good to calculate path up to 10 000 Lines loaded, but for more lines
(longest distance) it was not able to get a path between nodes. Moreover for
the all country lines loaded (around 1 mln) graph wasn't "able" connect any
nodes each other.

Later on I was advised I did a wrong job, and I should import OSM format
file to PostgreSQL. It contains ways, nodes and relations between them and
it is possible to build a graph directly from OSMOSIS file (database).

Well I've loaded denmark.osm.highway.bz2 to my PostgreSQL db with OSMOSIS
API 6.0 configured in advance. Now I have ways, nodes, relation and other
table filled with data.

Question is how is build graph in Java and find way between nodes and it
details? My understanding is Traveling Salesman with Route class should help
me
http://sourceforge.net/apps/mediawiki/travelingsales/index.php?title=TS/Examples

Question is how to load data within Java application to TS dataset? From
dataset types
http://sourceforge.net/apps/mediawiki/travelingsales/index.php?title=ExtensionPoints/IDataSet
I
can't find any to load from PostfreSQL?
Any ideas? Or I should load OSM file from a local file system somehow?
Please,  advise.

Or I don't need Traveling Salesman library to find a shortest path with
OSMOSIS data?


-- 
All the best
              Oleg Demchenko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20100620/6bc11321/attachment.html>


More information about the dev mailing list