Closed timlinux closed 10 years ago
So, the new point layer will have attributes: node_id
- line_id
- node_type
(start node or end node)?
To start with yes. Depending on which of the functions (find wells, find sinks etc.) we run, each will add a new column to the table e.g.
id | line_id | node_type |
---|---|---|
1 | 1 | upstream |
2 | 1 | downstream |
Then we do count and enumeration and it becomes:
id | line_id | node_type | node_list | node_count |
---|---|---|---|---|
1 | 1 | upstream | 5, 10 , 15 | 4 |
2 | 1 | downstream | 12, 14, 44 | 4 |
etc.
From you comment, and from #12's problem desription:
Given a line layer, identify by selection all wells (points with no upstream nodes)
So, it should be given a point layer
not given a line layer
, shouldn't it?
@ismailsunni No think from the user perspective: I have a stream network and I want to identify well features. The line layer should always be the starting point for them and the fact that we use a point layer for processing / computation is an implementation detail.
Ok I got it.
So the workflow will be something like this:
So, it brings me to another question. In what form is the result? A table that contains the features? Or a point layer that contains all points that represent the features?
User choose a line layer
Correct
Click "Extract" button (so, there will be only a button for all feature extracting process, right?, Or one button for each feature extraction?)
One button click will create a new river features point layer with one column per feature type as per the tickets listed in this issue tracker. So ultimately we end up with a point layer whose attribute looks like this:
id | line_id | node_type | upstream_node_list | downstream_node_list | upstream_node_count | downstream_node_count | well | sink | confluence | branch | has_pseudonodes | watershed |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | upstream | 5, 10 , 15 | 4, 7 | 4 | 2 | 1 | 0 | 0 | 0 | 0 | 0 |
2 | 1 | downstream | 12, 14, 44 | 5, 9 | 3 | 3 | 0 | 0 | 0 | 0 | 0 | 0 |
User gets all features.
User sees a new layer added to view which has symbols for each feature type we have extracted. We probably need to think about removing duplicate nodes that occur in the same snapped position but we can come to that later.
So, it brings me to another question. In what form is the result? A table that contains the features? Or a point layer that contains all points that represent the features?
OK I think that is explained above - it is a point layer with an attribute table as described above.
Problem
The method should when given a line layer, extract start and end nodes plus line ID as new point layer.
Proposed solution
Implement a helper method (no gui) that takes as input:
The method should extract all start and end nodes from the passed in line layer and write them to a new point layer with the following attributes:
Note that the
node list
is exclusive of the current node (it lists other nodes that are super-imposed based on the specified snapping distance) while thenode_count
is inclusive of the current node (it is the count of all nodes occurring at this position within the the snapping distance).It is expected that this attribute table will be appended to but other helper functions (see #12 , #13 , #14, #15, #16, #17).
Expected outcome
A generated layer which lists all the nodes for the input dataset and that can be used as the basis for further feature extraction.