Hi Jeff,

I realize that documentation is poor for the graph module, so I would be
happy to answer any questions you have. My answers inline.

On Fri, July 28, 2006 4:19 pm, Hyink, Jeffrey \(LCDR\) wrote:
> 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.
>
The latter. To build a graph noded at all intersections you would need to
build the graph from the individual line segments. This of course will
result in a graph with lots of nodes. You could however "fuse" the graph
after (basically removing any degree 2 nodes). There is a utility class
called GraphFuser which does just this.
> 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?
>
So you need to build your graph from features, and not just the underlying
geometry. I thought there was a FeatureLineStringGraphGenerator around,
but i guess not. It would be pretty trivial to write, it could be a
subclass of LineStringGraphGenerator.
> 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?
There is a "well hidden" interface called EdgeWeighter, it is defined as
an inner interface defintion of the DijkstraIterator class. When you
create a DijkstraShortestPathFinder you pass one of these types of objects
in.
>
> 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!
>
No problem, I am happy to help. And I would definitly be willing to take
you up on your offer. Perhaps if the graph module works out for you could
contribute a tutorial of some sort. That would be great.
> -Jeff
>
>
>
> -----Original Message-----
> From: Justin Deoliveira [mailto:[EMAIL PROTECTED]
> Sent: Fri 7/28/2006 12:51 PM
> To: Hyink, Jeffrey (LCDR)
> Cc: [email protected]
> Subject: Re: [Geotools-gt2-users] Graph module and .src code
>
>
> 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 = new BasicLineGraphGenerator();
>>
>>
>>
>> FeatureCollection collection = null;
>>
>>
>>
>> try {
>>
>> collection = fsShape.collection();
>>
>> } catch (IOException e) {
>>
>>
>>
>> // TODO Auto-generated catch block
>>
>>
>>
>> e.printStackTrace();
>>
>> }
>>
>>
>>
>> FeatureIterator iterator = collection.features();
>>
>>
>>
>> while (iterator.hasNext()){
>>
>> Feature f = 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...)
>>
>>
>>
>>
>> -----------------------------------------------------------------------
>> --
>> 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=join.php&p=sourceforge&CID=DEVD
>> EV
>>
>>
>>
>> !DSPAM:1004,44ca2c56144449771116852!
>> _______________________________________________
>> Geotools-gt2-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>>
>>
>> !DSPAM:1004,44ca2c56144449771116852!
>>
>>
>>
>
>
>
>
> !DSPAM:1004,44ca7192172052207481331!
>
>


-------------------------------------------------------------------------
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=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to