How to select EPSG:3857, i.e. Web Mercator projection

Hi, I have not found this popular projection in the list of available cylindrical projections. Can I get this projection with GMT? I have tried -Jm, but this does seem to fit well.


See the -J description on this page. It may help you:

I did, but the document does not mention Web Mercator, or Pseudo Mercator as it is known this projection.

I know little about projections, but perhaps this is what you want?

gmt coast -R-180/180/-80/80 -JEPSG:3857 -Baf -W1p -pdf map

@onturenio, I think you should have a closer look at -Jproj|EPSG:n on the page provided by @seisman.

GMT is capable of using PROJ when linked against GDAL. You can now provide EPSG identifiers for your desired projection. You may ask what that’s good for. Well, the Web-Mercator projection, while not available in the traditional GMT syntax, has the EPSG identifier 3857.

So @seisman’s example will give you exactly what you are looking for. Try using -JEPSG:3857 and you should get your desired projection.

Web Mercatoer is a Mercator projection with a spherical ellipsoid, so to get it with classic GMT use --PROJ_ELLIPSOID=Sphere … or --PROJ_ELLIPSOID=Web-Mercator as per

But the main issue is that you seem to be after a image georeferencing. For that I recommend the use of gdalwarp from GDAL. Not obvious use if don’t know the procedures though. You’ll need to create control points that map the image coordinates to earth coordinates.

Oh, this one seems to have sneaked in with version 6.1. I wasn’t aware of it …


Both approaches, i.e. using -JEPSG:3857 and --PROJ_ELLIPSOID=Sphere seem to work. Thanks a lot.

PS: You are absolutely right @Joaquim, I’m trying to cope with image georeferencing, and I’m having a hard time to get used to the tools. I have quite experience plotting climate model data with GMT, where everything is ‘easy’ and properly referenced. Now I’m trying to do the reverse approach, i.e. using teledetection data to build netCDF files and well, it’s becoming harder than I thought.

1 Like

netCDF is not the best choice for images, better to stick to geotiff. Have you looked into gdalwarp? It does what you want, though not without some data preparation.

Thanks for the follow up. It certainly sounds like the right way to go. But to be honest I’m reading about it yet. I have no experience whatsoever with that library and so far it seems quite intimidating. But GMT was also a bit overwhelming at first so…

Yes, the logic of both packages usage are a bit different and I find the GDAL manual more difficult to follow, but it’s a very useful set of tools.