I am a programmer (not a cartographer!!) developing an application which needs to read and write GeoTIFF files. I have a number of questions about those GeoTIFF keys which are related to projections.
I would ideally like to be able to read/write files which originate from and/or will be read by a maximum number of other GeoTIFF-aware software packages. My primary compatibility target is ARC, however, so if there is anything especially peculiar about files written or read by ARC I would be particularly interested in those details. Also, I need to support only a relatively small number of projections, namely Mercator, UTM, polar stereographic and Lambert conic conformal in that order of importance. I am using a home-brewed projection package based closely on Snyder's USGS reference and code from the GMT package (as we need to maintain co-registration with GMT plots.) I have looked through the GeoTIFF spec at www.remotesensing.org and other related materials in some detail but am still confused on a number of points:
(1) The GeoTIFF spec declares various lon/lat keys, almost all of them with deliciously circular definitions, e.g.:
"ProjNatOriginLongGeoKey: Longitude of map-projection natural origin."
Can someone explain to me the difference between natural origin, false origin and center lon/lat? My limited understanding of the math behind Snyder's projections includes knowledge of the fact that virtually all projections require a 'projection longitude' parameter, for instance. With regard to Mercator, this is the longitude at which all projected x-values will be 0 (likewise for UTM, before the 500000 false easting is applied). So, is this longitude the ProjNatOriginLong or the ProjCenterLong in GeoTIFF jargon?
(2) If a GeoTIFF file contains no specified value for a key, e.g., ProjFalseEasting, is there an assumed default value for that key? If so are such values projection-dependent, e.g. default false easting might be 500000 for UTM but 0 for anything else? I have looked at a couple of GeoTIFF files generated by external software and there seems to be a wide variety of quantity of keys specified. The spec says nothing about default values but I suspect that various external readers/writers make many assumptions about these keys (which no doubt differ on a vendor-by-vendor basis).
(3) As I noted I am primarily interested in reading ARC files. A sample Mercator GeoTIFF from ARC had a defined ProjectedCSTypeGeoKey of 3395, not listed anywhere in the GeoTIFF spec. This threw me for a while until I started digging around in the ancillary files distributed with libgeotiff and found the line
3395,"WGS 84 / World Mercator",9001,4326,19883,9804,1,0, 4400,8801,0,9102, 8802,0,9102,8805,1,9201,8806,0,9001,8807,0,9001,,,,,,
buried in /usr/share/epsg_csv/pcs.csv. Is this file pretty much invariant, meaning that I can count on this entry never changing, or do I really need to write code which parses these interconnected CSV databases everytime I encounter an unrecognized ProjectedCSType in an imported file? Like I said, I only need to support a handful of the most common projections.
Thanks very much for any help in clarifying these points!
Roger Davis Univ. of Hawaii