Saturday, February 21, 2009

Expanding the console language - part II

Now the console has some keywords that refer to the active region values, i.e. limits, resolution and rows and columns.

I think an example is more than self explaining about the usage.
The following
  • prints to console the values of the active region
  • uses the GRASS command g.region to change the resolution to 20 meters (as you can see it was 40 before)
  • updates the script's variables region values to the new set (very important)
  • prints out the new active region values



println "n = " + NORTH()
println "s = " + SOUTH()
println "e = " + EAST()
println "w = " + WEST()
println "xres = " + WERES()
println "yres = " + NSRES()
println "rows = " + ROWS()
println "cols = " + COLS()

grass g.region.exe res = 20

updateActiveregion()

println "n = " + NORTH()
println "s = " + SOUTH()
println "e = " + EAST()
println "w = " + WEST()
println "xres = " + WERES()
println "yres = " + NSRES()
println "rows = " + ROWS()
println "cols = " + COLS()



My example result is:
n = 5204514.51713
s = 5141634.51713
e = 686136.82243
w = 601576.82243
xres = 40.0
yres = 40.0
rows = 1572
cols = 2114
Updated active region...
n = 5204514.51713
s = 5141634.51713
e = 686136.82243
w = 601576.82243
xres = 20.0
yres = 20.0
rows = 3144
cols = 4228

Thursday, February 12, 2009

Is JGrass really so hard to use?

Hmmmmm... some say yes, but hey, finally one of our advanced JGrass users reported that "JGrass is stuff for kids" and sent me the following to prove his theory:


I am amazed!!!
Glad to welcome you to our community Kate!!




Wednesday, February 4, 2009

The day r.proj stood still...

I use GRASS, from time to time I develop GRASS, all in all I love GRASS.
But there are things of GRASS that I hate... those small things that lead me to start with JGrass long time ago.

An example? r.proj!

Does it really have to be a pain to reproject a couple of maps into a new location?

Shouldn't it be something like:

1) select the maps you want to reproject, rightclick on the selection and use a nice command to reproject



2) define a name for the new location and a new mapset, choose the new coordinate reference system




3) sit back and watch that thing work and enjoy the new location appearing in the file browser



4) enjoy the new location with its reprojected maps




Yes, I think that's the way it should be... and it also will be in JGrass aligned with uDig 1.2.