[Gdal-dev] Warping Plate Carree images to Mercator

Robert Rose robert.w.rose at gmail.com
Thu Jun 1 18:58:29 EDT 2006


Howdy folks!  I'm super-new to GDAL and the whole GIS space.  I've got
a question that I think is pretty simple...

I'm trying to warp the NASA BlueMarble images into Mercator WGS84
projected images.  The documentation on BlueMarble says that they come
in the Plate Carree WGS84 projection system.

For starters I'm trying to take the lowest-resolution 8km whole-world
image and convert it into a 512x512 GeoTIFF in Mercator.  Below is my
best guess so far as to how to do this with the gdal command line
utilities:

> gdal_translate -a_srs EPSG:32662 -gcp 0 0 -180 90 -gcp 5400 0 180 90 -gcp 5400 2700 180 -90 world.jpg world.tif
Input file size is 5400, 2700
0...10...20...30...40...50...60...70...80...90...100 - done.

> gdalinfo world.tif
Driver: GTiff/GeoTIFF
Size is 5400, 2700
Coordinate System is `'
GCP Projection = PROJCS["WGS 84 / Plate Carree",GEOGCS["WGS 84",DATUM["WGS_1984"
,SPHEROID["WGS 84",6378137,298.2572235630016,AUTHORITY["EPSG","7030"]],AUTHORITY
["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORI
TY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32
662"]]
GCP[  0]: Id=1, Info=
          (0,0) -> (-180,90,0)
GCP[  1]: Id=2, Info=
          (5400,0) -> (180,90,0)
GCP[  2]: Id=3, Info=
          (5400,2700) -> (180,-90,0)
Metadata:
  AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 2700.0)
Upper Right ( 5400.0,    0.0)
Lower Right ( 5400.0, 2700.0)
Center      ( 2700.0, 1350.0)
Band 1 Block=5400x1 Type=Byte, ColorInterp=Red
Band 2 Block=5400x1 Type=Byte, ColorInterp=Green
Band 3 Block=5400x1 Type=Byte, ColorInterp=Blue

>gdalwarp -s_srs EPSG:32662 -t_srs "+proj=merc +datum=WGS84" -ts 512
512 world.tif worldm.tif
Processing input file world.tif.
:0...10...20...30...40...50...60...70...80...90...100 - done.

The end result is definitely a 512x512 file that's been warped, but it
doesn't look at all like a Mercator projection of the Earth.

Any help would be greatly appreciated!  Thanks!

-robert



More information about the Gdal-dev mailing list