[GRASS-user] Create a raster starting from a coordinate pair

Johannes Radinger johannesradinger at gmail.com
Tue Dec 10 05:42:25 PST 2013


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 at 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 at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
>
>
> _______________________________________________
> 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/4c670e37/attachment.html>


More information about the grass-user mailing list