#1760: Cannot query vector network nodes
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: Vector | Version: unspecified
Keywords: | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
After trying various things I can now describe more of what is happening.
Main symptom: you cannot query with a mouse (v.what) nodes on a vector
network. You can only query the arcs.
Underlying issues:
In creating network nodes (v.net nodes) from an existing network map (like
roads major in the nc_08 demo data), the node points get written to layer
2 and a set of arcs get written to layer 1. (I'm not sure why it is not
JUST creating nodes with the v.net node operator. This may be a bug or
perhaps a "feature"). No attribute info is assigned to nodes created in
this way, but they must have cats stored in the vector database.
Trying to query nodes, either 1) query is still not recognizing vectors
that do not have linked attribute tables (likely a problem here) and/or 2)
query will not query layer 2.
So problem 1 is the creation of nodes using v.net on vector
lines/boundaries. Shouldn't this just be creating nodes in layer 1 rather
than nodes in layer 2 and arcs in layer 1? v.net connect should then
connect nodes (i.e., points) with lines/boundaries to create a network.
Problem 2 is the inability of querying (is this a v.what or a wxgui
issue?) to return information about points in layer 2 that lack an
attribute table. Is this a query + layer problem, query + lack of
attribute table problem or a combination of both?
The combination of problems 1 and 2 results in the inability to query
nodes on a network. I'm listing this as a vector problem, but wxgui
querying may also be involved.
v.net does not create an attribute table for nodes, even if they are
created from a set of points that DO have an attribute table. For example
(using the sc_08 demo data):
creates a network of streets and firestations. The attributes from the
streets_wake file get copied over into the arcs of the new
forestation_network vector network file. But the attributes from the
firestations do not. This is the cause of the inability to query the
nodes. If I manually run v.db.connect to connect the nodes of
forestation_network to the forestations attribute table (connected to
nodes in layer 2), then I CAN query the nodes.
So the main problem is in how v.net creates networks not how v.what (and
wxgui) queries the network. In fact, there is no problem querying nodes in
layer 2 once they have an attribute table.
BUT, querying nodes still should at least show the cat values, even if
there is no attribute table. So there is still a query issue here.
The query problem is known - see #1703 (the last one from the list of
problems). I would prefer refactoring the raster and vector querying to
trying to fix this particular case. However, it would need some time.
Replying to [comment:1 cmbarton]:
> Here is additional information.
>
> v.net does not create an attribute table for nodes, even if they are
created from a set of points that DO have an attribute table.
Attached to which layer in the original input vector?
I have long thought about updating the v.net module with regard to layer
management, but did not yet get to do it: for v.net, it should be possible
to specify the input arc and node layer, default to 1 for each. Output arc
layer is 1, output node layer is 2 (current behaviour and required by the
default settings of most of the v.net.* modules). Any attribute tables
attached would be copied, and the vector feature attributes changed
accordingly.
>
> creates a network of streets and firestations. The attributes from the
streets_wake file get copied over into the arcs of the new
forestation_network vector network file. But the attributes from the
firestations do not. This is the cause of the inability to query the
nodes. If I manually run v.db.connect to connect the nodes of
forestation_network to the forestations attribute table (connected to
nodes in layer 2), then I CAN query the nodes.
This is a problem of the wxGUI. v.what from the command line works just
fine, same in the tcl/tk GUI. The wxGUI, in all versions, queries the
attribute tables rather than the vector features. This is not conforming
to GRASS vector design.
>
> So the main problem is in how v.net creates networks not how v.what (and
wxgui) queries the network. In fact, there is no problem querying nodes in
layer 2 once they have an attribute table.
>
> BUT, querying nodes still should at least show the cat values, even if
there is no attribute table. So there is still a query issue here.
The wxGUI query issue is already known and reported.
For v.net, GRASS should be treating node creation like it treats arc
creation. If the operation is "connect", then the attribute table of the
input points map should be copied and connected to the nodes layer; if the
operation is "nodes" than at least a minimal table with the cat value in
it should be created so that node values can be added later by the user.