[Gdal-dev] Fwd: plate carree to latlon projection problem

Kolberg Sjur A Sjur.A.Kolberg at sintef.no
Tue Sep 18 08:32:19 EDT 2007


Hi again Jaap,
 
If you call GDAL functions from program code, it might be that OGR or
GDAL misses some of proj4's functionality, because they re-implement
only a subset of proj4. This is what Frank's reply on June 6 was about,
afterwards I couldn't find it in my gdal-dev archive, so I enclose it
below. Basically, the missing keycodes are accepted within an EXTENSION
structure.

Besides, 6378137 is a very large axis length for a sphere, it looks more
like the major axis of most ellipsoids. 6370997 or 6371000 are commonly
used for spheres. Try at the command prompt:

C:\Program Files\FWTools1.2.2>cs2cs +proj=eqc +ellps=sphere +R=6371000 
+to +proj=latlong +ellps=WGS84 +datum=WGS84 infile.xyz -> outfile.xyz

If you skip the file stuff, cs2cs prompts for input xy(z) and outputs
xyz

Good luck,

Sjur K :-)

 
 
-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com
<mailto:warmerdam at pobox.com> ] 
Sent: 7 juni 2007 16:11
To: Kolberg Sjur A
Cc: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] Does GDAL handle rotated spheres?
Kolberg Sjur A wrote:
> Hello list,
> 
> Does GDAL handle rotated spheres?
> 
> According to this mail from 2005, GDAL re-implements a subset of 
> Proj4's keycodes, unfortuately excluding ob_tran.
> 
> http://lists.maptools.org/pipermail/gdal-dev/2005-June/005839.html
<http://lists.maptools.org/pipermail/gdal-dev/2005-June/005839.html> 

> Is this correctly described and still valid? Is there any known 
> workaround or plans for extension?

Sjur,

A mechanism to embed PROJ.4 strings with more parameters than are
actually known to OGR has been implemented. I think if you used
importFromWkt() instead on the following you would get the
transformation you wish.

PROJCS["Plate_Carree",
GEOGCS["unnamed ellipse",
DATUM["D_unknown",
SPHEROID["Unknown",6371000,0]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Plate_Carree"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-40],
PARAMETER["false_easting",639367],
PARAMETER["false_northing",1473324],
EXTENSION["PROJ4","+proj=ob_tran +o_proj=eqc +lon_0=-40 +o_lat_p=22 
+x_0=639367 +y_0=1473324 +a=6371000 +b=6371000 +wktext"],
UNIT["Meter",1]]

Note the EXTENSION[] item which allows you to embed a specific PROJ.4
string to be used as the PROJ.4 version of this WKT.

I believe this was first released in GDAL/OGR 1.4.0. I hope it helps.

Best regards,

-- 

________________________________

	From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of
jjknoops at netscape.net
	Sent: 18 september 2007 11:18
	To: gdal-dev at lists.maptools.org
	Subject: Re: [Gdal-dev] Fwd: plate carree to latlon projection
problem
	
	
	Hi Sjur,
	
	Thanks for your replay. I think you are right when saying it's
caused by ellipsoid. So I have used this command to reproject
	
	call gdalwarp -s_srs "+proj=eqc +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0
+ellps=sphere +a=6378137.0 +es=0.0 +units=m" -t_srs "epsg:4326"
	
	After comparing this result with previous results then I would
say it's worse. The offset between the result from gdalwarp and erdas
has increased. My college has also compared the results with envi and
found that it's comparable to the erdas results. 
	
	
	Best Regards,
	Jaap Knoops
	


	-----Original Message-----
	From: Kolberg Sjur A <Sjur.A.Kolberg at sintef.no>
	To: gdal-dev at lists.maptools.org
	Sent: Mon, 17 Sep 2007 6:39 pm
	Subject: RE: [Gdal-dev] Fwd: plate carree to latlon projection
problem
	
	
	Jaap,
	 
	Have you got your ellipsoids right?
	 
	If one of your ellipsoids (commonly the one used with
Plate-Carree) is a sphere, and you ignore that in converting to
geographical latlong (presumably based on WGS84), errors up to nearly 20
km will occur (latitude dependent). These errors are in the N-S
direction, E-W is usually OK. This effect is beyond projection,
latlong/sphere to latlong/WGS84 gives equally long offsets. Try using
cs2cs and specify ellipsoids for both input and output,
	 
	It is only when one of the ellipsoids is a sphere you get these
large errors, otherwise the error is much smaller.
	 
	See also Frank Warmerdam's answer on June 7th on gdal-dev: 
	(Re: [Gdal-dev] Does GDAL handle rotated spheres?)
	 
	Best regards,
	 
	Sjur K :-)
	 
	Sjur Kolberg 
	SINTEF Energy Research 
	N - 7465 Trondheim, Norway 
	Phone +47 - 73 59 72 78 
	Fax +47 - 73 59 72 50 

________________________________

	From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org
<mailto:gdal-dev-bounces at lists.maptools.org?> ] On Behalf Of
jjknoops at netscape.net
	Sent: 17. september 2007 15:37
	To: gdal-dev at lists.maptools.org
	Subject: [Gdal-dev] Fwd: plate carree to latlon projection
problem
	
	
	Hello Everybody,
	
	
	I am using gdal for a couple of year now and I am very satisfied
with it. 
	But now i have a problem with reprojecting from and to plate
carree(epsg:32662). 
	I have data in plate carree and I need to reproject to latlon
but i there is an offset between the results and other data that already
in latlon.
	I have also used Erdas Imagine 9.1 to do the reprojecting but i
get a different results then from gdal. The results from Erdas are beter
then from gdal
	
	After testing it with a worldwide dataset. I found that the
offset is almost 0 at (0,0) to several km around Brittian. Is there a
problem with the reprojection using plate carree or do you use a
different wgs84 then Erdas?
	
	I am using gdal from fwtools 1.3.6
	
	Best Regards,
	Jaap Knoops
	________________________________

	Check Out the new free AIM(R) Mail
<http://o.aolcdn.com/cdn.webmail.aol.com/mailtour/aim/en-us/index.htm>
-- Unlimited storage and industry-leading spam and email virus
protection.
	
	_______________________________________________
	
	Gdal-dev mailing list
	
	Gdal-dev at lists.maptools.org
	
	http://lists.maptools.org/mailman/listinfo/gdal-dev
	





More information about the Gdal-dev mailing list