[GRASS5] PROJ_INFO and pj_get_kv() and r.in.gdal
Markus Neteler
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.
>
>
> Markus,
>
>
> 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?
Frank,
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:
r.in.gdal ...
[...]
GCPs have the following OpenGIS WKT Coordinate System:
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.257223563,AUTHORITY["EPSG",7030]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG",6326]],PRIMEM["Greenwich",0,AUTHORITY["EPSG",8901]],UNIT["DMSH",0.0174532925199433,AUTHORITY["EPSG",9108]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG",4326]]
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
type
main.c:373: warning: passing arg 3 of 'pj_get_kv' from incompatible
pointer type
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.
Best regards
Markus
More information about the grass-dev
mailing list