The Lambert azimuthal equal-area

Dear GRASS users

I am involved in mapping Arctic areas and I need to use
the Lambert azimuthal equal-area projection for this mapping.
Is it possible to use this projection under GRASS

Many thanks for your time

--
Seppo Kaitala Ph. D. in Biology
University of Helsinki
Department of Ecology and Systematics
Division of Environmental Biology
P.O. Box 44 (Jyrängöntie 2, Botanical Garden)
FIN-00014, Finland
tel. +358 9 19140059, fax. +358 9 19140033
email: seppo.kaitala@helsinki.fi

Hello List

I posted some comments on this topic earlier, but my postings were
silently dropped by the server. My fault, because my email address has a
slightly different format now compared to when I subscribed the first
time.

Anyway, I did some hacking on the g.setproj source, and got grass5.0beta
to accept Lambert Equal Area as a supported projection. Could it be this
easy to add support for new projections in grass? Then it's trivial to add
all 118 different projections from PROJ4 (source is already included in
Grass). There may be side-effects, however. I guess I'll find out.

On Tue, 9 Mar 1999, Seppo Kaitala wrote:

I am involved in mapping Arctic areas and I need to use
the Lambert azimuthal equal-area projection for this mapping.
Is it possible to use this projection under GRASS

To add support for Lambert Equal Area in grass5.0beta I tried the
following:

Edited two files (table.h and table.c) in src/general/g.setproj, adding
definitions for LEAC. Here are the diffs:

....................
diffs between table.h and table.h.original

19d18
< #define LEAC 7
21c20
< #define NPROJES 8
---

#define NPROJES 7

....................
diffs between table.c and table.c.original
(note i am my own area as default, but you can change that)

74,87d73
< TABLE[LEAC][LAT0].ask = 1;
< TABLE[LEAC][LAT0].def_exists = 1;
< TABLE[LEAC][LAT0].deflt = 55.0;
<
< TABLE[LEAC][LON0].ask = 1;
< TABLE[LEAC][LON0].def_exists = 1;
< TABLE[LEAC][LON0].deflt = 20.0;
<
< TABLE[LEAC][LAT1].ask = 1;
< TABLE[LEAC][LAT1].def_exists = 1;
< TABLE[LEAC][LAT1].deflt = 55.0;
<
< TABLE[LEAC][SOUTH].ask = 1;
<
112d97
< if (G_strcasecmp(str,"LEAC",4) == 0) return LEAC;

.....................
Then recompiled g.setproj.
In addition I added the following line to /etc/projections:
leac:Lambert Equal Area

After this I can define a leac projection and r.proj and v.proj will make
conversions to/from leac. I don't yet know how this effects other modules
in locations with the new projections.

I tried the leac projection on data from the Eurasia Land Cover Data Base
at usgs.gov. They don't tell what first standard parallel they used
for their data so I tried to use the same value as the central parallel
(55N). I then used r.proj to import elevation data (from DEM) into this
mapset, and it fits nicely, but _not_ exaxtly. I don't know why, but it
could be the above mentioned value for lat_1, or because ealcdb use a
sphrerical globe and only half the resolution of DEM, which was made for
wgs84, or a combination of all these factors.

Anyway, if haven't broken anything with my hack, I'll try to add support
for other projections as well. It's essentially just a matter of copying
the parameter lists and default values from PROJ4 into table.h and
table.c.

Or...?

regards
Morten Hulden

Before anyone points it out, I want to correct my mistake:
I realize now LEAC and LAEA are two different projections, and the one
Seppo asked about was the azimuthal projection, not the conical. So here's
the prescription for including both LEAC and LAEA:
.....
diff -w table.h table.h.org

20,24c20
< #define LEAC 7
< #define LAEA 8
<
< #define NPROJES 9
<
---

#define NPROJES 7

.....
diff -w table.c table.c.org

74,96d73
< TABLE[LEAC][LAT0].ask = 1;
< TABLE[LEAC][LAT0].def_exists = 1;
< TABLE[LEAC][LAT0].deflt = 55.0;
<
< TABLE[LEAC][LON0].ask = 1;
< TABLE[LEAC][LON0].def_exists = 1;
< TABLE[LEAC][LON0].deflt = 20.0;
<
< TABLE[LEAC][LAT1].ask = 1;
< TABLE[LEAC][LAT1].def_exists = 1;
< TABLE[LEAC][LAT1].deflt = 0.0;
<
< TABLE[LEAC][SOUTH].ask = 1;
< TABLE[LEAC][SOUTH].def_exists = 1;
<
< TABLE[LAEA][LAT0].ask = 1;
< TABLE[LAEA][LAT0].def_exists = 1;
< TABLE[LAEA][LAT0].deflt = 55.0;
<
< TABLE[LAEA][LON0].ask = 1;
< TABLE[LAEA][LON0].def_exists = 1;
< TABLE[LAEA][LON0].deflt = 20.0;
<
121,122d97
< if (G_strcasecmp(str,"LEAC",4) == 0) return LEAC;
< if (G_strcasecmp(str,"LAEA",4) == 0) return LAEA;

