Hi Chris, I would have to mock up some data and test it but I dont think the problem is the method but in the management of the data structure. The code is modifying the same list it is iterating over... which is generally not a great idea.
I recommend restructuring the algorithm so that when two new lines are created they are added to a separate list. When the outer loop termines add the new lines to the original list and repeat the algorithm terminating when there are no more new lines. Hope that helps. I could be wrong as i said since i have not run the code. If you find you continue to have the same problem let us know . -Justin Chris wrote: > Hi, > > After loading a shapefile (ESRI), I created a graph using a > DirectedLineStringGraphGenerator. The creation went fine but when using > a DijkstraShortestPathFinder.getPath() on it, I noticed that there was a > problem because it returned null. Apparently, the linestring graph > generator does not take internal intersections of > lines into account when building the graph. Hence, I decided to code a > routine to split the LineStrings at their intersection as advised there: > http://www.nabble.com/Re%3A-LineString-Graph-Traversal-p1489791.html > > The problem is that My routine is taking "forever" to do the splitting. > Either, I'm doing it wrong or it is not optimized enough. After waiting > for 10 minutes, it is still not finished (although, the shapefile is not > that big). Could someone have a look at my function and see what the > problem is? > > Thanks in advance, > > Best regards, > Chris. > !DSPAM:4007,4787a0db264908992556831! > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > !DSPAM:4007,4787a0db264908992556831! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > > !DSPAM:4007,4787a0db264908992556831! -- Justin Deoliveira The Open Planning Project http://topp.openplans.org ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users