I was all excited to update the graph example in the docs based on your email:
- 
http://docs.geotools.org/latest/userguide/extension/graph/index.html#shortest-path

However the example all ready covers this bit :-)

-- 
Jody Garnett


On Tuesday, 7 June 2011 at 11:55 PM, PaulCrease wrote:

> here is some code to weight network edges according to the length of the
> edge....
> 
> EdgeWeighter weighter = new EdgeWeighter() {
>  public double getWeight(org.geotools.graph.structure.Edge e) {
> 
>  SimpleFeature aLineString = (SimpleFeature)
> e.getObject(); 
>  Geometry geom = (Geometry) aLineString.getDefaultGeometry();
>  return geom.getLength(); 
> 
> }
>  };
> 
> 
> 
> DijkstraShortestPathFinder dspf = new DijkstraShortestPathFinder(
> networkGraph, source, weighter );
> 
> dspf.calculate();
> 
> Hope it helps.....
> 
> --
> View this message in context: 
> http://osgeo-org.1803224.n2.nabble.com/DijkistraShortestPathFinder-tp6427487p6449700.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com 
> (http://Nabble.com).
> 
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected] 
> (mailto:[email protected])
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to