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.
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@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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Hi Johannes,
thank you.
Johannes Radinger wrote
What do you mean exactly with creating a raster from a coordinate pair?
You are rigth, I have to be more understandable.
I have defined region, with a defined extent and a defined resolution.
Starting from a coordinate pair I would like to create a boolean raster
(with the same extent and resolution of my region) that "register" my pair
(in example 1 for my pixel and 0 for all the rest).
Best regards,
Andrea
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Create-a-raster-starting-from-a-coordinate-pair-tp5093513p5093523.html
Sent from the Grass - Users mailing list archive at Nabble.com.
Hi Andrea,
may be you need something like that:
http://grass.osgeo.org/grass65/manuals/r.in.xyz.html
I'm not sure if that was the problem.
all the best
Ivan
On Tue, 2013-12-10 at 05:01 -0800, aborruso wrote:
Hi Johannes,
thank you.
Johannes Radinger wrote
> What do you mean exactly with creating a raster from a coordinate pair?
You are rigth, I have to be more understandable.
I have defined region, with a defined extent and a defined resolution.
Starting from a coordinate pair I would like to create a boolean raster
(with the same extent and resolution of my region) that "register" my pair
(in example 1 for my pixel and 0 for all the rest).
Best regards,
Andrea
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Create-a-raster-starting-from-a-coordinate-pair-tp5093513p5093523.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Ciao Ivan,
thank you.
ivan.marchesini wrote
may be you need something like that:
http://grass.osgeo.org/grass65/manuals/r.in.xyz.html
Not exactly. I would like to use as inpunt only a coordinate pair and not
another file.
Best regards
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Create-a-raster-starting-from-a-coordinate-pair-tp5093513p5093527.html
Sent from the Grass - Users mailing list archive at Nabble.com.
Here a short example for a subregion of the North Carolina Sample Dataset with resolution 10x10 m
g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 224820
south: 224450
west: 641120
east: 641660
nsres: 10
ewres: 10
rows: 37
cols: 54
cells: 1998
When I run following command I get a raster map with the value 1 for the coordinate pair 641335.0/224515.00 (cell center). All other cell have the value 0.
r.mapcalc “newmap = if(abs(x()-641335.0)<0.001 && abs(y()-224515.00)<0.001, 1, 0)”
/Johannes
···
On Tue, Dec 10, 2013 at 2:21 PM, Ivan Marchesini <ivan.marchesini@gmail.com> wrote:
Hi Andrea,
may be you need something like that:
http://grass.osgeo.org/grass65/manuals/r.in.xyz.html
I’m not sure if that was the problem.
all the best
Ivan
On Tue, 2013-12-10 at 05:01 -0800, aborruso wrote:
Hi Johannes,
thank you.
Johannes Radinger wrote
What do you mean exactly with creating a raster from a coordinate pair?
You are rigth, I have to be more understandable.
I have defined region, with a defined extent and a defined resolution.
Starting from a coordinate pair I would like to create a boolean raster
(with the same extent and resolution of my region) that “register” my pair
(in example 1 for my pixel and 0 for all the rest).
Best regards,
Andrea
–
View this message in context: http://osgeo-org.1560.x6.nabble.com/Create-a-raster-starting-from-a-coordinate-pair-tp5093513p5093523.html
Sent from the Grass - Users mailing list archive at Nabble.com.
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Hi Johannes,
thank you, thank you, thank you.
I'll try
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Create-a-raster-starting-from-a-coordinate-pair-tp5093513p5093530.html
Sent from the Grass - Users mailing list archive at Nabble.com.
On 10/12/13 14:44, aborruso wrote:
Hi Johannes,
thank you, thank you, thank you.
Another solution:
- create a vector point with v.in.ascii or v.edit
- transform that into a raster with v.to.rast
Moritz
On Tue, Dec 10, 2013 at 1:02 PM, aborruso <aborruso@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
Hi Andrea,
maybe this comes pretty close:
http://grass.osgeo.org/grass64/manuals/r.in.poly.html
Markus