Re: [GRASS-user] Retrieve list of values in Python

2011-03-29 Thread Christian Schwartze
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

Re: [GRASS-user] Using output from r.statistics

2011-03-02 Thread Christian Schwartze
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

Re: [GRASS-user] calculating average value over a base map

2011-03-01 Thread Christian Schwartze
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

Re: [GRASS-user] calculating average value over a base map

2011-02-28 Thread Christian Schwartze
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

Re: [GRASS-user] calculating average value over a base map

2011-02-28 Thread Christian Schwartze
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

Re: [GRASS-user] Find rasters by using a wildcard

2011-02-17 Thread Christian Schwartze
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

Re: [GRASS-user] Changing raster boundaries

2010-10-15 Thread Christian Schwartze
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

[GRASS-user] Changing raster boundaries

2010-10-02 Thread Christian Schwartze
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.___

Re: [GRASS-user] Python Script- Check if a raster exists

2010-09-27 Thread Christian Schwartze
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

Re: [GRASS-user] Python Script- Check if a raster exists

2010-09-27 Thread Christian Schwartze
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

Re: [GRASS-user] Python Script for changing raster values

2010-09-07 Thread 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:

Re: [GRASS-user] get coords from a raster

2010-06-03 Thread Christian Schwartze
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

Re: [GRASS-user] Using a polygon as a Mask

2010-05-27 Thread Christian Schwartze
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

Re: [GRASS-user] Extracting grey features from an image

2010-05-27 Thread Christian Schwartze
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

[GRASS-user] temporary maps/space during r.fill.dir execution

2010-04-14 Thread Christian Schwartze
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

Re: [GRASS-user] temporary maps/space during r.fill.dir execution

2010-04-14 Thread Christian Schwartze
, 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

Re: [GRASS-user] Uploading bounding box of vectors to database?

2010-01-05 Thread Christian Schwartze
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)' |

Re: [GRASS-user] Show / Print current mapset

2009-12-10 Thread Christian Schwartze
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]

[GRASS-user] Short r.watershed question

2009-08-24 Thread Christian Schwartze
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,

AW: [GRASS-user] Some issues with r.mapcalc

2009-04-01 Thread Christian Schwartze
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.

Re: [GRASS-user] reclass

2009-03-19 Thread Christian Schwartze
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

Re: [GRASS-user] How to write scripts in GRASS

2008-10-08 Thread Christian Schwartze
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

Re: [GRASS-user] r.mapcalc concatenates values?

2008-09-10 Thread Christian Schwartze
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

[GRASS-user] different flow directions

2008-08-27 Thread Christian Schwartze
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.

[GRASS-user] Automate way for filling category labels

2008-08-22 Thread Christian Schwartze
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,\

Re: [GRASS-user] Automate way for filling category labels

2008-08-22 Thread Christian Schwartze
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

[GRASS-user] Reorg cat entry?

2008-07-17 Thread Christian Schwartze
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.

Re: [GRASS-user] Reorg cat entry?

2008-07-17 Thread Christian Schwartze
. 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

Re: [GRASS-user] Reorg cat entry?

2008-07-17 Thread Christian Schwartze
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

[GRASS-user] (no subject)

2008-07-14 Thread Christian Schwartze
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

[GRASS-user] r.mapcalc and producing a max value map

2008-07-14 Thread Christian Schwartze
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

Re: [GRASS-user] Two questions - vector data and Mac install

2008-06-25 Thread Christian Schwartze
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

Re: [GRASS-user] Vector dbf files + Spatial join

2008-06-24 Thread Christian Schwartze
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

Re: [GRASS-user] problem with column label using r.cross

2008-06-24 Thread Christian Schwartze
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

Re: [GRASS-user] problem with column label using r.cross

2008-06-24 Thread Christian Schwartze
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

Re: [GRASS-user] problem with column label using r.cross

2008-06-24 Thread Christian Schwartze
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

Re: [GRASS-user] import multiple shapefiles automatically

2008-06-19 Thread Christian Schwartze
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

Re: [GRASS-user] Centerlines of Polygons (skeletons)

2008-06-18 Thread Christian Schwartze
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

Re: [GRASS-user] Enclose the polygons within 50 metres

2008-06-17 Thread Christian Schwartze
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

[GRASS-user] Multiple usage of r.water.outlet

2008-05-15 Thread Christian Schwartze
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

[GRASS-user] Multiple usage of r.water.outlet

2008-05-15 Thread Christian Schwartze
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

Re: [GRASS-user] Multiple usage of r.water.outlet

2008-05-15 Thread Christian Schwartze
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