Reprojecting Satellite Maps


Regular readers know, I'm Creating an "Organization of Cartographers for Social Equality" map. I've already had some success using an existing NZ Centric, Equal Earth Map. And I've programmatically created a correctly projected map with R.

But is it possible to do this with Satellite imagery? YES!

Install gdal

For this to work, you'll need GDAL - the Geospatial Data Abstraction Library. They're a handy set of tools for getting and manipulating maps.

Get the data

Sentinel-2 launched in 2015:

The Copernicus Sentinel-2 mission comprises a constellation of two polar-orbiting satellites placed in the same sun-synchronous orbit, phased at 180° to each other. It aims at monitoring variability in land surface condition

You can browse the maps on https://s2maps.eu/ and - best of all - the images are licenced under Creative Commons!

To download the data, run:

BASH BASHgdal_translate -of JPEG -outsize 1600 900 \
   "WMS:https://tiles.maps.eox.at/?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=s2cloudless-2019&SRS=EPSG:4326&BBOX=-180.000000,-90.000000,180.000000,90.000000&FORMAT=image/jpeg&TILESIZE=256&OVERVIEWCOUNT=17&MINRESOLUTION=0.0000053644180298&TILED=true" \
   1600x900.jpeg

That downloads the map in EPSG:4326 projection, saves a JPG, and an XML file with metadata.

To see which different versions of the data are available, run:

BASH BASHgdalinfo "WMS:https://tiles.maps.eox.at/?SERVICE=WMS&"

See this StackOverflow answer for details.

Re-project the data

OK, we now have the data in WGS84 format. Let's squish it around into a different projection. In this case, Equal Area Cylindrical (cea), centred roughtly on New Zealand, and South side up:

BASH BASHgdalwarp -s_srs EPSG:4326 \
 -t_srs "+proj=cea +lon_0=146 +x_0=0 +y_0=0 +lat_ts=45 +ellps=WGS84 +datum=WGS84 +units=m +no_defs +axis=wsu" \
 -r near \
 -of PNG \
 1600x900.jpg out.png

Result

South up satellite photo. Click to embiggen.

🄯 CC BY-NC-SA "Sentinel-2 cloudless - https://s2maps.eu by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2020)"

Other Sources

There are a few other sources you can use.

Natural Earth provides great imagery. Colourful map of the world.

NASA's World View gives realtime-ish satelite images. Satellite view of the earth.

More resources on the EOS blog.


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">