[GRASS5] PROJ_INFO and pj_get_kv() and r.in.gdal
neteler at itc.it
Thu Oct 11 05:27:38 EDT 2001
On Wed, Oct 10, 2001 at 10:03:44PM -0400, Frank Warmerdam wrote:
> Markus Neteler wrote:
> > Hi Andreas,
> > even I prefer to have the wkt_to_grass() function fixed in
> > r.in.gdal (to also provide "name", "a" and "es" in the proj_info
> > struct).
> > I have tried to fix, but didn't manage. Any PROJ experts out
> > there?
> > This is one of the few things missing for the stable release.
> I appologise for the lengthy delay. I have finally clarified the
> definition of es, and where to lookup name and added these along with
> a to the wkt_to_grass() function in r.in.gdal. I have done a few tests
> when creating new locations and it seems to work fine. Could you try it
> out in the situation you were running into the problem?
thanks for the update. I have submitted a change to r.in.gdal to
use pj_get_kv() instead of the hard-coded lat/long.
/* set input projection*/
if (pj_get_kv(&iproj, &proj_info, &proj_units) < 0)
G_fatal_error("Can't get projection key values of input data...");
However, this function still fails:
GCPs have the following OpenGIS WKT Coordinate System:
cannot initialize pj
cause: no arguments in initialization list
ERROR: Can't get projection key values of input data (no GCPs present?)
Perhaps it is a pointers task since gcc -Wall reports:
main.c:373: warning: passing arg 2 of 'pj_get_kv' from incompatible pointer
main.c:373: warning: passing arg 3 of 'pj_get_kv' from incompatible
I have the feeling that &proj_info, &proj_units are not initialized
properly (how to check that?).
Please note: in g.region and r.sunmask I got that working, also
to set the pj_get_kv(&oproj, out_proj_info, out_unit_info) :-)
Pointers are obviously still a secret for me.
More information about the grass-dev