Thanks for reading;

Now can we talk about this part?
-------
Example of building a Line network:

LineGraphBuilder lgb = new
 LineGraphBuilder();
FeatureSource fs = (FeatureSource)layers.get(typeName);
FeatureResults fr = fs.getFeatures();
FeatureCollection fc = fr.collection();
FeatureIterator f = fc.features();

while
(f.hasNext()){
  Feature ft = f.next();
  
if
(envelope.contains(ft.getBounds()))
    lgb.add(ft);
}

// lgb is loaded

Graph g = lgb.build();
-------

That is the answer to your question; you can get a feature source from your 
postgis table; the above code examle shows you how to load it into a graph.
I am assuming you are using lines? If not you can build a graph based on 
polygons touching or whatever.

I do see the code example is out of date (we just use FeatureCollection now). 
Please start and if you share your code examples we can use them to update that 
page.

Jody

On 08/06/2010, at 11:33 AM, laura siewe wrote:

> Hello everybody,
> 
> I want to use Djikstra module in geotools. I have readed the informations 
> which are in this link http://docs.codehaus.org/display/GEOTDOC/Graphs.
> 
> But I don't understand very well how to use that in my context because I have 
> displayed a map of my geographic area with geotools from PostGIS database. 
> Please I want a kind of example which can help me to start and show me how to 
> use a graph with a geographic data which are in the PostGIS database.
> 
> Thanks for your help.
> 
> 
> 
> ------------------------------------------------------------------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to