[Gdal-dev] gdalwarp: different results with proj4 and WKT SRS
information
Joaquim Luis
jluis at ualg.pt
Wed Dec 6 15:34:19 EST 2006
Nicolas Ribot wrote:
> Hi all,
>
> I noticed the following behaviour with gdalwarp:
>
> When warping an image, I set the t_srs parameter to be a PROJ4 string
> coming from a MapInfo tab file (projection got with:
>
> ogr.Open(poly_filename).GetLayer(0).GetSpatialRef().ExportToProj4()
> where poly_filename is the name of the TAB file
>
> The warped image is not correct and I can see a slight shift between
> the image and the mapinfo TAB file displayed on it.
>
> When I do not use the proj4 string, but instead a file containing the
> WKT srs definition got from the same TAB file, I get the correct
> result for the warped image.
>
> Am I missing something with t_srs parameter ?
>
> Here is the proj4 string from my MAPINFO file:
> +proj=lcc +lat_1=60 +lat_2=69 +lat_0=60 +lon_0=-132.5 +x_0=0 +y_0=0
> +ellps=GRS80 +datum=NAD83 +units=m +no_defs
>
> and the WKT SRS from the same file:
> PROJCS["unnamed",GEOGCS["unnamed",DATUM["North_American_Datum_1983",SPHEROID["GRS
>
> 80",6378137,298.257222101],TOWG
> S84[0,0,0,-0,-0,-0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Con
>
> ic_2SP"],PARAMETER["standard_parallel_1",60],PARAMETER["standard_parallel_2",69],PARAMETER["latitude_of_origin",6
>
> 0],PARAMETER["central_meridian",-132.5],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1
>
> .0]]
Indeed there seams to exist a problem here.
When I convert the proj4 string, I get a different WKT. Notice that the
PROJECTION is different.
PROJCS["unnamed",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.257222101,
AUTHORITY["EPSG","7019"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6269"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9108"]],
AXIS["Lat",NORTH],
AXIS["Long",EAST],
AUTHORITY["EPSG","4269"]],
PROJECTION["Lambert_Conformal_Conic_1SP"],
PARAMETER["latitude_of_origin",60],
PARAMETER["central_meridian",-132.5],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
Joaquim Luis
More information about the Gdal-dev
mailing list