[Geotiff] GeoTIFF Model/Transform help

Frank Warmerdam warmerdam at pobox.com
Tue Mar 2 15:54:18 EST 2010


Moore, Dave M (UK Rochester) wrote:
> Hi All,
> I need some help creating a GeoTiff file. Basically, I've got a bitmap 
> which exists over the polar region. I think that a CT_PolarStereographic 
> setting is required to handle this, but I'm having problems with 
> tiepoints and defining the projection model.
>  
> Basically all I know is the lat/long of the opposite corners of the 
> image. The first problem is the model definition. A ModelGeographic 
> model suggests to me that the tiepoint coordinates needs to be lat/lng 
> values (which is OK), but that the image has edges of constant of lat or 
> long, which this polar image doesn't. Also, it seems no possible to have 
> a PolarStereographic transform within a Geographic Model?. I could use 
> ModelTypeProjected, but this suggests that I would need to know the 
> metres/pixel value which I don't. What is the correct model?.

Dave,

If you know all four corners you could just define it as ModelGeographic
and provide the four tiepoints.  This would be at least somewhat useful
to other applications that support arbitrary control points.

But to more accurately represent the geometry in a way most geotiff
apps can use, you would need to define it as ModelTypeProjected, provide
the polar stereographic projection parameters and compute the origin
and pixel size in polar stereographic.

Transforming the lat/long corners to polar stereographic can be somewhat
involved.  One approach would be to do this with the PROJ.4 library -
the same library optionally used by libgeotiff's listgeo to report
lat/long corners for projected images.

In this case you might construct wgs84 and polar stereographic
coordinate system objects something like this:

#include "proj_api.h"
...

    projPJ latlong_pj, polar_pj;
    double x[4] /* longitude */, y[4] /* latitude */;

    ... set x and y ...

    latlong_pj = pj_init_plus( "+proj=latlong +datum=WGS84");
    polar_pj = pj_init_plus( "+proj=stere +lat_0=90 +datum=WGS84" );

    pj_transform( latlong_pj, polar_pj, 4, 1, x, y, NULL );

Then x/y should be the corners in polar stereographic meters.
The top left corner would be the origin, and the pixel size can
be computed based on the corners and the number of pixels and lines.

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



More information about the Geotiff mailing list