Re: [Geotools-gt2-users] Splitting LineStrings at their intersection for DijkstraShortestPathFinder

2010-06-20 Thread Oleg Demchenko
Dear Jan.
Thank you for you reply.
I've downloaded denmark.osm.highway.bz2 (data exactly I'm looking for) and
imported it into PostgreSQL db configured to API v.6.0 Now I have ways,
nodes, relatins, etc, there...

Could you point me please, how to build a graph now in Java app(I didn't
find a command for OSMOSIS to build a graph) and find a shortest route?

Did you mentioned Traveling SalesMan library and Route interface? (
http://sourceforge.net/apps/mediawiki/travelingsales/index.php?title=TS/Examples

2010/6/17 Jan Torben Heuer jan_key67...@jtheuer.de

 Oleg Demchenko wrote:

  Well, there are RegionName.osm.bz2 and RegionName.highway.bz2
  available for each region/country on CloudsMade.
  I've loaded it to my postGIS DB wiith osm2pgsql Utility. File *

 I took the OSMOSIS importer. It creates graphs.

 Jan

 P.S. Please only reply to list, not to my email address.
 --
  From address is valid until 01.06.2011



 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Geotools-gt2-users mailing list
 Geotools-gt2-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users




-- 
All the best
  Oleg Demchenko
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Splitting LineStrings at their intersection for DijkstraShortestPathFinder

2010-06-17 Thread Oleg Demchenko
2010/6/16 Jan Torben Heuer jan_key67...@jtheuer.de

 Oleg Demchenko wrote:

  Data is given from a Denmark OSM highway shapefile downloaded from public
  CloudsMade server. In order to optimize process I'm selecting from
  database

 If you use the OSM data, why don't you download their nodes and ways
 directly instead of using the generated shapefile and try to reconstruct
 the
 graph based on intersections? You'll end up as Geisterfahrer on the
 Autobahn
 ;-)


Thank for your reply Jan.
Yes, I'm guite new on GeoTools and OSM data formats Autobahn :-))
Sorry,  in advance for my next questions.

Well, there are RegionName.osm.bz2 and RegionName.highway.bz2 available
for each region/country on CloudsMade.
I've loaded it to my postGIS DB wiith osm2pgsql Utility. File *
planet_osm_roads* was created. Does this file (field waygeometry) contains
in MultiLineString nodes and ways you've mentioned in you post above?



 Jan
 --
 From address is valid until 01.06.2011



 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Geotools-gt2-users mailing list
 Geotools-gt2-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users




-- 
All the best
  Oleg Demchenko
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Splitting LineStrings at their intersection for DijkstraShortestPathFinder

2010-06-17 Thread Oleg Demchenko
Hi Jody.

I'm using DirectedLineStringGraphGenerator to build a Directed Graph from
VectorLineString.
...

   //create a linear graph generate
   DirectedLineStringGraphGenerator lineStringGen =
new   DirectedLineStringGraphGenerator();
   for (int i = 0; i  lines.size(); ++i) {
   lineStringGen.add((LineString) lines.get(i));
   }
   DirectedGraph g= lineStringGen.getGraph();

Also there is example from GEOTools documentation which use
FeatureGraphGenerator wrapper
*// get a feature collection somehow
FeatureCollection fCollection = featureSource.getFeatures(Filter.INCLUDE);
FeatureIterator featureIterator = fCollection.features();

//create a linear graph generate
LineStringGraphGenerator lineStringGen = new LineStringGraphGenerator();*
*//wrap it in a feature graph generator
FeatureGraphGenerator featureGen = new FeatureGraphGenerator( lineStringGen
);*
*//throw all the features into the graph generator
Iterator iter = fCollection.iterator();
while(iter.hasNext()){
 Feature feature = (Feature)iter.next();
 featureGen.add( feature );
}*
*Graph g = featureGen.getGraph()
*
Please, advice what is class name of the builder which may help me to build
a well connected graph from a line segments?


2010/6/17 Jody Garnett jody.garn...@gmail.com

 There is also a seperate builder that builds a graph based on the line
 segmenets; perhaps you could combine the two ideas in your own graph builder
 and contribute the result back/

 Jody

   On 16/06/2010, at 8:08 PM, Oleg Demchenko wrote:

   Hi Dear All.

 I'm quite new in Geotools 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.

 Data is given from a Denmark OSM highway shapefile downloaded from public
 CloudsMade server. In order to optimize process I'm selecting from database
 features (lines) placed within a rectangle between start and end points.
 Usually it is 1500- 10 000 of LineString objects.

 From geotools-gt2-users mail archive I've learnt that lines MUST be
 intersected each other otherwise DijkstraShortestPathFinder will not return
 any path between given source and destination nodes for a Directed graph
 built from a lines array.
 There is mailing initiated by Cris  (
 http://www.mail-archive.com/geotools-gt2-users@lists.sourceforge.net/msg04520.html)
 regarding splitlines function. I'm using last function version published by
 Cris  Jan 2008 (please find it at the end of the mail), but after days of
 debug found it over optimized.

 Usually it is only double number of lines from input VectorLineString.
 For 1500 lines it built less then 3000 of intersected lines. As an
 Impact DijkstraShortestPathFinder can't find a path for the most
 source/destination points distanced more then 40 Kms each other, because
 Graph is not well connected.

 Could somebody point me, please,  on the source where I could find good
 intersection method for VectorLineString using Quadtree?

 How I can check that Graph is well partitioned and most of nodes are
 connected each other?

 Thank you in advance for your reply.



-- 
All the best
  Oleg Demchenko
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Splitting LineStrings at their intersection for DijkstraShortestPathFinder

2010-06-16 Thread Oleg Demchenko
());
l1_sub.add(l1a);
c = new Coordinate[]{p.getCoordinate(),
(l1part.getEndPoint()).getCoordinate()};
LineString l1b = new LineString(new
CoordinateArraySequence(c), new GeometryFactory());
l1_sub.add(l1b);
}
}
} catch (Exception e) {
}
}
}
// Update l1 in spatial index
index.remove(l1.getEnvelopeInternal(), l1);
for(int k=0; kl1_sub.size(); ++k) {
LineString l = (LineString)l1_sub.get(k);
index.insert(l.getEnvelopeInternal(), l);
}
}
return new VectorLineString(index.queryAll());
}

*--
All the best
  Oleg Demchenko
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users