is uDig a different library than geotools ? will I have to start over using
Udig ? or can I use uDig just for the sake of getting the shortest path?

On Tue, Mar 1, 2011 at 12:27 AM, Jody Garnett <jody.garn...@gmail.com>wrote:

>  Do you want to review the udig example? We let the user click on the map;
> find the closest feature; and sort it out from there.
> -
> https://github.com/uDig/udig-platform/tree/master/plugins/net.refractions.udig.graph/src/net/refractions/udig/graph/internal
>
> WayPoint Tool lets users define new waypoints.
> LineGraphOp lets people select a feature collection and generate a graph in
> memory
> FindPathOp finds the shortest path through all the waypoints.
>
> --
> Jody Garnett
>
> On Tuesday, 1 March 2011 at 1:06 AM, mounir younes wrote:
>
> In the docs there is a part that says
> Finding the Shortest Path between two Nodes
> it starts with:
>
> //reference to a graph, already built
> Graph graph = ...see above...
>
> //find a source node (usually your user chooses one)
> Node source = ..
>
> and then ...
>
> List/*<Node>*/ destinations = ...
>
>
> My question is how can I initialize source and the list of nodes ? what can
> I fill in (as code)? I already have the graph built could someone help me
> write the code for it ?
>
> On Mon, Feb 28, 2011 at 12:57 AM, Jody Garnett <jody.garn...@gmail.com>wrote:
>
>  - Nodes; I think those are created by the builder when you set up your
> graph. They are mostly the internal structure of the graph and not that
> exciting.
> - You do not want to cast to a feature; you want to say
> graphable.getObject(). The builder put the feature their when building. Both
> Nodes and edges are "graphable".
>
> There is some docs here:
> - http://docs.codehaus.org/display/GEOTDOC/Graphs
>
> Have a look at the test cases:
> -
> http://svn.osgeo.org/geotools/trunk/modules/extension/graph/src/test/java/org/geotools/graph/
> --
> Jody Garnett
>
> On Monday, 28 February 2011 at 1:02 AM, mounir younes wrote:
>
> How do I create the Node object? Node source =... ? I tried casted a
> feature but did not work so i am currently stuck.
>
>
>
> .On Sun, Feb 27, 2011 at 4:18 PM, Jody Garnett <jody.garn...@gmail.com>wrote:
>
>> Sounds like you are doing everything right, and then having trouble
>> drawing the result at the end of the day.
>>
>> The path provides the route between the two locations (think of it as an
>> iterator). Each edge of the path is associated with a feature,  use the path
>> to "Walk" along the edges that make up the shortest route. You can retrieve
>> the features along each edge if you want to draw the route visually.
>>
>> In terms of calculation you may wish to provide an edge weight based on
>> the length of the associated feature (or perhaps even the length and speed
>> limit).
>>
>> As for drawing ...
>> 1. Write down the feature ids (perhaps in a Set<String>) as your walk
>> along the path
>> 2a. And then use these feature Ids to update a style (you can make a
>> filter using the set of feature ids for the style, and ask the map to draw
>> only the features on the path in a specific colour)
>> 2b. Or if that is too much; walk along the path, and copy the features
>> into a new feature collection, and add the new feature collection to your
>> map.
>>
>> --
>> Jody Garnett
>>
>>  On Sunday, 27 February 2011 at 5:11 AM, mounir younes wrote:
>>
>> Hello,
>>
>> I will give a small example of what I am willing to do. First let's say I
>> have my house and my friend's house on Layer 1.
>> On layer 2 I have the roads between us. I want to discover the shortest
>> path between my house and my friend's and then colors the roads only without
>> the house. What should I do? I took a look on the graphs on codehaus but
>> couldn't figure out how I should start.
>>
>> I got the steps but cannot figure out the code:
>>
>> 1- Create a feature collection       (I know how to do this)
>> 2- add to it the house features (from layer1) and the roads (from
>> layer2)      (I know how to do this as well)
>> 3- use the dijkstra included in the graphs extension (
>> http://communitymapbuilder.org/display/GEOTDOC/Graphs#Graphs-GraphingTerms
>> )
>>
>> this will generate a path ! Is a path a straight line ? or is it the roads
>> between our houses?
>>
>> My house will be set as the source and my friend's as the destination
>>
>> 4-Color ONLY the roads between them.
>>
>> could someone help me with this please (step 3 and 4) ? Include code if
>> possible
>>
>> Thank you in advance.
>>
>> ------------------------------------------------------------------------------
>> Free Software Download: Index, Search & Analyze Logs and other IT data in
>> Real-Time with Splunk. Collect, index and harness all the fast moving IT
>> data
>> generated by your applications, servers and devices whether physical,
>> virtual
>> or in the cloud. Deliver compliance at lower cost and gain new business
>> insights. http://p.sf.net/sfu/splunk-dev2dev
>> _______________________________________________
>> Geotools-gt2-users mailing list
>> Geotools-gt2-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>>
>
>
>
>
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to