Timeline for Select points approx. 2000 metres from another point along a river?
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 11, 2020 at 15:27 | history | edited | CommunityBot |
Commonmark migration
|
|
May 23, 2017 at 12:39 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Mar 5, 2014 at 18:26 | comment | added | JC11 |
If I used the function and entered Downstream ((1497315.0, 11965605.0),2000,G). Knowing that the start key is associated with a parallel array with the length of 7250 and an end point where the length ends. The expected output would be coordinates at 2000, 4000, 6000 and 7250 for this key? or Do you mean only 1 point as in only the coordinates of 2000m?
|
|
Mar 5, 2014 at 16:59 | comment | added | whuber |
Yes, Along is a service provided by the GIS. The output is described in the answer: "the function Downstream(p, x, G) returns the coordinates of a point that is distance x downstream of p in the network G, provided such a point exists."
|
|
Mar 5, 2014 at 16:54 | comment | added | JC11 |
I used key in d and tested some of the start values and python returned false. I then used G.keys() to check my keys and they are all there. What kind of output am I expecting from the algorithm? Will it give me coordinates of every point 2000m downstream? Do I need to define Along prior to the code as seen in the edited question?
|
|
Mar 4, 2014 at 20:28 | comment | added | whuber |
That's exactly how Python is supposed to be behaving, according to the documentation. The meaning of IsNull(p) in the pseudocode is that you should either trap the keyerror error or else use the key in d syntax to test whether p is in G .
|
|
Mar 4, 2014 at 19:32 | comment | added | JC11 | I have made significant progress and am just trying to get the algorithm to function. I have edited the above question describing my accomplishments so far. The only issue is a keyerror now. | |
Mar 3, 2014 at 19:04 | comment | added | whuber | Let the value associated with a key be an index into each of the arrays. | |
Mar 3, 2014 at 18:58 | comment | added | JC11 | Just to make sure I'm following this correctly. I used arcpy.da.featureclasstoNumPyArray to make start, end, length and shape into arrays. I then create a dictionary where start is the key. Are end, length and shape 'values' associated with the key? From learning how to use a dictionary, there can only be one value per key. I'm not to sure how to use a dictionary in the way you describe. | |
Feb 26, 2014 at 21:47 | comment | added | whuber | You've already done the hard part of extracting the relevant data from the GIS. You don't need a formal "object"; that's just a convenient way of conceptualizing what the algorithm does. For instance, you could maintain the four attributes of each edge in four parallel arrays. You definitely want to learn how to use a dictionary: as you can see, they make short work of looking things up, which makes them powerful tools. For basic Python coding questions go to Stack Overflow--but first do some research online; there's lots of help out there. | |
Feb 26, 2014 at 20:30 | comment | added | JC11 | This is a great answer, but it seems to go beyond my experience with python. I've organized the data from polyline representation to include attributes for the length of each segment, the endpoints of each segment and the flow accumulation of the termini of each segment. I have not used objects, tuples or dict in python before, so this is where I have hit a roadblock. What would be the next step? or Should I post another question on the forum with regards to this issue. | |
Feb 25, 2014 at 20:49 | history | answered | whuber | CC BY-SA 3.0 |