GeoTIFF Model/Transform help

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

GeoTIFF Model/Transform help

Moore, Dave M (UK Rochester)
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?.
 
I can find very few GeoTIFF library examples.
 
Any comments or suggestions are gratefully received.
 
Thanks,
Dave
 
 

********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************


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

Re: GeoTIFF Model/Transform help

Frank Warmerdam
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, [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