Free SRTM elevation data in R – getData function

In this post, we show how to use the getData function of the well-known raster package to retrieve SRTM data. The function allows you to retrieve data from three free databases:

We are interested in the database of elevation data defined as ‘SRTM’. SRTM data is stored in 5 x 5 degree tiles. In order to retrieve the data using the function, it is also necessary to define the geographical coordinates of the object of interest, e.g. latitude 52 degrees and longitude 21 degrees. Our function should look like this:

A tile containing the specified coordinates is downloaded directly from the page to our computer:

Let’s see what the downloaded file looks like:

getdata_1

To learn how to retrieve data from other databases, see the documentation for the getData function. We will just tell you that you can get different detailed data for the other two databases. Have fun learning 🙂

Leave a Reply

Your email address will not be published.

Translate using Google Translate»
Social media & sharing icons powered by UltimatelySocial

Podoba Ci się nasza strona? Odwiedź nasz profil