Re: [GRASS-user] Returning values to Python
Kevin Williams wrote: Firstly I apologize if this is a duplicate, but I am not getting my own posts emailed to me, and I don't see them in the list archive, so I am using another email account. How does one return attribute values from a call to the 'r.what' module running in a python script? When this query executes, it prints the result to the terminal, but I need to get the value back in the script. One of the documentation pages mentioned a function stdout2dict from grass.pygrass.modules, but it does not look like this is in the pygrass package any longer? If you use grass.script.raster_what(), it returns a list of dictionaries. AFAICT, PyGRASS requires you to add stdout_=PIPE, then you can get the output as a string from module.outputs[stdout].value. -- Glynn Clements gl...@gclements.plus.com ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] python error starting grass70 in ubuntu 12.04
Dear all, I am getting this python error when I try to start grass70 in an ubuntu 12-04 'dockerized' virtual machine (see https://registry.hub.docker.com/u/javimarlop/ubuntugis-docker/dockerfile/ for more info and details): A) As root: root@bfc38ad6d394:/# grass70 -text Traceback (most recent call last): File /usr/bin/grass70, line 1150, in module check_shell() File /usr/bin/grass70, line 771, in check_shell sh = os.path.basename(os.getenv('SHELL')) File /usr/lib/python2.7/posixpath.py, line 112, in basename i = p.rfind('/') + 1 AttributeError: 'NoneType' object has no attribute 'rfind' B) As a different user: root@bfc38ad6d394:/# su javier javier@bfc38ad6d394:/$ grass70 -text Traceback (most recent call last): File /usr/bin/grass70, line 1159, in module set_paths() File /usr/bin/grass70, line 367, in set_paths if sys_man_path: UnboundLocalError: local variable 'sys_man_path' referenced before assignment Python version is 2.7.3. and grass70 was installed using the grass-devel ppa. Does anyone have a clue? Thank you very much and cheers, Javier ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Stopping/killing a puased command
Hi, I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu). The MarZone command should run in a loop where it recives new input from GRASS in each iteration. My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop. It ends with Press return to exit. on screen. In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer): Like this: perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings. My question is, is there a way to somehow catch, that the software is ready (when it prints Press return to exit.), an kill it then? Any idea? Thanks for helping, Stefan ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Stopping/killing a puased command
Hi Stefan, Many thanks, that sounds like a good idea. MarZone produces output files by default, and I could regularly check if the last output file has been produced. But how can I do it in parallell to executing MarZone (I mean in the same script?), could you point me to the relevant command(s)? Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:19 An: Blumentrath, Stefan; grass-user@lists.osgeo.org Betreff: Re: [GRASS-user] Stopping/killing a puased command -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Stefan, can you pipe the MarZone output into a tmp file, check that file in regular intervals for the desired string and stop the process if the string is found. Not the most beautiful way I can think of but maybe an option .. Cheers, Stefan On 10/30/2014 09:06 AM, Blumentrath, Stefan wrote: Hi, I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu). The MarZone command should run in a loop where it recives new input from GRASS in each iteration. My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop. It ends with Press return to exit. on screen. In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer): Like this: perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings. My question is, is there a way to somehow catch, that the software is ready (when it prints Press return to exit.), an kill it then? Any idea? Thanks for helping, Stefan ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user - -- Stefan Lüdtke Section 5.4- Hydrology Tel.: +49 331 288 2821 Fax: +49 331 288 1570 Email: slued...@gfz-potsdam.de Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ (GFZ German Research Centre for Geoscience) Stiftung des öff. Rechts Land Brandenburg Telegrafenberg, 14473 Potsdam - --- PGP Public Key: http://bit.ly/13d9Sca -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJUUfSTAAoJEB5GAbKcg+D8SLAH/1gAW/aMmCP4Ac3qgQFKQVBY CK8OKH/I9ZAFUuG16uBj/fOZ2agm8N3Sz6xjZV9NDPk4pPz2PK3U2OTDT7DH8zeM cvSJnETrPonCRUIinW0zWa/aU7hQsKd7fQ+cm5I8oF5q91krhuOFqGPDCvdtD0bf qBKyuK5GBjNWhtHrQuKJMokaAix8W4oXUCAYZISlSQ1S2wDC/6PJKZe3jQTp1LCI evyj8+HQ4dopbgpMFHZH6rs3G/CtDkxM8GZLVViyxYsxf2ViwrcRnwK8hQ7HcZaA AAel5YMgCKgyEICpgqf5l7i+tfHypNewxI88/K1ohv+XcOj8hzHRpO62AtXxJoI= =1Ms6 -END PGP SIGNATURE- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Stopping/killing a puased command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Stefan, can you pipe the MarZone output into a tmp file, check that file in regular intervals for the desired string and stop the process if the string is found. Not the most beautiful way I can think of but maybe an option .. Cheers, Stefan On 10/30/2014 09:06 AM, Blumentrath, Stefan wrote: Hi, I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu). The MarZone command should run in a loop where it recives new input from GRASS in each iteration. My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop. It ends with Press return to exit. on screen. In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer): Like this: perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings. My question is, is there a way to somehow catch, that the software is ready (when it prints Press return to exit.), an kill it then? Any idea? Thanks for helping, Stefan ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user - -- Stefan Lüdtke Section 5.4- Hydrology Tel.: +49 331 288 2821 Fax: +49 331 288 1570 Email: slued...@gfz-potsdam.de Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ (GFZ German Research Centre for Geoscience) Stiftung des öff. Rechts Land Brandenburg Telegrafenberg, 14473 Potsdam - --- PGP Public Key: http://bit.ly/13d9Sca -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJUUfSTAAoJEB5GAbKcg+D8SLAH/1gAW/aMmCP4Ac3qgQFKQVBY CK8OKH/I9ZAFUuG16uBj/fOZ2agm8N3Sz6xjZV9NDPk4pPz2PK3U2OTDT7DH8zeM cvSJnETrPonCRUIinW0zWa/aU7hQsKd7fQ+cm5I8oF5q91krhuOFqGPDCvdtD0bf qBKyuK5GBjNWhtHrQuKJMokaAix8W4oXUCAYZISlSQ1S2wDC/6PJKZe3jQTp1LCI evyj8+HQ4dopbgpMFHZH6rs3G/CtDkxM8GZLVViyxYsxf2ViwrcRnwK8hQ7HcZaA AAel5YMgCKgyEICpgqf5l7i+tfHypNewxI88/K1ohv+XcOj8hzHRpO62AtXxJoI= =1Ms6 -END PGP SIGNATURE- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Stopping/killing a puased command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 So maybe that's the part I did not consider ... :-) The people more experienced in shell scripting might help here. I would go and start MarZone with and ampersand http://bashitout.com/2013/05/18/Ampersands-on-the-command-line.html and than proceed in while loop .. But that is all wild guessing .. On 10/30/2014 09:27 AM, Blumentrath, Stefan wrote: Hi Stefan, Many thanks, that sounds like a good idea. MarZone produces output files by default, and I could regularly check if the last output file has been produced. But how can I do it in parallell to executing MarZone (I mean in the same script?), could you point me to the relevant command(s)? Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:19 An: Blumentrath, Stefan; grass-user@lists.osgeo.org Betreff: Re: [GRASS-user] Stopping/killing a puased command Hi Stefan, can you pipe the MarZone output into a tmp file, check that file in regular intervals for the desired string and stop the process if the string is found. Not the most beautiful way I can think of but maybe an option .. Cheers, Stefan On 10/30/2014 09:06 AM, Blumentrath, Stefan wrote: Hi, I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu). The MarZone command should run in a loop where it recives new input from GRASS in each iteration. My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop. It ends with Press return to exit. on screen. In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer): Like this: perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings. My question is, is there a way to somehow catch, that the software is ready (when it prints Press return to exit.), an kill it then? Any idea? Thanks for helping, Stefan ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user - -- Stefan Lüdtke Section 5.4- Hydrology Tel.: +49 331 288 2821 Fax: +49 331 288 1570 Email: slued...@gfz-potsdam.de Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ (GFZ German Research Centre for Geoscience) Stiftung des öff. Rechts Land Brandenburg Telegrafenberg, 14473 Potsdam - --- PGP Public Key: http://bit.ly/13d9Sca -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJUUfj2AAoJEB5GAbKcg+D8sLoH/1IvG7FzP2OjKRSD0U7BhvdV 75VdkAuvmqxEKKR9Qqg/tW0VE8R6sgh1b7awCrSe/z9ji+sSWaZ5lE+XXjjb2Tph Yl0AHrRS/8YYp4f9ILzjytdd2KppQJwPvdVWBUcvpEOVMBBKIcQ0kTZBNM/lQLp1 Df+RrdqoEaWP6dXu+qLmMGFPjoPj3yVOwTLwQZsl24c5btCtzbwVTjNwNDm1AlMo qp6H+NLp/sKwqa8/jAqw2QG2Je+rIm4AomgOj/LxE5e1a9gTk8xYiTRWP4fZf15V 77aiiCfB5TSv41VyS+JrbSc7qG7IV+RkX7WK30ESyB+Fxy+V1V5e9yZy6b8x9ME= =B4/w -END PGP SIGNATURE- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Returning values to Python
On Thu, Oct 30, 2014 at 8:04 AM, Glynn Clements gl...@gclements.plus.com wrote: One of the documentation pages mentioned a function stdout2dict from grass.pygrass.modules, but it does not look like this is in the pygrass package any longer? If you use grass.script.raster_what(), it returns a list of dictionaries. AFAICT, PyGRASS requires you to add stdout_=PIPE, then you can get the output as a string from module.outputs[stdout].value. or simplier: module.outputs.stdout or using directly the C API through python with: {{{ from grass.pygrass.vector import VectorTopo from grass.pygrass.raster import RasterRow from grass.pygrass.gis.region import Region with RasterRow('elevation', mode='r') as rast: with VectorTopo('hospitals', mode='r') as hospitals: region = Region() for hosp in hospitals: value = rast.get_value(hosp, region) if value is not None: print(hosp.cat, value) }}} Pietro ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Stopping/killing a puased command
Great! Thanks! That looks very promising and should do the trick. I shall try that... Many thanks again for your help! Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:38 An: Blumentrath, Stefan Cc: grass-user Betreff: Re: AW: [GRASS-user] Stopping/killing a puased command -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 So maybe that's the part I did not consider ... :-) The people more experienced in shell scripting might help here. I would go and start MarZone with and ampersand http://bashitout.com/2013/05/18/Ampersands-on-the-command-line.html and than proceed in while loop .. But that is all wild guessing .. On 10/30/2014 09:27 AM, Blumentrath, Stefan wrote: Hi Stefan, Many thanks, that sounds like a good idea. MarZone produces output files by default, and I could regularly check if the last output file has been produced. But how can I do it in parallell to executing MarZone (I mean in the same script?), could you point me to the relevant command(s)? Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:19 An: Blumentrath, Stefan; grass-user@lists.osgeo.org Betreff: Re: [GRASS-user] Stopping/killing a puased command Hi Stefan, can you pipe the MarZone output into a tmp file, check that file in regular intervals for the desired string and stop the process if the string is found. Not the most beautiful way I can think of but maybe an option .. Cheers, Stefan On 10/30/2014 09:06 AM, Blumentrath, Stefan wrote: Hi, I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu). The MarZone command should run in a loop where it recives new input from GRASS in each iteration. My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop. It ends with Press return to exit. on screen. In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer): Like this: perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings. My question is, is there a way to somehow catch, that the software is ready (when it prints Press return to exit.), an kill it then? Any idea? Thanks for helping, Stefan ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user - -- Stefan Lüdtke Section 5.4- Hydrology Tel.: +49 331 288 2821 Fax: +49 331 288 1570 Email: slued...@gfz-potsdam.de Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ (GFZ German Research Centre for Geoscience) Stiftung des öff. Rechts Land Brandenburg Telegrafenberg, 14473 Potsdam - --- PGP Public Key: http://bit.ly/13d9Sca -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJUUfj2AAoJEB5GAbKcg+D8sLoH/1IvG7FzP2OjKRSD0U7BhvdV 75VdkAuvmqxEKKR9Qqg/tW0VE8R6sgh1b7awCrSe/z9ji+sSWaZ5lE+XXjjb2Tph Yl0AHrRS/8YYp4f9ILzjytdd2KppQJwPvdVWBUcvpEOVMBBKIcQ0kTZBNM/lQLp1 Df+RrdqoEaWP6dXu+qLmMGFPjoPj3yVOwTLwQZsl24c5btCtzbwVTjNwNDm1AlMo qp6H+NLp/sKwqa8/jAqw2QG2Je+rIm4AomgOj/LxE5e1a9gTk8xYiTRWP4fZf15V 77aiiCfB5TSv41VyS+JrbSc7qG7IV+RkX7WK30ESyB+Fxy+V1V5e9yZy6b8x9ME= =B4/w -END PGP SIGNATURE- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Stopping/killing a puased command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 you are welcome! On 10/30/2014 10:04 AM, Blumentrath, Stefan wrote: Great! Thanks! That looks very promising and should do the trick. I shall try that... Many thanks again for your help! Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:38 An: Blumentrath, Stefan Cc: grass-user Betreff: Re: AW: [GRASS-user] Stopping/killing a puased command So maybe that's the part I did not consider ... :-) The people more experienced in shell scripting might help here. I would go and start MarZone with and ampersand http://bashitout.com/2013/05/18/Ampersands-on-the-command-line.html and than proceed in while loop .. But that is all wild guessing .. On 10/30/2014 09:27 AM, Blumentrath, Stefan wrote: Hi Stefan, Many thanks, that sounds like a good idea. MarZone produces output files by default, and I could regularly check if the last output file has been produced. But how can I do it in parallell to executing MarZone (I mean in the same script?), could you point me to the relevant command(s)? Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:19 An: Blumentrath, Stefan; grass-user@lists.osgeo.org Betreff: Re: [GRASS-user] Stopping/killing a puased command Hi Stefan, can you pipe the MarZone output into a tmp file, check that file in regular intervals for the desired string and stop the process if the string is found. Not the most beautiful way I can think of but maybe an option .. Cheers, Stefan On 10/30/2014 09:06 AM, Blumentrath, Stefan wrote: Hi, I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu). The MarZone command should run in a loop where it recives new input from GRASS in each iteration. My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop. It ends with Press return to exit. on screen. In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer): Like this: perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings. My question is, is there a way to somehow catch, that the software is ready (when it prints Press return to exit.), an kill it then? Any idea? Thanks for helping, Stefan ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user - -- Stefan Lüdtke Section 5.4- Hydrology Tel.: +49 331 288 2821 Fax: +49 331 288 1570 Email: slued...@gfz-potsdam.de Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ (GFZ German Research Centre for Geoscience) Stiftung des öff. Rechts Land Brandenburg Telegrafenberg, 14473 Potsdam - --- PGP Public Key: http://bit.ly/13d9Sca -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJUUgArAAoJEB5GAbKcg+D8PV0H/i72p5+bRH3MoKx7fANKq2kO metBFAY8vUBKStWE5OjSjqJjl+9P+4fh5rsvfb5gcF0gAEmoed3nykAtbZT6DmcP mS23LL8YVqIeyADl3GBVANEKSHqX5ba/09tL+P+jB5j/dPzcoNalPX7zZC9y486Q bA8l8n6R+m4WZaWAHrtqMyuwBVGn6W6MUKsueuVxf4DPZsWwPCTRnw3J1yhSrkqs DfMlvKUsxXaNOdPmLpbmtQHhFxXai5wlZJP3/pZaHIbi11dtw5uPNMc2Mn/9dGbo b2a+uoCfc5D23519HVQ38AbPS8a+wRYRA6dzA+YZaA22Db28UhXHb/13/G1E0Dk= =advJ -END PGP SIGNATURE- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] mounting a read-only PERMANENT from remote server
Hello, I know that people work with entire GISDBASES on remote server, often via NFS, but does anyone have experience with mounting only one mapset from a remote server into a location on the local machine ? Moritz ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] g.gui.animation fails at launching
Hi all, I'm experiencing a problem in launching g.gui.animation.. wich doesn't load and it returns me the following error: Error in atexit._run_exitfuncs ..here the complete output: http://pastebin.com/FwMQa1jF I compiled GRASS yesterday (checking out the grass70 release version), it seemed fine and I used this configure: ./configure --with-proj-share=/usr/local/share/proj/ --with-python --with-cxx --with-freetype --with-freetype-includes=/usr/include/freetype2/ --with-includes=/usr/local/lib --with-wxwidgets --enable-largefile --enable-64bit --with-sqlite --with-sqlite-includes=/usr/include/ --with-opengl --with-postgres --with-postgres-includes=/usr/include/postgresql/ --with-tcltk-includes=/usr/include/tcl8.5 --with-gdal --with-netcdf --with-ffmpeg --with-motif --with-geos --with-odbc --with-mysql --with-mysql-includes=/usr/include/mysql/ Many thanks, Annalisa ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Stopping/killing a puased command
Hi again, it was as simple as this: ./MarZone_x64.exe wait Neither while loop nor checking for files needed (http://stackoverflow.com/questions/14254118/waiting-for-background-processes-to-finish-before-exiting-script). That one will save me hours in processing time and will avoid trouble with unexpectedly long running processes! Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 10:08 An: Blumentrath, Stefan Cc: grass-user Betreff: Re: AW: AW: [GRASS-user] Stopping/killing a puased command -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 you are welcome! On 10/30/2014 10:04 AM, Blumentrath, Stefan wrote: Great! Thanks! That looks very promising and should do the trick. I shall try that... Many thanks again for your help! Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:38 An: Blumentrath, Stefan Cc: grass-user Betreff: Re: AW: [GRASS-user] Stopping/killing a puased command So maybe that's the part I did not consider ... :-) The people more experienced in shell scripting might help here. I would go and start MarZone with and ampersand http://bashitout.com/2013/05/18/Ampersands-on-the-command-line.html and than proceed in while loop .. But that is all wild guessing .. On 10/30/2014 09:27 AM, Blumentrath, Stefan wrote: Hi Stefan, Many thanks, that sounds like a good idea. MarZone produces output files by default, and I could regularly check if the last output file has been produced. But how can I do it in parallell to executing MarZone (I mean in the same script?), could you point me to the relevant command(s)? Cheers Stefan Von: Stefan Lüdtke slued...@gfz-potsdam.de Gesendet: Donnerstag, 30. Oktober 2014 09:19 An: Blumentrath, Stefan; grass-user@lists.osgeo.org Betreff: Re: [GRASS-user] Stopping/killing a puased command Hi Stefan, can you pipe the MarZone output into a tmp file, check that file in regular intervals for the desired string and stop the process if the string is found. Not the most beautiful way I can think of but maybe an option .. Cheers, Stefan On 10/30/2014 09:06 AM, Blumentrath, Stefan wrote: Hi, I am trying to combine a commandline tool (MarZone) with GRASS in a shell script (MSYS in OSGeo4W or Ubuntu). The MarZone command should run in a loop where it recives new input from GRASS in each iteration. My scripts works in principle, however, unlike other command line tools, MarZone does not end when it is done, but one has to press enter to stop. It ends with Press return to exit. on screen. In order to handle this in a loop, I simply kill the process after the time I expect the sofware to run (plus a little time buffer): Like this: perl -e 'alarm shift @ARGV; exec @ARGV' 60 ./MarZone_x64.exe Unfortunately, this is neither an effient nor a stable solution as the time the software runs can vary quite a bit, depending on some parameter settings. My question is, is there a way to somehow catch, that the software is ready (when it prints Press return to exit.), an kill it then? Any idea? Thanks for helping, Stefan ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user - -- Stefan Lüdtke Section 5.4- Hydrology Tel.: +49 331 288 2821 Fax: +49 331 288 1570 Email: slued...@gfz-potsdam.de Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ (GFZ German Research Centre for Geoscience) Stiftung des öff. Rechts Land Brandenburg Telegrafenberg, 14473 Potsdam - --- PGP Public Key: http://bit.ly/13d9Sca -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJUUgArAAoJEB5GAbKcg+D8PV0H/i72p5+bRH3MoKx7fANKq2kO metBFAY8vUBKStWE5OjSjqJjl+9P+4fh5rsvfb5gcF0gAEmoed3nykAtbZT6DmcP mS23LL8YVqIeyADl3GBVANEKSHqX5ba/09tL+P+jB5j/dPzcoNalPX7zZC9y486Q bA8l8n6R+m4WZaWAHrtqMyuwBVGn6W6MUKsueuVxf4DPZsWwPCTRnw3J1yhSrkqs DfMlvKUsxXaNOdPmLpbmtQHhFxXai5wlZJP3/pZaHIbi11dtw5uPNMc2Mn/9dGbo b2a+uoCfc5D23519HVQ38AbPS8a+wRYRA6dzA+YZaA22Db28UhXHb/13/G1E0Dk= =advJ -END PGP SIGNATURE- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] mounting a read-only PERMANENT from remote server
On Thu, Oct 30, 2014 at 10:23 AM, Moritz Lennert mlenn...@club.worldonline.be wrote: Hello, I know that people work with entire GISDBASES on remote server, often via NFS, but does anyone have experience with mounting only one mapset from a remote server into a location on the local machine ? Yes, we have. What is the specific question? :) Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] mounting a read-only PERMANENT from remote server
On 30/10/14 10:52, Markus Neteler wrote: On Thu, Oct 30, 2014 at 10:23 AM, Moritz Lennert mlenn...@club.worldonline.be wrote: Hello, I know that people work with entire GISDBASES on remote server, often via NFS, but does anyone have experience with mounting only one mapset from a remote server into a location on the local machine ? Yes, we have. What is the specific question? :) Any specific hints about possible difficulties ? I am trying to figure out the best way to allow students to work on VHR-imagery in computer labs where their own sessions are limited in terms of disk space and where the file server is normally read-only for students. Moritz ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] python error starting grass70 in ubuntu 12.04
...ok, it is working now creating a new user following the instructions on: http://www.spatial-ecology.net/dokuwiki/doku.php?id=wiki:install_linux Cheers, Javier On Thu, Oct 30, 2014 at 8:13 AM, Javier Martínez-López javi.martinez.lo...@gmail.com wrote: Dear all, I am getting this python error when I try to start grass70 in an ubuntu 12-04 'dockerized' virtual machine (see https://registry.hub.docker.com/u/javimarlop/ubuntugis-docker/dockerfile/ for more info and details): A) As root: root@bfc38ad6d394:/# grass70 -text Traceback (most recent call last): File /usr/bin/grass70, line 1150, in module check_shell() File /usr/bin/grass70, line 771, in check_shell sh = os.path.basename(os.getenv('SHELL')) File /usr/lib/python2.7/posixpath.py, line 112, in basename i = p.rfind('/') + 1 AttributeError: 'NoneType' object has no attribute 'rfind' B) As a different user: root@bfc38ad6d394:/# su javier javier@bfc38ad6d394:/$ grass70 -text Traceback (most recent call last): File /usr/bin/grass70, line 1159, in module set_paths() File /usr/bin/grass70, line 367, in set_paths if sys_man_path: UnboundLocalError: local variable 'sys_man_path' referenced before assignment Python version is 2.7.3. and grass70 was installed using the grass-devel ppa. Does anyone have a clue? Thank you very much and cheers, Javier ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] mounting a read-only PERMANENT from remote server
On Thu, Oct 30, 2014 at 11:03 AM, Moritz Lennert mlenn...@club.worldonline.be wrote: On 30/10/14 10:52, Markus Neteler wrote: On Thu, Oct 30, 2014 at 10:23 AM, Moritz Lennert mlenn...@club.worldonline.be wrote: Hello, I know that people work with entire GISDBASES on remote server, often via NFS, but does anyone have experience with mounting only one mapset from a remote server into a location on the local machine ? Yes, we have. What is the specific question? :) Any specific hints about possible difficulties ? As long as you have a stable network connection, no issues. I am trying to figure out the best way to allow students to work on VHR-imagery in computer labs where their own sessions are limited in terms of disk space and where the file server is normally read-only for students. ok, so you may set it up like this: (NFS)Server: /storage/grassdata/various locations -- export /storage/grassdata/ as read-only NFS share Put all data into the PERMANENT mapset. Student machine(s): # as root, one time needed (add to /etc/fstab): mkdir -p /storage/grassdata/ mount via NFS /storage/grassdata/ into /storage/grassdata/ # as user: mkdir $USER/grassdata mkdir $USER/grassdata/location1 ln -s /storage/grassdata//location1/PERMANENT $USER/grassdata/location1/ now start GRASS with $USER/grassdata/ and location1 and create a new user mapset within it. That will stay locally while PERMANENT comes from the NFS server in read-only. Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] grass gis 6.4.4 i.atcorr exe problem
On Thu, Oct 30, 2014 at 6:32 AM, kameswari devi kams.d...@gmail.com wrote: hello all, i have compiled grass 6.4.4 on windows. i.atcorr is th module required for us. i have to customize it for IRS liss4 sensor. If you have the filter functions for the IRS liss4 sensor we can add that to i.atcorr. so for landsat data i have tested by giving the parameters to the exe created after compilation. but i am not sure about the parameters and whether it is working properly. i have set environment variables gisbase and gisrc also. but it was mentioning no module found named grass.script can any one tell me how to correct arguments to pass i.atcorr.. parameters given are: i.atcorr -r -a -o lsat7_2002_40_rad ialt=elevation icnd=icnd_lsat4.txt oimg=lsat7_2002_40_atcorr as shown in the link grass.osgeo.org/grass65/manuals/i.atcorr.html. Maybe this page can help you: http://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] g.gui.animation fails at launching
On Thu, Oct 30, 2014 at 5:26 AM, Annalisa Minelli annagra...@gmail.com wrote: Hi all, I'm experiencing a problem in launching g.gui.animation.. wich doesn't load and it returns me the following error: Error in atexit._run_exitfuncs ..here the complete output: http://pastebin.com/FwMQa1jF Hm, not sure when this got broken. For now, you can edit file gui/wxpython/animation/g.gui.animation.py and instead of last line GuiModuleMain(main) use main() and recompile. That should fix it, but it will block your command line unless you use Anna I compiled GRASS yesterday (checking out the grass70 release version), it seemed fine and I used this configure: ./configure --with-proj-share=/usr/local/share/proj/ --with-python --with-cxx --with-freetype --with-freetype-includes=/usr/include/freetype2/ --with-includes=/usr/local/lib --with-wxwidgets --enable-largefile --enable-64bit --with-sqlite --with-sqlite-includes=/usr/include/ --with-opengl --with-postgres --with-postgres-includes=/usr/include/postgresql/ --with-tcltk-includes=/usr/include/tcl8.5 --with-gdal --with-netcdf --with-ffmpeg --with-motif --with-geos --with-odbc --with-mysql --with-mysql-includes=/usr/include/mysql/ Many thanks, Annalisa ___ 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
[GRASS-user] Fwd: g.gui.animation fails at launching
Thank you so much Anna, it works :-) Annalisa 2014-10-30 13:38 GMT+01:00 Anna Petrášová kratocha...@gmail.com: On Thu, Oct 30, 2014 at 5:26 AM, Annalisa Minelli annagra...@gmail.com wrote: Hi all, I'm experiencing a problem in launching g.gui.animation.. wich doesn't load and it returns me the following error: Error in atexit._run_exitfuncs ..here the complete output: http://pastebin.com/FwMQa1jF Hm, not sure when this got broken. For now, you can edit file gui/wxpython/animation/g.gui.animation.py and instead of last line GuiModuleMain(main) use main() and recompile. That should fix it, but it will block your command line unless you use Anna I compiled GRASS yesterday (checking out the grass70 release version), it seemed fine and I used this configure: ./configure --with-proj-share=/usr/local/share/proj/ --with-python --with-cxx --with-freetype --with-freetype-includes=/usr/include/freetype2/ --with-includes=/usr/local/lib --with-wxwidgets --enable-largefile --enable-64bit --with-sqlite --with-sqlite-includes=/usr/include/ --with-opengl --with-postgres --with-postgres-includes=/usr/include/postgresql/ --with-tcltk-includes=/usr/include/tcl8.5 --with-gdal --with-netcdf --with-ffmpeg --with-motif --with-geos --with-odbc --with-mysql --with-mysql-includes=/usr/include/mysql/ Many thanks, Annalisa ___ 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] g.gui.animation fails at launching
On Thu, Oct 30, 2014 at 8:38 AM, Anna Petrášová kratocha...@gmail.com wrote: On Thu, Oct 30, 2014 at 5:26 AM, Annalisa Minelli annagra...@gmail.com wrote: Hi all, I'm experiencing a problem in launching g.gui.animation.. wich doesn't load and it returns me the following error: Error in atexit._run_exitfuncs ..here the complete output: http://pastebin.com/FwMQa1jF Hm, not sure when this got broken. For now, you can edit file gui/wxpython/animation/g.gui.animation.py and instead of last line the error is caused by r62374 http://trac.osgeo.org/grass/changeset/62374/grass/trunk I don't say this commit is wrong, maybe the GuiModuleMain is wrong. Any opinion? I remember GuiModuleMain had some problems on Mac, too. Anna GuiModuleMain(main) use main() and recompile. That should fix it, but it will block your command line unless you use Anna I compiled GRASS yesterday (checking out the grass70 release version), it seemed fine and I used this configure: ./configure --with-proj-share=/usr/local/share/proj/ --with-python --with-cxx --with-freetype --with-freetype-includes=/usr/include/freetype2/ --with-includes=/usr/local/lib --with-wxwidgets --enable-largefile --enable-64bit --with-sqlite --with-sqlite-includes=/usr/include/ --with-opengl --with-postgres --with-postgres-includes=/usr/include/postgresql/ --with-tcltk-includes=/usr/include/tcl8.5 --with-gdal --with-netcdf --with-ffmpeg --with-motif --with-geos --with-odbc --with-mysql --with-mysql-includes=/usr/include/mysql/ Many thanks, Annalisa ___ 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
[GRASS-user] Unable to use Command Line Access to GRASS-GIS
Dear GRASS-GIS users: I wanted to use GRASS-GIS through command line access in my Windows PC. So, I have installed GRASS GIS 7.0.0beta3 in drive C of my PC. But, when I enter the following command in the windows command prompt: C:\Program Files (x86)\GRASS GIS 7.0.0beta3\bin\i.cluster.exe the program can't start because libint-8.dll is missing from your computer. Try reinstalling the program... Please help me what should I do to have the command line access to GRASS-GIS. I hope someone can help me. Your quick response is highly appreciated. Thanks in the advance, Artur ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] mounting a read-only PERMANENT from remote server
On Thu, Oct 30, 2014 at 7:08 AM, Markus Neteler nete...@osgeo.org wrote: of disk space and where the file server is normally read-only for students. We had recently similar issue. We had read-only GRASS location. Unfortunately the client OS was MS Windows, so the nice trick with mounting and symbolic link is not applicable. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user