proj4 support question and bug?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

proj4 support question and bug?

Rick Brownrigg-2
A question and a bug(?):

Q: While it appears there's support for specifying projections in libgeotiff using proj4-style strings, I was recently surprised and disappointed to find that there's only a rather small set of projections actually supported. Browsing the code in "geotiff_proj4.c", it looks like much code was lifted from OGR, but is commented out, presumably because it makes use of OGR API functions not available in libgeotiff (?)  Can someone comment on what is required to implement broader proj4 projection support in libgeotiff?  It is simply a matter of following the patterns set out for the current projections (i.e., set as approp. GMModelTypeGeoKey, ProjectedCSTypeGeoKey, ProjectionGeoKey, ProjCoordTransGeoKey, plus additional projection-specific tags)?

Bug: In geotiff_proj4.c, v1.2.5, around lines 395 -- 429, there are two cases for Lambert Conformal (lcc) that are identical conditionals.  They appear to be intended to handle the 1 vs. 2 standard parallel cases. I believe in the  2nd conditional, at line 427, should read lat_0 != lat_1,  not lat_0 == lat_1 (?).

FWIW...
Rick Brownrigg

_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: proj4 support question and bug?

Frank Warmerdam
[hidden email] wrote:

> A question and a bug(?):
>
> Q: While it appears there's support for specifying projections in libgeotiff
> using proj4-style strings, I was recently surprised and disappointed to find
> that there's only a rather small set of projections actually supported.
> Browsing the code in "geotiff_proj4.c", it looks like much code was lifted
> from OGR, but is commented out, presumably because it makes use of OGR API
> functions not available in libgeotiff (?)  Can someone comment on what is
> required to implement broader proj4 projection support in libgeotiff?  It is
> simply a matter of following the patterns set out for the current
> projections (i.e., set as approp. GMModelTypeGeoKey, ProjectedCSTypeGeoKey,
> ProjectionGeoKey, ProjCoordTransGeoKey, plus additional projection-specific
> tags)?

Rick,

Generally yes, you can just add more cases using a similar pattern.  Please
ensure that writing geotiff files you always use the same parameters that
the normalization code uses for any projection method.

> Bug: In geotiff_proj4.c, v1.2.5, around lines 395 -- 429, there are two
> cases for Lambert Conformal (lcc) that are identical conditionals.  They
> appear to be intended to handle the 1 vs. 2 standard parallel cases. I
> believe in the  2nd conditional, at line 427, should read lat_0 != lat_1,
> not lat_0 == lat_1 (?).

I have corrected this in SVN at your suggestion.

Thanks,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff