[Gdal-dev] Problem creating GeoTiff across International Date Line

Todd Jellett todd.jellett at caris.com
Thu Oct 20 12:28:50 EDT 2005


Hi all,

I have a question which is related to geotiff images, the international 
date line and proj4.
It may ultimately belong on the proj4 list but since it relates to 
GeoTiff I'm posting here.

Is it the intention that pj_inv can be used to convert a projected coord 
(say mercator) to
lat/long then use pj_fwd to convert back to mercator units and get the 
same x, y
mercator value?

With the current implemetation of proj4 "adjlon" being used in pj_inv.c 
to make sure
that the returned longitude is always within the range of +/- 180 
degrees. While this
is fine most of the time, it causes problems when working around the 
international
date line.

eg. I have a mercator coordinate for an image corner. note: the image 
spans the date line.
1) x,y = (23370182, 22807431)

2) results from  pj_inv
     Lat, Long = (86.81, -150.06)

3) results from pj_fwd
     x,y = (-16705270,  22807431)

The difference occurs because the orgininal longitude (before adjlon) of 
+209.04 was
"corrected" to be within the range of -180. to +180 before being 
returned by pj_inv.
The end result is an X coordinate which is 40 million meters east of 
where it originally was.
Strictly speaking a longitude of -150.06 is the same location on the 
earth as +209.04
but when you project this point to x, y you do not get the same Y 
coordinate.

Thanks
Todd






More information about the Gdal-dev mailing list