Dear Marcus.
Yes, I've mixed in my understanding H2 format database and OSM bin. Sorry
:-(
Now it is OK and I'm loading data with  OsmBinDataSetV10 to my application.
It is MUCH faster (15-20 seconds less) then read data to memory dataset from
OSM file directly.

I have more specific question about TurnRestrictedMultiTargetDijkstraRouter
class. My understating it is more advanced router from
org.openstreetmap.travelingsalesman.routing.routers Problem is for some
Target/Single nodes selected with .GetNearestNode method distanced each
other 15-20 Kms route method get a "dead" loop. Even after 20 minutes it
continue calculates something ( I see it from console). From other side if I
change Start or Target coordinates a little bit, route method could be
completed successfully after 10-15 secs.

I'm using the following code with TS 1.0.3. RC1 version:

File dbDir = *new* File("C:\\temp\\osm_export");

OsmBinDataSetV10 map = *new* OsmBinDataSetV10(dbDir);

LatLon startCoord = *new* LatLon(TESTSTARTLAT, TESTSTARTLON);

Node StartNode=*null*;

*double* dist = 0.0;

StartNode = map.getNearestNode(startCoord, *new* Motorcar());

Node targetNode=*null*;

LatLon targetCoord = *new* LatLon(TESTENDLAT, TESTENDLON );

GetMeterDistance(targetCoord, targetCoord);

targetNode = map.getNearestNode(targetCoord, *new* Motorcar());

router = *new* TurnRestrictedMultiTargetDijkstraRouter();

Route theRoute = router.route(map, targetNode, StartNode, *new* Motorcar());

Taking into account find ANY car route between to points is on top priority
for my application comparing with other options (find a best way using one
turn-restrictions (etc) I have the following questions

1) Does TurnRestrictedMultiTargetDijkstraRouter is suitable for my case ( I
believe Yes:-))

2) Shall I pass to route method collection of Target nodes instead of single
node? How to find this collection? getNearestNode()returns a single node.

3) It is possible to ask route method after N seconds of processing: well,
give me actual best path you've found for this moment. I see
addProgressListener
for this class.

4) Any links on source examples to find how last
TurnRestrictedMultiTargetDijkstraRouter is working? Link
http://travelingales.sourceforge.net/ts.jnlp from
http://sourceforge.net/apps/phpbb/travelingsales/viewtopic.php?f=3&t=46&p=138
page
is broken.



>From my side I'm ready to prepare a document like "How to find optimal
car/vehicle/pedestrian  path with TurnRestrictedMultiTargetDijkstraRouter?"
with a concept and source code example when explore it with myself.




2010/6/29 Marcus Wolschon <[email protected]>

>  -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 28.06.2010 22:55, schrieb Oleg Demchenko:
>
> > I've met some difficulties to "load" data into H2DataSet from
> > Traveling Salesman io class. Well, preliminary I've imported it
> > from XML OSM file using OSMOSIS with OSMLIB plugin and
> > --write-osmbin-0.6 option to local directory, There are the
> > following files within dir C:\temp\osm_export:
> ...
>
> > : Unable to establish a database connection to
> > 'jdbc:h2:C:\temp\osm_export'.
> >
> > Caused by:
> >
> > _org.h2.jdbc.JdbcSQLException_: Unsupported database file version
> > or invalid file header in file "C:\temp\osm_export.h2.db"
> > [90048-126]
>
> Why are you trying to read a map in Osmbin-format in H2-format?
> These are 2 different database-formats.
>



>
> _______________________________________________
> Routing mailing list
> [email protected]
> http://lists.openstreetmap.org/listinfo/routing
>
>


-- 
All the best
              Oleg Demchenko
_______________________________________________
Routing mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/routing

Reply via email to