[gdal-dev] wgs84 -> utm

Kirk McKelvey kmckelvey at lizardtech.com
Tue May 12 15:36:01 EDT 2009

Thanks Frank.  I will look at updating proj4 and in general deal with this on a case-by-case basis.

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Tuesday, May 12, 2009 11:36 AM
To: Kirk McKelvey
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] wgs84 -> utm

Kirk McKelvey wrote:
> When I try to warp the entire world (WGS84) into a UTM zone using 
> gdalwarp, I get a black image.
> This is not surprising given the valid domain for such a transformation.
> The first problem is that the bounding box gets reprojected into outer 
> space (again, b/c it is outside the valid domain).  But once I "found" 
> the data, I was able to get something quasi-sensible out of GDAL (image 
> attached).  South America shows twice, which, although pretty cool, is 
> another reflection of the domain problem.
> So my question is: How can I tell programmatically whether (1) any given 
> warp operation makes sense and (2) what its valid input domain is?


I do not have a good answer for this.  I have not been able to do it
in a general way.

> I was surprised to find that the success vector of 
> GDALReprojectionTransform() does not return failures for out-of-domain 
> inputs (at least it did not in this case).  Is it intended to?

This depends in part on what PROJ.4 does.  Traditionally the transverse
mercator project did not consider any values out of range and so all
transformation succeeded even if the results were crazy.  I recently
modified the PROJ.4 tm projection to consider anything 90 degrees off
the central meridian as a failure which should get propagated up through
the transformer as FALSE in the success vector.

Some projections with distinct horizons do already fail for over the horizon

Best regards,
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 gdal-dev mailing list