[GRASS-user] 2 questions about usage of g.region

HEy

I have three questions:
1- Is it possible to define active region spatial resolution by selecting an image instead of putting values?

2- What is done with -a flag?

3- Just to confirm this, when an image is imported with r.in.gdal it is kept with its original resolution right? it only gets the active region spatial resolution when I process it right (e.g. mapcalc or somethingg)

Thanks
Kat

katrin eggert wrote:

HEy

I have three questions:
1- Is it possible to define active region spatial resolution by selecting an image instead of putting values?

Using a grass raster, yes. g.region rast=…

2- What is done with -a flag?

If you have , i.e. a resolution of 5 meters and the E-W extent is 99 meters, then with the -a flag the region will be reset to 100 m. Without the -a flag, the resolution will be recalculated so that it fits into the extents. So in the above case, without -a, the E-W res will be changed to 4.95

3- Just to confirm this, when an image is imported with r.in.gdal it is kept with its original resolution right? it only gets the active region spatial resolution when I process it right (e.g. mapcalc or somethingg)

AFAIK, yes.

On 03/02/2011 07:57, Micha Silver wrote:

katrin eggert wrote:

3- Just to confirm this, when an image is imported with r.in.gdal it
is kept with its original resolution right? it only gets the active
region spatial resolution when I process it right (e.g. mapcalc or
somethingg)

AFAIK, yes.

About which raster modules respect or ignore the current region, you could read some mails from Spetember last year, starting from here:

http://lists.osgeo.org/pipermail/grass-user/2010-September/057988.html

Hermann

Thanks Micha and Hermann for your feedback.
Just one very last question: in a Python script how can I make an variabel to equal to an image spatial resolution? (I mean, How can I retrieve an image spatial resolution)?
THanks

Best regards,
Kat

2011/2/3 Micha Silver <micha@arava.co.il>

katrin eggert wrote:

HEy

I have three questions:
1- Is it possible to define active region spatial resolution by selecting an image instead of putting values?

Using a grass raster, yes. g.region rast=…

2- What is done with -a flag?

If you have , i.e. a resolution of 5 meters and the E-W extent is 99 meters, then with the -a flag the region will be reset to 100 m. Without the -a flag, the resolution will be recalculated so that it fits into the extents. So in the above case, without -a, the E-W res will be changed to 4.95

3- Just to confirm this, when an image is imported with r.in.gdal it is kept with its original resolution right? it only gets the active region spatial resolution when I process it right (e.g. mapcalc or somethingg)

AFAIK, yes.

Thanks
Kat

This mail was received via Mail-SeCure System.


---

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

This mail was received via Mail-SeCure System.

  

There is some very good documentation on Python and GRASS. I hope
this helps. http://grass.osgeo.org/wiki/GRASS_and_Python

Mark

On Thu, Feb 3, 2011 at 9:57 AM, katrin eggert
<katrineggert1980@gmail.com> wrote:

Thanks Micha and Hermann for your feedback.
Just one very last question: in a Python script how can I make an variabel
to equal to an image spatial resolution? (I mean, How can I retrieve an
image spatial resolution)?
THanks
Best regards,
Kat

2011/2/3 Micha Silver <micha@arava.co.il>

katrin eggert wrote:

HEy

I have three questions:
1- Is it possible to define active region spatial resolution by selecting
an image instead of putting values?

Using a grass raster, yes. g.region rast=....

2- What is done with -a flag?

If you have , i.e. a resolution of 5 meters and the E-W extent is 99
meters, then with the -a flag the region will be reset to 100 m. Without the
-a flag, the resolution will be recalculated so that it fits into the
extents. So in the above case, without -a, the E-W res will be changed to
4.95

3- Just to confirm this, when an image is imported with r.in.gdal it is
kept with its original resolution right? it only gets the active region
spatial resolution when I process it right (e.g. mapcalc or somethingg)

AFAIK, yes.

Thanks
Kat
This mail was received via Mail-SeCure System.

________________________________
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

2011/2/3 katrin eggert <katrineggert1980@gmail.com>:

Thanks Micha and Hermann for your feedback.
Just one very last question: in a Python script how can I make an variabel
to equal to an image spatial resolution? (I mean, How can I retrieve an
image spatial resolution)?

raster_info() [1] e.g.

info = raster_info(map)

print info['nsres'], info['ewres']

Martin

[1] http://grass.osgeo.org/programming7/namespacepython_1_1raster.html#a69e4a61eb59a31608410b733d174b8a7

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Le 03/02/2011 00:20, katrin eggert a écrit :

1- Is it possible to define active region spatial resolution by
selecting an image instead of putting values?

You can also use your mouse. Load your image in the Layer manager, right
click on this map and select "Set computational region from selected map".

Thibault.