[GRASS-user] Checking and fixing roads for network analysis
Mark Wynter
mark at dimensionaledge.com
Fri Jan 16 13:03:43 PST 2015
Hi Daniel - not sure why you’re getting that error - I’ll leave that to someone more familiar with the backend workings to comment on.
In the interests of you moving forward, one approach might be that you simply manually add nodes in say QGIS before running v.snap.
By that, I mean:
1) In QGIS, open up the shapefile
2) Click the Edit layer icon
3) Find the line at that is closest to the point you wish to snap to another line end. Double click on the line at the point where you want to insert a new node - a new node should appear. Make sure the other line end is within your snap tolerance of your newly added node. If not, drag the line end so that it is.
4) Repeat for other “disconnected” parts of your road network
5) Save.
6) Import into GRASS and run v.clean.
You still need to break the lines that cross - which are not tunnels or bridges.
Even if v.clean tool=break is working correctly, in my experience you may still encounter unconnected T junctions where the lines undershoot, and there is no node on the adjacent line to which the line ending can snap to. The QGIS approach I’ve outlined will fix that - provided you know where the disjointed lines are.
If you’re working with a large scale road networks, its not practical to manually detect or fix such anomalies - which is why I developed my own PostGIS method I outlined yesterday.
HTH
Mark
On 17 Jan 2015, at 4:05 am, Daniel Victoria <daniel.victoria at gmail.com> wrote:
Hi Mark,
I tried using v.clean with break, rmdup and snap. However, when I try to run v.net.components I get an error saying that
v.net.components input=rede_brk_rmdup_snap at PERMANENT node_layer=1 output=component_brk_rmdup_snap method=weak
Building graph...
Registering arcs...
Flattening the graph...
Graph was built
ERROR: Cannot insert new record: insert into component_brk_rmdup_snap values (3689, 1)
I'm using Grass v7RC1 on Windows and v.net.components work if I use only the snap tool in my roads network
Cheers
Daniel
More information about the grass-user
mailing list