[GRASS5] ps.atlas

Hallo developers,
after some time, I puted together script for making something like
atlas of maps using ps.map.

The script splits the current region into number of columns and rows
and in each field it runs ps.map with defined input configuratin file.

The resulting atlas of maps can be stored in vector file. Desired
overlaping can be also set.

Example result can be seen at

    http://les-ejk.cz/~jachym/img/grass/krkonose_prehledka.jpg
    [375.04KB]

It would need some testing. It works with GNU bash, version 3.00.16.

Thanks

Jachym

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/

(attachments)

ps.atlas (7.18 KB)

after some time, I puted together script for making something like
atlas of maps using ps.map.

The script splits the current region into number of columns and rows
and in each field it runs ps.map with defined input configuratin file.

The resulting atlas of maps can be stored in vector file. Desired
overlaping can be also set.

Hi Jachym,

You might be able to simplify your script by having it use v.mkgrid +
'v.label type=centroid' + ps.map's 'labels' instruction (use CVS).

Perhaps combine the row and coln columns that v.mkgrid makes to have
"1A, 4D, ..." style labels.

regards,
Hamish

hallo,

On Mon, Jul 11, 2005 at 09:03:48PM +1200, Hamish wrote:

Hi Jachym,

You might be able to simplify your script by having it use v.mkgrid +
'v.label type=centroid' + ps.map's 'labels' instruction (use CVS).

Perhaps combine the row and coln columns that v.mkgrid makes to have
"1A, 4D, ..." style labels.

regards,
Hamish

eeee... you may be right.. v.mkgrid could be another solution. if you
don't might, I would let the script like it is. I implemented the "1A..
" style of lables and added some (hopefully) useful columns to database.

if there are no bigger reservations to the concept, I would let is be
as it is.

Jachym

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/

(attachments)

ps.atlas (8.14 KB)

Here are some more comments, this is meant as FYI- if the script works
as you like it then no need to go further!

another little simplification, if you use 'v.in.ascii -n' (6.1-cvs
only) you can skip the header stuff:

ORGANIZATION:
DIGIT DATE:

etc.

awk is more likely to be installed vs. bc for floating point math.
e.g. ANSWER=`echo "1.23 2.34" | awk '{print $1 + $2}'`

not as easy to read as bc input though so maybe better to leave it.

I'm not sure if it's a good idea to overwrite an existing vector file
without asking if it already exists (when the module is no longer in the
development stage). Exit with an error instead.

ps.map out=$out.eps

(1st time)

you didn't use the ps.map -e flag so output is .ps not .eps

scale= is a mapping instruction so best put in the ps.map command file
not on the command line. It is my intention to remove this from the
command line options in future. (will leave for GRASS 6 though)

eval `g.region -p|grep '^north\|^east

etc.

use eval `g.region -g`

if [ "$cols" == "" ]; then

might break on cygwin?

use if [ -z "$cols" ] ; then
...

  currow=$(( $currow+1 ))

$(( )) is bash only.

Use currow=`expr $currow + 1`

for a more portable script.

Hamish

hallo,

I fixed most of notes from Hamish (thank you) and I added some more
options. The script can be turned to be less verbosed (redirecting
messages to /dev/null or /dev/stdout), but I'm not shure, if this works
e.g. on Mac Os or Cygwin.

Any other bugs/wishes?

Jáchym

On Tue, Jul 12, 2005 at 11:41:23AM +1200, Hamish wrote:

another little simplification, if you use 'v.in.ascii -n' (6.1-cvs
only) you can skip the header stuff:

> ORGANIZATION:
> DIGIT DATE:
etc.

awk is more likely to be installed vs. bc for floating point math.
e.g. ANSWER=`echo "1.23 2.34" | awk '{print $1 + $2}'`

not as easy to read as bc input though so maybe better to leave it.

I'm not sure if it's a good idea to overwrite an existing vector file
without asking if it already exists (when the module is no longer in the
development stage). Exit with an error instead.

> ps.map out=$out.eps
(1st time)

you didn't use the ps.map -e flag so output is .ps not .eps

scale= is a mapping instruction so best put in the ps.map command file
not on the command line. It is my intention to remove this from the
command line options in future. (will leave for GRASS 6 though)

> eval `g.region -p|grep '^north\|^east
etc.

use eval `g.region -g`

> if [ "$cols" == "" ]; then

might break on cygwin?

use if [ -z "$cols" ] ; then
...

> currow=$(( $currow+1 ))

$(( )) is bash only.

Use currow=`expr $currow + 1`

for a more portable script.

Hamish

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/

(attachments)

ps.atlas (8.79 KB)