Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-27 Thread Paolo Cavallini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 24/05/2013 21:13, Martin Lacayo ha scritto: Hello Paolo, Yes, my initial thought was to just use GRASS via SEXTANTE. I tired to do this, but did not have any luck. I posted previously on 14/5/2013 to qgis-users with the subject How to run

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-25 Thread Jed
Martin Lacayo wrote #remove the location from disk print 'Removing location %s' % location_uri os.system(rm -rf %s % location_uri) Rather than rely on having 'rm' available you could also do: import shutil shutil.rmtree(location_uri) -- View this message in context:

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-24 Thread Moritz Lennert
On 23/05/13 22:49, Martin Lacayo wrote: Hello, I am having trouble getting started with GRASS Python scripts. I am using GRASS 6.4 on Debian. Could some provide a basic example of a Python script that imports a raster and exports the same raster? In particular I am interested in seeing the

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-24 Thread Paolo Cavallini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 23/05/2013 22:49, Martin Lacayo ha scritto: My ultimate goal is to decrease our development time for our open source ecosystem service tools: http://invest-natcap.googlecode.com, but more specifically at the moment I am trying to use r.viewshed

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-24 Thread Martin Lacayo
Hello Paolo, Yes, my initial thought was to just use GRASS via SEXTANTE. I tired to do this, but did not have any luck. I posted previously on 14/5/2013 to qgis-users with the subject How to run SEXTANTE algorithms outside of QGIS Python console? but did not get a solution to the problem I

[GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Martin Lacayo
Hello, I am having trouble getting started with GRASS Python scripts. I am using GRASS 6.4 on Debian. Could some provide a basic example of a Python script that imports a raster and exports the same raster? In particular I am interested in seeing the entire setup of a database (locally on disk),

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Rich Shepard
On Thu, 23 May 2013, Martin Lacayo wrote: Have I understood correctly that a database can only contain one projection, which is set when it is first created, and that besides importing and exporting data all processing has to happen with data that is in the database? Martin, You seem to

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Martin Lacayo
Rich, Thank you. Yes, that does help. I hadn't realized that in this case database was essentially synonymous with user directory. Several things have now clicked into place. -Martin On Thu, May 23, 2013 at 2:06 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Thu, 23 May 2013, Martin

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Rich Shepard
On Thu, 23 May 2013, Martin Lacayo wrote: Thank you. Yes, that does help. I hadn't realized that in this case database was essentially synonymous with user directory. Several things have now clicked into place. Martin, Yeah, it ain't intuitive. :-) Took me a while to get my head around

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Martin Lacayo
I think I have now figured out most of the answers to my question, but I am still wondering about some file management. Is the following command a normal way to make a location with a projection from a georeferenced file: g.proj -c georef=/home/user/raster.tif location=example Is there a

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Glynn Clements
Martin Lacayo wrote: I think I have now figured out most of the answers to my question, but I am still wondering about some file management. Is the following command a normal way to make a location with a projection from a georeferenced file: g.proj -c georef=/home/user/raster.tif

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Nikos Alexandris
Martin Lacayo wrote: I think I have now figured out most of the answers to my question, but I am still wondering about some file management. If I may chime in, I repeat what Richard already explained actually, just for fun :-) The GRASS GIS data base is the root (of all good geospatial

Re: [GRASS-user] Getting Started with GRASS Python Scripts

2013-05-23 Thread Nikos Alexandris
Martin Lacayo wrote: I am having trouble getting started with GRASS Python scripts. Note the following useful GRASS-Wiki pages: - http://grasswiki.osgeo.org/wiki/GRASS_and_Python - http://grasswiki.osgeo.org/wiki/GRASS_Python_Scripting_Library I am using GRASS 6.4 on Debian. Could some