[gdal-dev] GDAL for BNG to Lat/Long, WGS84

Frank Warmerdam warmerdam at pobox.com
Tue Mar 2 00:52:07 EST 2010


scottd777 wrote:
> Hi, and thank heaven for GDAL!   
> 
> I was so happy to find this tool, but I am having some trouble figuring out
> the exact command I need for an image warping application.  If there is
> someone who doesn't mind a newbie type question, I could really use the
> help! 
> 
> Essentially, I have imagery which is referenced with British National Grid. 
> I am tyring to convert / warp this so that it can be used within Google
> Earth.  I have reference points for the upper left and lower right of the
> image in Easting and Northing, and transformed those so that I got lat /
> long coordinates which line up very well within Google Earth, however it
> appears that the projection is off.   
> 
> I am hoping to use gdalwarp to convert the TIF file (referenced as
> mentioned), but I had some questions: 
> - For the world file that I create for gdalwarp, should I include the
> Easting / Northing, or does this need to be lat / long? 

Scott,

If the file is in the british national grid then the origin and pixel
size should be in british national grid meters.

> - Can I just go straight to gdalwarp, or do I need to do some other
> translation first? 

If you have a TIFF with a world file you should be able to just proceed
directly with the warp.

> - The command I am trying to use looks like this: 
> gdalwarp -s_srs "proj=utm +zone=33v +datum=OSGB36" -t_srs "proj=latlong
> +datum=WGS84" filein.tif out.tif 
 >
> Is this the correct command to get from a BNG source ortho image to what
> would overlay correctly in something like Google Earth? 

I'm not google earth guru, but I had assumed that it expected imagery in
the "google mercator" projection, not in geographic lat/long as you have
targetted.  I would instead use a command like:

gdalwarp filein.tif out.tif -s_srs EPSG:27700  \
-t_srs "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 
+k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"

I don't believe british national grid is the same as UTM 33, and I don't
believe that a "v" in the zone indicator will mean anything to PROJ.4.
EPSG:27700 is the british national grid.

I have provided the full definition of the google mercator projection
though shorter forms like EPSG:900913 or EPSG:3857 might work depending
on the version of GDAL and supporting files you have.

scottd777 wrote:
 > Please?  Anyone?  I'm sure the response will be really quick...

Not such an easy answer, and I'm not sure it will be everything you
need.  The problem with the popularity of Google Earth is that it
has introduced a flood of new people with little GIS background all
asking the same questions.

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