[GRASS5] Another question on the projection transform

Eric G. Miller egm2 at jps.net
Fri Jan 25 00:19:00 EST 2002


On Thu, 24 Jan 2002 20:49:36 -0800 (PST), zhang ji <zsfunl at yahoo.com> wrote:

> Hi all,
> 
> I have another question on the projection transform.
> Does the function in m.proj can be accessed throught
> the libgis.a? I mean does there existing the common
> API in the grass library which can be directly used 
> to do some projection transform, for example, i can
> specify what the input projection ,input lat/long and
> the output projection with the ellipsoids, and the
> function can return the output northing/easting?

Yes/No.  The functions are there, the interface is
messy (mostly a wrapper around a version of proj4).
Note, datum transformations need extra work and
aren't done by default (even if they should be,
when possible).  Some of the info is documented
in the GRASS docs, some of it in the PROJ4 docs,
and some of it only in the source code...

If you just need to project or inverse project
a set of coordinates, you might just use the
"proj" command directly (comes with the proj4
library, if you have it installed -- not the
one with GRASS).

An alternative library, independent of GRASS,
is available here:
http://pweb.jps.net/~egm2/libgeotrans/index.html
I pulled out the "library" parts of the GEOTRANS
coordinate calculator, and organized it as a
library.  Don't ask me for any help with using
it though, as I haven't really done anything
with it.  It has a pretty clean interface, and
will do datum transformations (mostly 3-parameter,
nothing as accurate as NADCON).  It does not
support as many projections as proj4, though
the most common ones are there (and some probably
only used by the military).  

It has what I consider a couple flaws in how it 
deals with it's shared data, the most significant
of which leads to a long initialization time.  The
other of which is a security, common vs. per user
data issue (not a problem if you don't let users
define their own datums).

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list