Re: [GRASS-user] Using r.buffer on image with geographic coordinates
On Mon, Mar 28, 2011 at 11:40 PM, Ned Horning horn...@amnh.org wrote: Hi Markus M. Thanks for the pointer but I'm still having a problem (terminal output pasted below) and wonder if I'm still accessing v.buffer2. The program stops because I run out of memory. I have 5.7 GB of physical and 5.8 GB for my swap and it's not enough. I ran make and make install in the v.buffer directory and ran configure, make and make install in /usr/local/src/grass6_devel. I expect I'm doing something stupid but am at a loss as to how to fix it. If you ran make in the v.buffer directory and afterwards configure, make and make install in /usr/local/src/grass6_devel, you would end up with v.buffer2. 1. run configure, make, but not make install in /usr/local/src/grass6_devel 2. run make in the v.buffer directory, watch out for errors to make sure it compiles all right 3. run make install in /usr/local/src/grass6_devel, but not again configure and/or make 4. that should give you the original v.buffer Any thoughts? Ned -- WARNING: Next edge was visited but it is not the first one !!! breaking loop WARNING: Next edge was visited but it is not the first one !!! breaking loop WARNING: Next edge was visited but it is not the first one !!! breaking loop 100% Writting buffers... 100% Building topology for vector map testBuf... Registering primitives... 1435962 primitives registered 115977416 vertices registered Number of nodes: 1435838 Number of primitives: 1435962 Number of points: 0 Number of lines: 0 Number of boundaries: 1435962 Number of centroids: 0 Number of areas: - Number of isles: - Snapping boundaries... Killed On 03/28/2011 07:44 AM, Markus Metz wrote: On Mon, Mar 28, 2011 at 12:39 PM, Ned Horninghorn...@amnh.org wrote: Markus, Thanks for fixing the code. I managed to compile v.buffer and I ran it in the grass65 terminal window and these are the errors I got. There were several of the Next edge was visited messages but I only cut out the last couple. Any idea what the problem might be? I'm running on 64 bit Ubuntu. All the best, Ned -- WARNING: Next edge was visited but it is not the first one !!! breaking loop WARNING: Next edge was visited but it is not the first one !!! breaking loop WARNING: Next edge was visited but it is not the first one !!! breaking loop WARNING: Next edge was visited but it is not the first one !!! breaking loop It seems that this is still v.buffer2, not v.buffer (a bit confusing because the stuff in vector/v.buffer2 is compiled as v.buffer, as is the stuff in vector/v.buffer). You need to either start grass from the source tree or run make install again in order to make use of the vector/v.buffer module. HTH, Markus M *** glibc detected *** d.vect: free(): invalid next size (normal): 0x013a5fc0 *** === Backtrace: = /lib/libc.so.6(+0x775b6)[0x7fc0f26965b6] /lib/libc.so.6(cfree+0x73)[0x7fc0f269ce83] /usr/local/grass-6.5.svn/lib/libgrass_vect.6.5.svn.so(Vect_destroy_line_struct+0x28)[0x7fc0f424f638] d.vect(plot1+0xb0a)[0x40876a] d.vect(main+0x1314)[0x4072d4] /lib/libc.so.6(__libc_start_main+0xfd)[0x7fc0f263dc4d] d.vect[0x403cd9] === Memory map: 0040-0040c000 r-xp 08:05 206110 /usr/local/grass-6.5.svn/bin/d.vect 0060b000-0060c000 r--p b000 08:05 206110 /usr/local/grass-6.5.svn/bin/d.vect 0060c000-0060d000 rw-p c000 08:05 206110 /usr/local/grass-6.5.svn/bin/d.vect 01398000-013b9000 rw-p 00:00 0 [heap] 7fc0e400-7fc0e4021000 rw-p 00:00 0 7fc0e4021000-7fc0e800 ---p 00:00 0 7fc0e97cd000-7fc0e97d9000 r-xp 08:05 531120 /lib/libnss_files-2.11.1.so 7fc0e97d9000-7fc0e99d8000 ---p c000 08:05 531120 /lib/libnss_files-2.11.1.so 7fc0e99d8000-7fc0e99d9000 r--p b000 08:05 531120 /lib/libnss_files-2.11.1.so 7fc0e99d9000-7fc0e99da000 rw-p c000 08:05 531120 /lib/libnss_files-2.11.1.so 7fc0e99da000-7fc0e99e4000 r-xp 08:05 531542 /lib/libnss_nis-2.11.1.so 7fc0e99e4000-7fc0e9be3000 ---p a000 08:05 531542 /lib/libnss_nis-2.11.1.so 7fc0e9be3000-7fc0e9be4000 r--p 9000 08:05 531542 /lib/libnss_nis-2.11.1.so 7fc0e9be4000-7fc0e9be5000 rw-p a000 08:05 531542 /lib/libnss_nis-2.11.1.so 7fc0e9be5000-7fc0e9bed000 r-xp 08:05 527981 /lib/libnss_compat-2.11.1.so 7fc0e9bed000-7fc0e9dec000 ---p 8000 08:05 527981 /lib/libnss_compat-2.11.1.so 7fc0e9dec000-7fc0e9ded000 r--p 7000 08:05 527981 /lib/libnss_compat-2.11.1.so 7fc0e9ded000-7fc0e9dee000 rw-p 8000 08:05 527981 /lib/libnss_compat-2.11.1.so 7fc0e9dee000-7fc0e9df1000 r-xp 08:05 523508 /lib/libgpg-error.so.0.4.0 7fc0e9df1000-7fc0e9ff ---p 3000 08:05 523508 /lib/libgpg-error.so.0.4.0 7fc0e9ff-7fc0e9ff1000 r--p 2000 08:05 523508 /lib/libgpg-error.so.0.4.0 7fc0e9ff1000-7fc0e9ff2000 rw-p 3000 08:05 523508
Re: [GRASS-user] Using r.buffer on image with geographic coordinates
On Tue, Mar 29, 2011 at 8:27 AM, Markus Metz markus.metz.gisw...@googlemail.com wrote: ... If you ran make in the v.buffer directory and afterwards configure, make and make install in /usr/local/src/grass6_devel, you would end up with v.buffer2. 1. run configure, make, but not make install in /usr/local/src/grass6_devel 2. run make in the v.buffer directory, watch out for errors to make sure it compiles all right 3. run make install in /usr/local/src/grass6_devel, but not again configure and/or make 4. that should give you the original v.buffer An alternative: simply modify vector/Makefile to point to v.buffer and not v.buffer2... Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac
Hello Grass users! I am working with GRASS 6.5 SVN (r45714, last weeks source) and try to run Python Scripts. After I solved the problem with the line endings, GRASS seems to be able to read my scripts (via launch script...). At least the interactive interface pops up correctly (it seems g.parser can read all my options etc.), but after executing it nothing happens and nothing is processed. I tried it with mapcalc but also with r.thin (one input, one output, so very simple). I don't know what is the problem or how can I check what the problem is... ...what I've tried already and which may cause the problem is that I cannot import grass.script (import grass.script) in the Terminal (pyhton) and/or IDLE... it says: module not found... Just for your information I run GRASS on a Apple Mac Snow Leopard (10.6.6) with Python 2.6.6. /johannes -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Output of g.proj?
Hello, I am trying to use the r.out.gmap script from grass-addons. This script generates map tiles for Google Maps based on an existing raster. I have generated a new location/mapset using the special EPSG code of 900913, defined at the end of /usr/local/share/proj/esri.extra. But when I try r.out.gmap it gives me an error: ERROR: projection for location google2 differs from required google map mercator projection current projection: +proj=merc +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +no_defs +a=6378137 +rf=298.257223563 +nadgrids=/usr/local/grass-6.4.1RC2/etc/nad/@null +to_meter=1 required projection: +proj=merc +lat_ts=0.00 +lon_0=0.00 +k_0=1.00 +x_0=0 +y_0=0 +no_defs +a=6378137 +b=6378137 (google2 being my new location). (This happens both with GRASS-6.4.1RC2 and 6.4.0RC4) The info on the current projection in the script comes from the output of g.proj -jf. This is slightly different from the information in esri.extra, which is identical to the required projection printed out in the error message. Hence a couple of quick questions: 1) Does the difference mean I did something wrong in the definition of the location? 2) Does it matter? If you use the -f ('force') option to r.out.gmap it seems to work. 3) If (not 1)(not 2), I would suggest changing the r.out.gmap script to reflect the current output from g.proj. TIA Thomas -- -- Thomas Huld Joint Research Centre of the European Commission T.P. 450 I-21027 Ispra, Italy phone: +39 0332785273 e-mail: thomas.h...@jrc.ec.europa.eu -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Re: GUI for ps.map ready for testing
Hi, 2011/3/29 Hamish hamis...@yahoo.com: just copy the files in to the right places manually (try to follow the Makefile), but really a 6.5 or 7 snapshot built from source is you best bet. it's quite easy, copy docs/*.html - gui/wxpython/docs gui_modules/*.py - gui/wxpython/gui_modules xml/*.xml - gui/wxpython/xml images/*.png - gui/images and run in `gui` $ make Martin -- Martin Landa landa.martin gmail.com * http://geo.fsv.cvut.cz/~landa ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] New location with .prj file in tcltk
Dear GRASS users and developers, I'm trying to create a new location with the Georeferenced file button in the Welcome window of the tcltk GUI, but an error message is output (see error.png in attachment). I tried with the gdc.prj file of the North Carolina data set and with other .prj files, and with three different releases of 6.4.0. With the Location wizard of the wxpython GUI the location is correctly created. Is this a bug of the tcltk GUI? Greetings Aldo Clerici Parma University attachment: error.png___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac
Hi Johannes, Sorry I couldn't get back to you sooner. But it seems like others have told you about the line ending issue. That's a real problem because most people (myself included) will want to start out by copying an example program from the GRASS site. ...and it will utterly fail to run. Anyway, now that your got it started, it is a debugging issue. Put in some debugging code like... print 'my program gets this far' ...at different places to see where it is getting stuck. This is tedious but always seems needed. Michael C. Michael Barton Director, Center for Social Dynamics Complexity Professor of Anthropology, School of Human Evolution Social Change Arizona State University voice: 480-965-6262 (SHESC), 480-727-9746 (CSDC) fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC) www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu On Mar 29, 2011, at 3:25 AM, grass-user-requ...@lists.osgeo.org wrote: Date: Tue, 29 Mar 2011 11:11:12 +0200 From: Johannes Radinger jradin...@gmx.at Subject: [GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac To: grass-user@lists.osgeo.org Message-ID: 20110329091112.282...@gmx.net Content-Type: text/plain; charset=utf-8 Hello Grass users! I am working with GRASS 6.5 SVN (r45714, last weeks source) and try to run Python Scripts. After I solved the problem with the line endings, GRASS seems to be able to read my scripts (via launch script...). At least the interactive interface pops up correctly (it seems g.parser can read all my options etc.), but after executing it nothing happens and nothing is processed. I tried it with mapcalc but also with r.thin (one input, one output, so very simple). I don't know what is the problem or how can I check what the problem is... ...what I've tried already and which may cause the problem is that I cannot import grass.script (import grass.script) in the Terminal (pyhton) and/or IDLE... it says: module not found... Just for your information I run GRASS on a Apple Mac Snow Leopard (10.6.6) with Python 2.6.6. /johannes -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac
Hello Michael, thank you for your answer and your tip with the debugging code, but it doesn't matter where I put it, I fail. I that case grass doesn't open anymore the interactive menu (from g.parser) for that script and I just get the error: my program gets this far ERROR: Required parameter newmap not set: (output) ERROR: Required parameter elevation not set: (input 1) ERROR: Required parameter geology not set: (input 2) if I leave the debugging code out, the interactive menu pops up and I can set the parameters, but nothing is afterwards processed. what am I doing wrong? /johannes Original-Nachricht Datum: Tue, 29 Mar 2011 07:40:28 -0700 Von: Michael Barton michael.bar...@asu.edu An: grass-user grass-user grass-user@lists.osgeo.org, Johannes Radinger jradin...@gmx.at Betreff: [GRASS-user] Problem with Python Scripts and grass.script(GRASS 6.5SVN) on Mac Hi Johannes, Sorry I couldn't get back to you sooner. But it seems like others have told you about the line ending issue. That's a real problem because most people (myself included) will want to start out by copying an example program from the GRASS site. ...and it will utterly fail to run. Anyway, now that your got it started, it is a debugging issue. Put in some debugging code like... print 'my program gets this far' ...at different places to see where it is getting stuck. This is tedious but always seems needed. Michael C. Michael Barton Director, Center for Social Dynamics Complexity Professor of Anthropology, School of Human Evolution Social Change Arizona State University voice:480-965-6262 (SHESC), 480-727-9746 (CSDC) fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC) www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu On Mar 29, 2011, at 3:25 AM, grass-user-requ...@lists.osgeo.org wrote: Date: Tue, 29 Mar 2011 11:11:12 +0200 From: Johannes Radinger jradin...@gmx.at Subject: [GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac To: grass-user@lists.osgeo.org Message-ID: 20110329091112.282...@gmx.net Content-Type: text/plain; charset=utf-8 Hello Grass users! I am working with GRASS 6.5 SVN (r45714, last weeks source) and try to run Python Scripts. After I solved the problem with the line endings, GRASS seems to be able to read my scripts (via launch script...). At least the interactive interface pops up correctly (it seems g.parser can read all my options etc.), but after executing it nothing happens and nothing is processed. I tried it with mapcalc but also with r.thin (one input, one output, so very simple). I don't know what is the problem or how can I check what the problem is... ...what I've tried already and which may cause the problem is that I cannot import grass.script (import grass.script) in the Terminal (pyhton) and/or IDLE... it says: module not found... Just for your information I run GRASS on a Apple Mac Snow Leopard (10.6.6) with Python 2.6.6. /johannes -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user -- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/de/go/dsl ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Mapset names and problems
Hi! All. This is a documentation of experience that I have faced after having named one of the mapsets with two words and a space eg. watershed analysis. There were a lot of problems in QGIS and GRASS as well for copying the data (raster n vector) and the values would not transfer. I hope there must be some indication while writing a name of mapset that it should be a single word. Thanks! Ambrish Dhaka ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac
The script I am trying is the simpliest form of a script calling just one function of GRASS (e.g. mapcalc or r.thin), attached you can find that script which can be applied e.g. on the spearfish rasterdataset...and in my opinion it is correct and in the correct order of commands as mentioned in the grass-wiki and with the correct line endings. /johannes #!/usr/bin/env python # # # MODULE: Modell # # AUTHOR(S): Johannes Radinger # # PURPOSE: # # DATE: Tue Feb 01 14:00:50 2011 # # #%Module #% description: mapcalc test #%End #%option #% key: newmap #% type: string #% gisprompt: new,cell,raster #% description: output #% required: yes #%end #%option #% key: elevation #% type: string #% gisprompt: old,cell,raster #% description: input 1 #% required: yes #%end #%option #% key: geology #% type: string #% gisprompt: old,cell,raster #% description: input 2 #% required: yes #%end import sys import os import grass.script as grass def main(): grass.mapcalc(${newmap} = ${elevation} * ${geology}, newmap = options['newmap'], elevation = options['elevation'], geology = options['geology']) if __name__ == __main__: options, flags = grass.parser() main() Am 29.03.2011 um 17:38 schrieb Michael Barton: It looks like it it is going to the GRASS commmand before you push the run button. So I think you have the commands in the wrong place in the script. Trying grabbing a python script out of the scripts directory in GRASS 7. Since those all work, you should be able to modify it bit by bit to transform it to yours. Michael C. Michael Barton Director, Center for Social Dynamics Complexity Professor of Anthropology, School of Human Evolution Social Change Arizona State University voice:480-965-6262 (SHESC), 480-727-9746 (CSDC) fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC) www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu On Mar 29, 2011, at 8:35 AM, Johannes Radinger wrote: Hello Michael, thank you for your answer and your tip with the debugging code, but it doesn't matter where I put it, I fail. I that case grass doesn't open anymore the interactive menu (from g.parser) for that script and I just get the error: my program gets this far ERROR: Required parameter newmap not set: (output) ERROR: Required parameter elevation not set: (input 1) ERROR: Required parameter geology not set: (input 2) if I leave the debugging code out, the interactive menu pops up and I can set the parameters, but nothing is afterwards processed. what am I doing wrong? /johannes Original-Nachricht Datum: Tue, 29 Mar 2011 07:40:28 -0700 Von: Michael Barton michael.bar...@asu.edu An: grass-user grass-user grass-user@lists.osgeo.org, Johannes Radinger jradin...@gmx.at Betreff: [GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac Hi Johannes, Sorry I couldn't get back to you sooner. But it seems like others have told you about the line ending issue. That's a real problem because most people (myself included) will want to start out by copying an example program from the GRASS site. ...and it will utterly fail to run. Anyway, now that your got it started, it is a debugging issue. Put in some debugging code like... print 'my program gets this far' ...at different places to see where it is getting stuck. This is tedious but always seems needed. Michael C. Michael Barton Director, Center for Social Dynamics Complexity Professor of Anthropology, School of Human Evolution Social Change Arizona State University voice: 480-965-6262 (SHESC), 480-727-9746 (CSDC) fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC) www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu On Mar 29, 2011, at 3:25 AM, grass-user-requ...@lists.osgeo.org wrote: Date: Tue, 29 Mar 2011 11:11:12 +0200 From: Johannes Radinger jradin...@gmx.at Subject: [GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac To: grass-user@lists.osgeo.org Message-ID: 20110329091112.282...@gmx.net Content-Type: text/plain; charset=utf-8 Hello Grass users! I am working with GRASS 6.5 SVN (r45714, last weeks source) and try to run Python Scripts. After I solved the problem with the line endings, GRASS seems to be able to read my scripts (via launch script...). At least the interactive interface pops up correctly (it seems g.parser can read all my options etc.), but after executing it nothing happens and nothing is processed. I tried it with mapcalc but also with r.thin (one input, one output, so very simple). I
Re: [GRASS-user] DEM_corrected.zip.gz (grass-user@lists.osgeo.org)
Hi, Do you have any problem with the DEM? Which is the spatial reference of the DEM? Best, Edgar Pimiento Chamorro e_pimie...@yahoo.com From: gcordobaguerr...@gmail.com gcordobaguerr...@gmail.com To: grass-user@lists.osgeo.org Cc: twey...@lsu.edu Sent: Tue, March 29, 2011 12:27:39 PM Subject: [GRASS-user] DEM_corrected.zip.gz (grass-user@lists.osgeo.org) I've shared DEM_corrected.zip.gz Click to open: * DEM_corrected.zip.gz Google Docs makes it easy to create, store and share online documents, spreadsheets and presentations. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Retrieve list of values in Python
Greetings I would like to know how can I retrieve the list of available values in a Raster map in a Python Script? Thanks Best regards, Jenny Turner ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Retrieve list of values in Python
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 retrieve the list of available values in a Raster map in a Python Script? Thanks Best regards, Jenny Turner ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Retrieve list of values in Python
Hi, 2011/3/30 Christian Schwartze christian.schwar...@uni-jena.de: In order to get a list, here is just one approach: vals = os.popen(“r.stats –Nn your_map”).readlines() use GRASS Scripting Library [1] grass.read_command('r.stats', flags='Nn',input = 'map').splitlines() Martin [1] http://grass.osgeo.org/programming7/pythonlib.html -- Martin Landa landa.martin gmail.com * http://geo.fsv.cvut.cz/~landa ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user