## Re: [Geotools-gt2-users] Graph module and .src code

 Re: [Geotools-gt2-users] Graph module and .src code From: Hyink, Jeffrey \(LCDR\) - 2006-07-28 20:18:55 Attachments: Message as HTML ```Justin, I appreciate the quick reply. I'll give that a shot asap. I can't find = too much documentation on your module, so maybe you could help with a = few other quick questions...or steer me towards some info. 1. When using the LineStringGraphGenerator, will it make nodes in the = graph for every point in the linestring to accomodate intersections with = other roads? Or is an "edge" the entire crooked series of points? I = can see advantages to either implementation. 2. I am looking to "weight" the edges with travel times based on length = of the edge and speed category (a feature attribute). Do you have any = suggestions on how to tease the road or edge length out of a feature, or = do I need to crack open the geometry and do some coordinate math? 3. I can't see how you are weighting your edges in order to run = Djikstra. I see the Edge class and some of the Djikstra implementation, = but haven't got it figured out yet... How are you creating weighted = d[i,j] edges? Thanks much for any help you can provide. Would be glad to repay the = favor somehow if I can get my code up and cooking! -Jeff -----Original Message----- From: Justin Deoliveira [mailto:jdeolive@...] Sent: Fri 7/28/2006 12:51 PM To: Hyink, Jeffrey (LCDR) Cc: geotools-gt2-users@... Subject: Re: [Geotools-gt2-users] Graph module and .src code =20 Hi Jeffrey, You will need to use a LineStringGraphGenerator instead of BasicLineGraphGenerator. Also, when you call add you will need to pass = in teh geometry of the feature, add( f.getDefaultGeometry() ); I thought there was an implementation which worked directly against features but I dont seem to see it in the repository. -Justin On Fri, July 28, 2006 11:24 am, Hyink, Jeffrey (LCDR) wrote: > Hello all, > > > > > I'm about knee deep into developing a program using the GT2 2.2 = library. > I've parsed my way through a couple of the examples and gotten enough = of > the code working to the point that I'm getting dangerous. > > > > Anyhow, I'm trying to take a set of city roads from a shapefile and = use > the Graph Builder module to turn them into a network(nodes, arcs). = I'm > getting a runtime error from the following code in the add() = statement. > > ... > > > BasicLineGraphGenerator lgg =3D new BasicLineGraphGenerator(); > > > FeatureCollection collection =3D null; > > > try { > > collection =3D fsShape.collection(); > > } catch (IOException e) { > > > // TODO Auto-generated catch block > > > e.printStackTrace(); > > } > > > FeatureIterator iterator =3D collection.features(); > > > while (iterator.hasNext()){ > > Feature f =3D iterator.next(); > > > lgg.add(f); > > } > > > > > Where fsShape is a working instance of FeatureResults with about a > hundred roads in it. > > > > I'm not sure if one of the elements is a problem adding to the graph = or > if the whole structure is bogus, which leads to second question: > > > > I downloaded the 2.2RC3src in an attempt to troubleshoot, unzipped it, > mvn install'd it, got a good build, and it doesn't appear to contain = the > source code...? Just the full set of .jar files with no source = attached? > > > > I'm a maven novice, so maybe I'm gooning something up there. Any help > or anyone with experience in the graph module who could lend some > tips/source code would be appreciated. > > > > Thanks, > > > Jeff > > > > > (sorry if this shows up as a dupe. I mistakenly sent from another > account last night...) > > > > !DSPAM:1004,44ca2c56144449771116852! > = -------------------------------------------------------------------------= > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to = share > your opinions on IT & business topics through brief surveys -- and = earn > cash > = http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > > !DSPAM:1004,44ca2c56144449771116852! > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > > > !DSPAM:1004,44ca2c56144449771116852! > > ```