7

I have some TIFs in EPSG4326 the GeoTiff info looks like:

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]

How do convert them into EPSG:3857 so that the GeoTiff info reads something like:

PROJCS["Google Maps Global Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
2
  • gdal_translate -of GTiff -s_srs epsg:4326 -t_srs epsg:3857 input.tif output.tif
    – user30184
    Jul 2, 2014 at 20:19
  • Sorry, of course gdalwarp.
    – user30184
    Jul 3, 2014 at 5:57

2 Answers 2

11

Use the gdalwarp utility.

gdalwarp -s_srs epsg:4326 -t_srs epsg:3857 input.tif output.tif
3
  • Hi, just found this from Google. Any idea why the above command gives me the following errors? ERROR 1: PROJ: proj_create_from_database: Cannot find proj.db ERROR 1: Translating source or target SRS failed: EPSG:3857 Aug 30, 2022 at 18:30
  • 1
    @Z.Reticulan your environment is not set correctly. Search for that error (Google, StackExchange), there's plenty of answers.
    – user2856
    Aug 30, 2022 at 22:21
  • Thanks. I followed Alfonso's instructions here: stackoverflow.com/questions/56764046/… Aug 31, 2022 at 20:04
1

Use EPSG:3857. That is the official EPSG code number for Google mercator projection.

900913 was incorporated in GDAL some time ago, but is now dropped in favour of 3857.

2
  • 1
    Ok thanks, but how do I do the actual conversion to EPSG:3857 Jul 2, 2014 at 18:57
  • 1
    See the answer by Luke for the command line syntax.
    – AndreJ
    Sep 15, 2016 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.