[GRASS-user] Calculating cost to port

Anna Petrášová kratochanna at gmail.com
Fri Nov 10 08:20:01 PST 2017


Hi Daniel,

On Fri, Nov 10, 2017 at 11:03 AM, Daniel Victoria
<daniel.victoria at gmail.com> wrote:
> Hi list,
>
> I want to calculate a cost of getting from any cell in my raster to some
> ports, considering roads network, and I though r.cost could solve this.
>
> What I have is:
> 1) Cost raster map with cost per cell (10 for normal cells, 1 if it's a
> road)
> 2) vector map containing several ports
> 3) start_raster has the same extent of the cost raster, but all cells == 1
>
> This is the command I'm using
> r.cost input=cost_map output=cum_cost stop_points=ports
> start_raster=my_region
>
> However, my results is a map will all values equal zero. Is it because the
> stop_points in ports lay inside my start_raster? Thus r.cost reaches the
> stop point right from the start?
>
> My final result should be a map of distance to ports considering the roads
> network.

I think it should be
r.cost input=cost_map output=cum_cost start_points=ports

your ports are the starting points.

Anna

>
> Cheers
> Daniel
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list