.......
Recompile g.setproj and add to etc/projection:
leac:Lambert Equal Area Conic
laea:Lambert Azimuthal Equal Area

On Wed, 31 Mar 1999, Morten Hulden wrote:

I tried the leac projection on data from the Eurasia Land Cover Data Base
at usgs.gov. They don't tell what first standard parallel they used
for their data so I tried to use the same value as the central parallel
(55N). I then used r.proj to import elevation data (from DEM) into this
mapset, and it fits nicely, but _not_ exaxtly.

Of course not you stupid idiot, you used the wrong projection! And LAEA
does not have a first standard parallel parameter.

Well, after correcting the mistake I tried it again, and it fits to the
pixel! I also used v.proj to convert the borders and coastline-island-lake
(World Data Bank) from ll projection to LAEA and they too fit precisely.

sorry for the mess
Morten Hulden

Yes, it is that easy to add projections.

If you look through the kruft that has developed in GRASS, there is some
amazing stuff in there. I have used projection stuff from it shamelessly
in other projects, and had no problems with the results.

Angus Carr.

On Wed, 31 Mar 1999, Morten Hulden wrote:

Hello List

I posted some comments on this topic earlier, but my postings were
silently dropped by the server. My fault, because my email address has a
slightly different format now compared to when I subscribed the first
time.

Anyway, I did some hacking on the g.setproj source, and got grass5.0beta
to accept Lambert Equal Area as a supported projection. Could it be this
easy to add support for new projections in grass? Then it's trivial to add
all 118 different projections from PROJ4 (source is already included in
Grass). There may be side-effects, however. I guess I'll find out.

On Tue, 9 Mar 1999, Seppo Kaitala wrote:

> I am involved in mapping Arctic areas and I need to use
> the Lambert azimuthal equal-area projection for this mapping.
> Is it possible to use this projection under GRASS

To add support for Lambert Equal Area in grass5.0beta I tried the
following:

Edited two files (table.h and table.c) in src/general/g.setproj, adding
definitions for LEAC. Here are the diffs:

....................
diffs between table.h and table.h.original

19d18
< #define LEAC 7
21c20
< #define NPROJES 8
---
> #define NPROJES 7

....................
diffs between table.c and table.c.original
(note i am my own area as default, but you can change that)

74,87d73
< TABLE[LEAC][LAT0].ask = 1;
< TABLE[LEAC][LAT0].def_exists = 1;
< TABLE[LEAC][LAT0].deflt = 55.0;
<
< TABLE[LEAC][LON0].ask = 1;
< TABLE[LEAC][LON0].def_exists = 1;
< TABLE[LEAC][LON0].deflt = 20.0;
<
< TABLE[LEAC][LAT1].ask = 1;
< TABLE[LEAC][LAT1].def_exists = 1;
< TABLE[LEAC][LAT1].deflt = 55.0;
<
< TABLE[LEAC][SOUTH].ask = 1;
<
112d97
< if (G_strcasecmp(str,"LEAC",4) == 0) return LEAC;

.....................
Then recompiled g.setproj.
In addition I added the following line to /etc/projections:
leac:Lambert Equal Area

After this I can define a leac projection and r.proj and v.proj will make
conversions to/from leac. I don't yet know how this effects other modules
in locations with the new projections.

I tried the leac projection on data from the Eurasia Land Cover Data Base
at usgs.gov. They don't tell what first standard parallel they used
for their data so I tried to use the same value as the central parallel
(55N). I then used r.proj to import elevation data (from DEM) into this
mapset, and it fits nicely, but _not_ exaxtly. I don't know why, but it
could be the above mentioned value for lat_1, or because ealcdb use a
sphrerical globe and only half the resolution of DEM, which was made for
wgs84, or a combination of all these factors.

Anyway, if haven't broken anything with my hack, I'll try to add support
for other projections as well. It's essentially just a matter of copying
the parameter lists and default values from PROJ4 into table.h and
table.c.

Or...?

regards
Morten Hulden