[GRASS-dev] Problems with v.net.distance

Markus Metz markus.metz.giswork at googlemail.com
Tue Jun 19 06:21:59 PDT 2012


On Tue, Jun 19, 2012 at 12:57 PM, Roberto Marzocchi
<roberto.marzocchi at gmail.com> wrote:
>
>
> 2012/6/18 Markus Metz <markus.metz.giswork at googlemail.com>
>>
>> On Mon, Jun 18, 2012 at 3:13 PM, Roberto Marzocchi
>> <roberto.marzocchi at gmail.com> wrote:
>> > Hi Markus,
>> >
>> > many thannks for your changes. I think now the command is quite O.K..
>> > Nevertheless I have encountered a new error:
>> > I have tried with the command that you suggested me (to_type is point
>> > and
>> > not line) and it works.
>> >
>> >
>> > v.net.distance input=network_cat4 output=network_cat4_distance alayer=3
>> > nlayer=4 afcolumn=lungh_a abcolumn=lungh_i flayer=4 from_cats=1-4
>> > tlayer=4
>> > to_type=point to_cats=5-6920 --overwrite
>> >
>> > after I try to do the opposite, that is from the 6916 nodes of the
>> > network
>> > (that are point!) to the firestations and it don't works
>> >
>> > v.net.distance input=network_cat4 output=network_cat4_distance alayer=3
>> > nlayer=4 afcolumn=lungh_a abcolumn=lungh_i tlayer=4 to_cats=1-4 flayer=4
>> > to_type=point from_cats=5-6920 --overwrite
>> >
>> >
>> >
>> >>> Building graph...
>> >>> Registering arcs...
>> >>>  100%
>> >>> Flattening the graph...
>> >>> Graph was built
>> >>> ERROR: Requested feature id -1 is not reasonable(max features in
>> >>> vector
>> >>> map
>> >>>       <network_cat4 at ospedali_grass7>: 15747)
>> >
>> >
>> > I don't understand why...
>>
>> Some of the 'from' features are not reachable within the network. For
>> each 'from' feature, the module finds the nearest 'to' feature. That
>> means that all 'from' features must be connected to the network, but
>> it is ok if some 'to' features are not connected. This is why you got
>> this error after you swapped the set of 'from' and 'to' features.
>>
>> Fixed in r52124. But maybe a warning would be useful if some 'from' or
>> 'to' features are not reachable.
>>
>> Markus M
>
>
> Dear Markus,
>
> Now It works also for other points.  Obviously the nodes not connected are
> not considered.
>
> I'm in agree with you, a warning can be very useful!

OK, I will add more warnings to the module.

>
> It is strange also that the points are not connected to the network. In fact
> I have created the nodes using v.net.
> I will check if there is any problem with v.net.

I don't think there are problems with v.net. See attached screenshot
of the south-eastern corner of the network_cat4 vector.

Markus M

>
> Many thanks and best regards,
> Roberto
>
>
>
>
>
>>
>>
>> >
>> > Thanks in advanced,
>> > Roberto
>> >
>> > 2012/6/16 Markus Metz <markus.metz.giswork at googlemail.com>
>> >>
>> >> On Fri, Jun 15, 2012 at 6:12 PM, Roberto Marzocchi
>> >> <roberto.marzocchi at gmail.com> wrote:
>> >> > Dear all,
>> >> >
>> >> > I'm trying to use v.net.distance in grass7, which option seem be
>> >> > corrected
>> >> > respect of teh version of grass65 (alayer, nlayer and consequently
>> >> > costs).
>> >> >
>> >> > First of all, I noted that the option output is reported two time,
>> >> > but
>> >> > this
>> >> > can be simply corrected removing line 134 of main.c command. If
>> >> > needed I
>> >> > can
>> >> > add in the svn.
>> >> > Secondarly the program stop itself because if I correctly uderstand,
>> >> > the
>> >> > number of lines not corresponding with the number of nodes.
>> >> >
>> >> > ERROR: Nodes not available for line 8819
>> >>
>> >> v.net.distance should be fixed with r52069.
>> >>
>> >> >
>> >> > Unfortunately I'm not expert with vector grass libraries so I didn't
>> >> > understand the problem..
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> > I'm using as a test the north carolina dataset and in particular I do
>> >> > the
>> >> > step of the tutorial of Trento university
>> >> >
>> >> >
>> >> > (http://www.ing.unitn.it/~grass/docs/tutorial_64_en/htdocs/esercitazione/network_analysis/index.html) adding
>> >> > also a 4th layer with the nodes. Attached a script to create the
>> >> > dataset
>> >> > (grass70)
>> >>
>> >> In the test script, use
>> >>
>> >> v.net.distance input=network_cat4 output=network_cat4_distance
>> >> alayer=3 nlayer=4 afcolumn=lungh_a abcolumn=lungh_i flayer=4
>> >> from_cats=1-4 tlayer=3 to_type=line to_cats=6-6920
>> >>
>> >> in order to get the shortest paths from the four selected firestations
>> >> to the network. The 'from' features are always points, I have updated
>> >> the description and manual accordingly.
>> >>
>> >> Markus M
>> >>
>> >> >
>> >> >
>> >> > Cheers,
>> >> > Roberto
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > grass-dev mailing list
>> >> > grass-dev at lists.osgeo.org
>> >> > http://lists.osgeo.org/mailman/listinfo/grass-dev
>> >
>> >
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not_connected_small.png
Type: image/png
Size: 5149 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20120619/4a61169b/attachment-0001.png>


More information about the grass-dev mailing list