[GRASS-user] Create a raster starting from a coordinate pair
Johannes Radinger
johannesradinger at gmail.com
Tue Dec 10 04:15:55 PST 2013
What do you mean exactly with creating a raster from a coordinate pair?
If you want to align a raster to your coordinates you might have a look
into g.region
and set appropriate resolution and extend coordinates.
To create a raster based on coordinates, eg. set a raster value at a
specific coordinate
pair to a specific value you could use r.mapcalc:
E.g. Set the value 1 at the cell x=52, y=10
r.mapcalc "newmap = if(abs(x()-52.0)<0.001 && abs(y()-10.00)<0.001, 1)"
If you know the specific row and column and resolution you could also use:
r.mapcalc "newmap = if(row()-1 == int(($n-10.0)/$nsres) && col()-1 ==
int((52.0-$w)/$ewres), 1)"
Thanks to Glynn who taught me these things some time ago on the mailing
list :)
/Johannes
On Tue, Dec 10, 2013 at 1:02 PM, aborruso <aborruso at gmail.com> wrote:
> Hi all,
> is there some grass raster command to create a raster starting from a
> coordinate pair?
>
> Something like r.createraster input=x,y output=myraster
>
> Thank you,
>
> Andrea
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Create-a-raster-starting-from-a-coordinate-pair-tp5093513.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20131210/12c88268/attachment-0001.html>
More information about the grass-user
mailing list