[gdal-dev] Adding Datums to GDAL

Pascoe, S (Stephen) S.Pascoe at rl.ac.uk
Fri Jan 18 06:57:47 EST 2008


I am relatively new to GDAL and OpenGIS technology in general to
apologies if this is the wrong forum.
 
I want to use GDAL to transform a EPSG:4326 raster to British National
Grid coordinates (EPSG:27700).  With a bit a bit of googling I found the
WKT for EPSG:27700 and installed it in <gdal-root>/share/epsg.wkt:
 
27700,PROJCS["OSGB 1936 / British National Grid",
        GEOGCS["OSGB 1936",
            DATUM["OSGB_1936",
                SPHEROID["Airy
1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],
                TOWGS84[375,-111,431,0,0,0,0],
                AUTHORITY["EPSG","6277"]],
            PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
            UNIT["DMSH",0.0174532925199433,AUTHORITY["EPSG","9108"]],
            AXIS["Lat",NORTH],
            AXIS["Long",EAST],
            AUTHORITY["EPSG","4277"]],
        PROJECTION["Transverse_Mercator"],
        PARAMETER["latitude_of_origin",49],
        PARAMETER["central_meridian",-2],
        PARAMETER["scale_factor",0.999601272],
        PARAMETER["false_easting",400000],
        PARAMETER["false_northing",-100000],
        UNIT["metre",1,AUTHORITY["EPSG","9001"]],
        AXIS["E",EAST],
        AXIS["N",NORTH],
        AUTHORITY["EPSG","27700"]]

Tests indicate it is found.  However, when I try to use gdalwarp I get
an error:
 
$ gdalwarp -t_srs EPSG:27700 -te -100000 -100000 600000 600000 -ts 400
400 map.tif trans.tif
ERROR 6: Failed to initialize PROJ.4 with `+proj=tmerc +lat_0=49
+lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy
+datum=OSB36 +units=m +no_defs '.

Guessing that it didn't know what +datum=OSB36 was I tried changing it
to WGS84 and it worked (the proj parameters were taken directly from the
error above):
 
$ gdalwarp -t_srs '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717
+x_0=400000 +y_0=-100000 +ellps=airy +datum=WGS84 +units=m +no_defs' -te
-100000 -100000 600000 600000 -ts 400 400 map.tif trans.tif
 
My question is how do I install the OSGB36 datum into GDAL?  The WKT
above appears to contain parameters for this datum so why is proj_4
failing?
 
Many thanks,
Stephen.
 
 
---
Stephen Pascoe  +44 (0)1235 445980
British Atmospheric Data Centre
Rutherford Appleton Laboratory
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080118/3918599a/attachment.html


More information about the gdal-dev mailing list