[GRASS-user] scripting efficiency

Moritz Lennert mlennert at club.worldonline.be
Fri Oct 18 06:59:41 PDT 2013


[Please leave discussions on the list]

On 18/10/13 15:40, Wiley Bogren wrote:
> Thank you.  Just to check, there's nothing like a startup cost each time
> you call grass from an external (bash or python) script?


I think this "startup" cost is minimal, as all that "starting up" GRASS 
actiually means is setting a few environment variables.

Moritz



> -Wiley
>
>
> On Fri, Oct 18, 2013 at 3:00 AM, Moritz Lennert
> <mlennert at club.worldonline.be <mailto:mlennert at club.worldonline.be>> wrote:
>
>     On 16/10/13 07:59, Wiley Bogren wrote:
>
>         hi GRASS community!
>
>         I'm amazed how well this software handles vector operations -
>         especially
>         the overlay operation seems unparalleled in open source
>         software.  Thank
>         you very much to everyone who has been involved in the
>         development process!
>
>         I would like to script a workflow where I apply the same set of
>         operations on a few hundred sets of shapefiles, consisting of
>         v.in.ogr,
>         several sets of v.overlay, some database operations and
>         v.out.ogr.  The
>         shapefiles are 20-30MB apiece, containing many polygons, each
>         with many
>         vertices.
>
>         Is there a difference in speed or processor efficiency between the
>         different scripting approaches?  By which I mean python vs bash
>         shell,
>         and within the GRASS environment vs calling the functions from
>         outside
>         the environment (like via python grass.script).
>
>         Thank you for any opinions or advice!
>
>
>     I see that no one ever answered this. AFAIK, speed will depend on
>     how much you do in the script and how much you have GRASS modules
>     do. The latter don't change their speed depending on the scripting
>     language calling them, so if you only use the script to link
>     different GRASS modules, I would think that time difference will be
>     negligible between languages.
>
>     Moritz
>
>




More information about the grass-user mailing list