In order to get a list, here is just one approach:
vals = os.popen(“r.stats –Nn your_map”).readlines()
Christian.
From: Jenny Turner
Sent: Tuesday, March 29, 2011 11:55 PM
To: GRASS user list
Subject: [GRASS-user] Retrieve list of values in Python
Greetings
I would like to know how can I
Antonio,
since the calculated statistics are stored as labels in the output map, you
have to use the @ operator in the mapcalc formula in order to access the
labels instead of the clump categories, in your case.
Regards,
Christian.
-Ursprüngliche Nachricht-
From: António Rocha
Monica,
I did similar things on slope values...have a look to the following code
snippet:
r.mapcalc slope_mult=int(slope*1000.0)
r.stats -nN input=slope_mult | awk '{print $1=$1 $1/1000}' | r.reclass --o
input=slope_mult output=slope_labeled
r.statistics --o -c base=base_map cover=slope_labeled
Monica,
try to use r.statistics with the average function/method. Pass you maps through
the cover= and base= parameters...
Christian.
From: Monica Buescu
Sent: Monday, February 28, 2011 4:27 PM
To: GRASS user list
Subject: [GRASS-user] calculating average value over a base map
Greetings
I
To: Christian Schwartze
Cc: GRASS user list
Subject: Re: [GRASS-user] calculating average value over a base map
Greetings Christian
Unfortunely it only works with CELL values. For instance, r.median uses more
than just CELL.
Is there any other alternative? Beucase for mode and median
Depending on what you want to do in detail, grass.run_command(“g.mlist”, ...)
may help ...
Christian.
From: Pedro Roma
Sent: Thursday, February 17, 2011 10:30 AM
To: GRASS user list
Subject: [GRASS-user] Find rasters by using a wildcard
Greetings
Currently, I'm using this expression to
Cc: Micha Silver mi...@arava.co.il; Christian Schwartze
christian.schwar...@uni-jena.de
Subject: Re: [GRASS-user] Changing raster boundaries
Christian:
how to change the boundaries of a raster map (simply expand the
border) without any automatic modification of map resolution
Hi GRASS users,
how to change the boundaries of a raster map (simply expand the border) without
any automatic modification of map resolution as it will happen when using
r.region map=.. n= ..s=.. w= e=.. ?
Thanks for some hint.
Christian.___
Try e.g g.findfile element=vector file=testmap
Christian
From: Helena Herrera
Sent: Monday, September 27, 2010 12:25 PM
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Python Script- Check if a raster exists
Hi
I'm doing a python script and, in a process, I need to check if a raster
See the notes and output sections of the g.findfile manpage. There you can find
additional information how to use the comand in scripts.
http://grass.fbk.eu/gdp/html_grass64/g.findfile.html
Christian.
From: Helena Herrera
Sent: Monday, September 27, 2010 12:47 PM
To: Christian Schwartze
Following code could be one approach:
os.system(cat %s | r.recode input=map_a output=map_recl % path_to_rules)
where path_to_rules is a previously created (temp) file containg the
reclassifiying rules as for example:
1:1:1.1:1.1
2:2:7.5:7.5
3:3:0.4:0.4
Christian.
From: Luisa Peña
Sent:
between two
given points (pixels). To do that, I need to get the coordinates of the points
as a input file for r.profile.
Margherita
2010/6/2 Christian Schwartze christian.schwar...@uni-jena.de
Why are you not using r.statistics, since it takes one base map (your path as
a raster
There is no way to use a vector geometry in mapcalculator (or mapcalc)
directly, hence, you have to convert it to raster before.
Christian.
--
From: António Rocha antonio.ro...@deimos.com.pt
Sent: Thursday, May 27, 2010 2:08 PM
To: GRASS user
Use r.mask as already done to identify your grey values only, then apply
r.mapcalc new_raster=if(MASK,orig_raster,null()).
Christian.
--
From: baobazz baob...@hotmail.fr
Sent: Thursday, May 27, 2010 11:59 AM
To: grass-user@lists.osgeo.org
Hi grass users,
does anybody know how to avoid the temporary use of disk space during execution
of r.fill.dir? For large input files it seems that large temporary files are
written as well since I got messages like no disk space left (running in a
minimized environment where not so much disk
,
Christian.
--
From: Markus Neteler nete...@osgeo.org
Sent: Wednesday, April 14, 2010 10:07 PM
To: Christian Schwartze christian.schwar...@uni-jena.de
Cc: GRASS user list grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] temporary maps/space during
Just a quick idea, when an underlying postgres/postgis database is
available:
- use v.out.ogr to import vector data to your postgis database, to
testtable
- now db.connect and db.login
- when connected, something like echo 'UPDATE testtable SET
wkb_geometry=envelope(wkb_geometry)' |
Hi,
try command g.gisenv MAPSET, it should print out current mapset as you
like...
Christian.
--
From: Tim Michelsen timmichel...@gmx-topmail.de
Sent: Thursday, December 10, 2009 12:45 AM
To: grass-user@lists.osgeo.org
Subject: [GRASS-user]
Dear GRASS user,
maybe you can help me in understanding the stream network map provided by
r.watshed analysis tool. Am i right in thinking that each segment given by an
odd integer drains into a segment with a lower identifier?
Many thanks,
You can change the NULL value using r.null map null=x to avoid the null()
handling. Is it your question..??
Christian.
-Ursprüngliche Nachricht-
Von: grass-user-boun...@lists.osgeo.org
[mailto:grass-user-boun...@lists.osgeo.org] Im Auftrag von Fulvio
Mastrogiovanni
Gesendet: Mittwoch, 1.
What just doesn't work? Tried this:
cat rule | r.reclass input=map_a output=map_b
while rule contains your new classes like
1 = 2 some labels
..
Christian
Hello, I', new in grass
I'm trying to do a raster reclassification (r.reclass) but i can't set the
rules. Someone can teach me how to do
http://grass.osgeo.org/wiki/GRASS_and_Python ...maybe your starting point.
Regards,
Christian.
Zitat von Gabriel Messner [EMAIL PROTECTED]:
I´d very grateful if anyone can point any tutorial on how to write scripts
in Python to perform routine tasks. I remember to have seen anyone at GRASS
Hi Gabriele,
using r.mapcalc and the @-operator within the calculation you have access to the
labels, but in IF statements it works only on labels that starts with a number
(int vals). So looking for a string is not possible.
But why not using the cats or int labels(with @) in mapcalc, then
Dear list,
can somebody explain me the differences between the flow direction raster
calculated by r.fill.dir and that one which comes from r.watershed. I know
about the different cats in both, but whats the background? Whats better?
Thanks a lot for answering!
Christian.
Hi GRASS users,
I was wondering if I do somewhat right all the time... There is r.in.gdal what I
use for the import of a geotiff. Basically the entries for the labels of the
cats are empty after the import. So I do some pipelining combined with awk,
like:
r.stats -n input=img | awk '{print $1,\
Thanks, now I know that r.category is only part of grass = 6.3 ;)
Christian.
Am Freitag, den 22.08.2008, 16:15 +0200 schrieb Markus Neteler:
On Fri, Aug 22, 2008 at 11:12 AM, Christian Schwartze
[EMAIL PROTECTED] wrote:
Hi GRASS users,
I was wondering if I do somewhat right all the time
Hi,
I have performed the following steps on raster A:
vectorize(A) -- clean by removing small areas -- rasterize back
Now I have cats with large gaps and not starting by 0, hence an expanded range
of cats. How can reorg so that range starts at 0 with step=1?
Thanks a lot!
Regards,
Christian.
.
Zitat von Nikos Alexandris [EMAIL PROTECTED]:
On Thu, 2008-07-17 at 11:59 +0200, Christian Schwartze wrote:
Hi,
I have performed the following steps on raster A:
vectorize(A) -- clean by removing small areas -- rasterize back
Now I have cats with large gaps and not starting by 0, hence
Thank you Maciej,
it solves the task in this way that the cats are gap-less now, but still starts
with x0. And the label column get lost.
Regards,
Christian.
Zitat von Maciej Sieczka [EMAIL PROTECTED]:
Christian Schwartze pisze:
Hi,
I have performed the following steps on raster
Dear GRASS users,
could somebody help me to find some solution for the following task?
I have a raster map representing many distinct areas (MAP_1) and a second int
raster with specific values (MAP_2). The result map should contain the same
areas of MAP_1 but with the max MAP_2 value of each area
Dear GRASS users,
could somebody help me to find some solution for the following task?
I have a raster map representing many distinct areas (MAP_1) and a second int
raster with specific values (MAP_2). The result map should contain the same
areas of MAP_1 but with the max MAP_2 value of each area
Hi,
Hi all,
1) v.overlay question
I have three maps: two area vectors (A and B), and a v.overlay result
(C). Is there a simple way to assign the percentage of areas in (A)
covered by the overlay (C)?
What I think of in a rush is to rasterize the areas first and afterwards asking
for the
Hi,
using e.g. postgres or mysql as storage backend for vector data you can use
modules like v.db.join or db.execute for complex querying your vector data.
Regards,
Christian.
Zitat von Wesley Roberts [EMAIL PROTECTED]:
Hi All,
Before I head into learning mySQL I would like to know if grass
the original label vals were
mapped to dbf-column type C. But why exporting only 80 chars?
Regards,
Christian.
Zitat von Hamish [EMAIL PROTECTED]:
Christian Schwartze wrote:
I use r.cross for combining the raster data values of up to
9 layers/maps. The combinations are stored in column label of each
Just now I read in the gdal description for shapefile driver:
String fields without an assigned width are treated as 80 characters.
How can I modify that?
Christian.
Zitat von Hamish [EMAIL PROTECTED]:
Christian Schwartze wrote:
I use r.cross for combining the raster data values of up to
9
Zitat von Hamish [EMAIL PROTECTED]:
Christian Schwartze
Ok and thanks, better to look at first within GRASS if
eveything is working fine
;) (in cats/ full category values) Because the reduced line
comes from QGIS
(selection tool). I forgot to say that following r.cross I
do
HI,
use parameter dsn to specify only the folder of your shape files and ignore the
layer param.
Regards,
Christian.
Zitat von Barbosa, A. Marcia [EMAIL PROTECTED]:
Hi,
Another beginner's question. I need to import big groups of shapefiles to
GRASS. So far I'm using
v.in.ogr
Hi,
I only know the way for raster data using r.thin to get a center line
for e.g. wide raster streams.
Christian.
Am Mittwoch, den 18.06.2008, 10:24 -0700 schrieb Aurora Geomatics:
Wondering if there is a simple way in GRASS to produce skeletons of
Polygons (rivers/streams), to find the
Hi,
don't know if I unterstood you right, but what about buffering your
polygons (v.buffer with buffer=50m), i.e. the buildings. So you get a
map of overlapping areas where features not more far away than 50
meters. Afterwards you can use v.to.rast for rasterizing the buffer
zones and describing
Dear GRASS user,
the problem I have is using r.water.outlet for some scripting in Python. Below I
want to explain the proceeding in detail. It should be mentioned in advance that
the necessary drainage raster has nearly 1 rows and columns, so it's not
really small...
I have a point shape file
Dear GRASS user,
the problem I have is using r.water.outlet for some scripting in Python. Below I
want to explain the proceeding in detail. It should be mentioned in advance that
the necessary drainage raster has nearly 1 rows and columns, so it's not
really small...
I have a point shape file
to just the area of each
basin before doing the other calculations, it might run a lot faster.
Michael
On 5/15/08 5:02 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Date: Thu, 15 May 2008 14:00:14 +0200
From: Christian Schwartze [EMAIL PROTECTED]
Subject: [GRASS-user] Multiple usage
42 matches
Mail list logo