[GRASS-user] Help - Output difference between ARCGIS enviroment settings and GRASS g.region function

Markus Metz markus.metz.giswork at googlemail.com
Tue May 8 12:44:00 EDT 2012


On Tue, May 8, 2012 at 6:09 PM, Alejandro Coca Castro <acocac at gmail.com> wrote:
> Hi, i tried to convert the following enviroments settings to GRASS g.region
> and r.mask for the next ARCGIS output (ASCII file):
>
>     fileTIF = r"x:\test\fileTIF.tif"
>     MASK = r"x:\test\mask_file"
>     env.extent = fileTIF
>     env.snapRaster = MASK
>     env.mask = MASK
>     fileGRD = r"x:\test\fileGRD"
>     outCon = Con(fileTIF, fileTIF, "", "VALUE >= 0")
>     outCon.save(fileGRD)
>     fileASC = r"x:\test\fileASC.asc"
>     env.workspace = fileGRD
>     RasterToASCII_conversion(fileGRD,fileASC)
>
> So, i put on the GRASS command-line:
>
I would modify the work flow a bit:
> r.mask input=mask_file at default
Set the region before any raster operations, i.e. before r.mask

> g.region rast=fileTIF at default res=0.00208333333 align=MASK at default
The options res= and align= may not go well together. Do you want to
have current region aligned to mask_file or do you want a resolution
of res=0.00208333333? BTW, more accurate would be res=00:00:07.5

Thus rather
g.region rast=fileTIF at default align=mask_file at default
r.mask input=mask_file at default

> r.mapcalc fileGRD = if(fileTIF at default  < 0 , null(), fileTIF at default)
> r.out.arc input= fileGRD at default output=x:\test\fileASC_grass.asc
>
> However, the ArcGIS and GRASS outputs had a different extend and curiously
> the GRASS output didn't snap their cells with the MASK. Also, when i observe
> the GRASS output cellsize, it only has the first 6 decimals (f.e.
> 0.002083)....
>
> Finally i tried to setup the parameters of g.region with the ArcGIS output
> but GRASS output definetly didnt have the same properties of ArcGIS output
> (cellsize, columns and rows, extend)

You can set the extents and resolution manually with g.region n= e= s=
w= res= (rows and columns will be determined from that).

Markus M

>
> If somebody knows how can i fix it, i'll be grateful,
>
> Thanks in advance,
>
> Alejandro
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


More information about the grass-user mailing list