The Lambert azimuthal equal-area

Angus Carr apcarr at FLASH.LakeheadU.CA
Wed Mar 31 23:03:19 EST 1999


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
> 
> 
>  
> 
> 



More information about the grass-user mailing list