[GRASS-user] v.net.alloc having difficulty with specific dataset

Markus Metz markus.metz.giswork at gmail.com
Tue Oct 4 12:53:42 PDT 2016


On Tue, Oct 4, 2016 at 5:09 PM, Sam Snellings <ssnellings at gmail.com> wrote:
> I've been running some trials through v.net.alloc using town road networks
> as the arc layer and schools as the node layer. I have one set of
> roads/schools that breezes through v.net.alloc without issue (Town 1), while
> another one only allocates the first few arcs connected to each school and
> leaves the rest of the network unallocated (Town 2). There is probably a
> problem with the data from Town 2, but I can't figure out what it is. Does
> this issue sound familiar to anyone?
>
> I am using the GUI. I load each pair of shapefiles into GRASS and then run
> the following statements (I only import two school points to simplify). The
> two towns are pulled right from the state-wide GIS office, but the towns are
> in different states (ie - different agencies provide the data).
>
You do not need this for v.net.alloc:
> v.net input=roads output=road_nodes operation=nodes
it will create a point for every node, the first point will have
cat=1, the second cat=2 which collides with the points you want to
attach

> v.net input=road_nodes points=schools output=network operation=connect
> thresh=1000

rather use
v.net input=roads points=schools output=network operation=connect thresh=1000

> v.net.alloc input=network output=network_allocation ccats=1-2

the real problem is probably a data problem: roads are not properly
connected, i.e. the end of one road does not match the beginning of
another road. Try v.clean input=roads output=roads_snap -c tool=snap
with a very small threshold. This kind of error is quite common with
shapefiles (not a fault of the shapefile format but of the software
used to create the shapefiles).

>
> Thanks in advance for any advice, I can also email images/data if that would
> be helpful.

If v.clean -c tool=snap does not help, (links to) original data of the
schools and road network for Town 2 would be helpful (data please only
off-list).

Markus M


More information about the grass-user mailing list