[GRASS5] d.grid with numbers

Hi,

I just added text support for d.grid. Text takes the color of the grid
lines. It formats lat & lon pretty too. I added in the (minimal)
infrastructure to allow Bob's new geogrid capability to draw it too, but
I leave it to him to mess with his code. It would mostly be a cut &
paste job from plot_grid(), but with a little more trig :wink: to get the
screen start coordinates and rotation factor correct.

I don't guarantee that FreeType fonts (set with d.font.freetype) won't
fall off the edge of the screen as the width may be slightly more than
the default fonts'. I tested Vera.ttf and that still looked ok. If it's
a problem with a common font we can tweak the numbers inwards a little.

No test to stop overlapping numbers.

You can disable it with the -t flag.

I don't have any plans to allow the text color to deviate from the grid
line color, but of course someone else is free to add it if they want
that. I think the default colors should match anyhow.

enjoy,
Hamish

Hamish wrote:

Hi,

I just added text support for d.grid. Text takes the color of the grid
lines. It formats lat & lon pretty too. I added in the (minimal)
infrastructure to allow Bob's new geogrid capability to draw it too, but
I leave it to him to mess with his code. It would mostly be a cut &
paste job from plot_grid(), but with a little more trig :wink: to get the
screen start coordinates and rotation factor correct.

I don't guarantee that FreeType fonts (set with d.font.freetype) won't
fall off the edge of the screen as the width may be slightly more than
the default fonts'. I tested Vera.ttf and that still looked ok. If it's
a problem with a common font we can tweak the numbers inwards a little.

No test to stop overlapping numbers.

You can disable it with the -t flag.

I don't have any plans to allow the text color to deviate from the grid
line color, but of course someone else is free to add it if they want
that. I think the default colors should match anyhow.

Very nice, Hamish!

Markus

Hello,

I have applied some updates to CVS for d.grid. These changes include:

Geogrid label support - labels for the geographic grid are printed on the top left of the grid.

I have removed the gsize and gcolor options.

The geographic grid drawing is now enabled with a "-g" flag.

I have added a "-n" flag to disable grid drawing (only border).

Please test and check for problems.

--
Bob

I have applied some updates to CVS for d.grid. These changes include:

Geogrid label support - labels for the geographic grid are printed on
the top left of the grid.

I have removed the gsize and gcolor options.

The geographic grid drawing is now enabled with a "-g" flag.

I have added a "-n" flag to disable grid drawing (only border).

Please test and check for problems.

Works great!

Two minor cosmetic issues:

- could you move the text a couple of pixels above the grid line and
away from the edge of the display? It overlaps (especially if you
changed the font with d.text.freetype?).

- the right hand and lower geogrid lines go past the border by one
pixel (see attached screenshot). Didn't we move the borders in by one
pixel some time ago as they were falling off the edge of the screen?

thanks,
Hamish

(attachments)

dgeogrid1.png

Bob,

I've updated the grid panel in the GIS Manager to include the new options.
Wouldn't geodetic grid be more descriptive than geographic grid?

I also added Markus' v.report script to the menu.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Bob Covill <bcovill@tekmap.ns.ca>
Date: Tue, 25 Oct 2005 09:33:41 -0300
To: Markus Neteler <neteler@itc.it>, Hamish Bowman <hamish_nospam@yahoo.com>,
Michael Barton <michael.barton@asu.edu>
Cc: GRASS List <grass5@grass.itc.it>
Subject: Re: d.grid with numbers

Hello,

I have applied some updates to CVS for d.grid. These changes include:

Geogrid label support - labels for the geographic grid are printed on
the top left of the grid.

I have removed the gsize and gcolor options.

The geographic grid drawing is now enabled with a "-g" flag.

I have added a "-n" flag to disable grid drawing (only border).

Please test and check for problems.

--
Bob