Sunday, December 28, 2008

Expanding the console language

We are finally starting to expand a bit the console scripting language.

What does that mean?

Well, that to get a martix of data from a map you now can write:

def matrix = fromMap("mapname")

and then access as an array the matrix.

The same works the way round:

toMap "mapName", matrix

Note that if the method returns a value, you need the brackets around the parameters.

What else?

You can now load a raster to be visible like that:

load "mapname"

And how many times did you want to isolate some maps from a mapset full of maps, to give just those to a collaborator?

Now you do it like that:

copyToNewMapset "test", "adigeall_dtm", "adigeall_pit", "adigeall_flow"

which will create a new mapset (in this case named test) inside the current location and copy there just the maps you want (which in this case are 3).

Delete maps?

deleteMaps "adigeall_dtm", "adigeall_pit"

And more will come when it is needed. If you have cool ideas please let me know here, in the jGrass list or even better open a bug request for new feature.

No comments: