[R-sig-Geo] Elevation data
Loïc Dutrieux
loic.dutrieux at conabio.gob.mx
Fri Jan 13 15:35:16 CET 2017
On 13/01/2017 10:59, Miluji Sb wrote:
> Thank you for your reply. This is what I did:
>
> ###
> library(data.table)
> library(raster)
> library(rgdal)
> library(foreign)
>
> elevation_world <- getData('worldclim', var='alt', res=2.5)
>
> # Aggregate Elevation to 1 degree
> elevation_world_1deg <- aggregate(elevation_world, fact = 24, fun = sum)
Aggregating with fun=sum is a bit strange for elevation. mean or median
would certainly be a better choice.
>
> # Extract by lon lat (1° x 1° - gcp_grid)
> elevation <- cbind(gcp_grid, alt = extract(elevation_world_1deg, gcp_grid))
gcp_grid are points or polygons? If they are polygons, there's no need
for the aggregation step above. Also have a look at df = TRUE, which
returns a dataframe, and sp=TRUE, which returns a Spatial*DataFrame with
extracted values cbinded to the attributes of the original
Spatial*DataFrame. (both are arguments of raster::extract)
Cheers,
Loïc
>
> elevation <- as.data.frame(elevation)
> ###
>
> Is this correct? Thanks again!
>
> Sincerely,
>
> Milu
>
> On Fri, Jan 13, 2017 at 3:11 AM, Bacou, Melanie <mel at mbacou.com> wrote:
>
>> R raster::getData("SRTM", ...) will return elevation rasters at 90m
>> resolution.
>> See:
>> https://www.rdocumentation.org/packages/raster/versions/2.5-
>> 8/topics/getData
>> http://www.cgiar-csi.org/data/srtm-90m-digital-elevation-database-v4-1
>>
>> --Mel.
>>
>>
>> On 1/11/2017 6:26 AM, Miluji Sb wrote:
>>
>>> Dear Michael,
>>>
>>> Thank you for your reply and the suggestions.
>>>
>>> Ideally, I would like a raster from which I can extract elevation at 1° x
>>> 1° resolution. I do not have much experience with working with DEM but
>>> have
>>> work with data such as GPW.
>>>
>>> I will definitely look at the datasets. Could you kindly suggest one that
>>> I
>>> could convert to raster and extract? Hope that's not a silly question.
>>>
>>> Sincerely,
>>>
>>> Milu
>>>
>>> On Wed, Jan 11, 2017 at 1:51 AM, Michael Sumner <mdsumner at gmail.com>
>>> wrote:
>>>
>>> Passed through? Maybe you want ?raster::extract
>>>>
>>>> There are a few versions of global elevation on CRAN, necessarily at low
>>>> resolution but no overall summary afaik (someone should do this :).
>>>>
>>>> This is one: https://cloud.r-project.org/web/packages/GEOmap/index.html
>>>>
>>>> If you have the stomach for development versions of packages see elevatr:
>>>> https://github.com/jhollist/elevatr
>>>>
>>>> I tend to have the high-resolution files at hand because we use them
>>>> constantly, the main ones are Gebco14/Gebco08 and Etopo1/Etopo2 (from
>>>> Smith-Sandwell).
>>>>
>>>> There's a reasonable overview here, you probably should find a specific
>>>> data set that is at the resolution you are after already, and you can
>>>> cite
>>>> its derivation for your work:
>>>>
>>>> http://vterrain.org/Elevation/global.html
>>>>
>>>> Cheers, Mike.
>>>>
>>>> On Wed, 11 Jan 2017 at 10:20 Miluji Sb <milujisb at gmail.com> wrote:
>>>>
>>>> Dear all.
>>>>>
>>>>> Is there a way to download global elevation data at the 1° x 1°
>>>>> resolution
>>>>> in R using a given set of coordinates?
>>>>>
>>>>> I know about the getData() function but can many coordinates be passed
>>>>> through this? Thanks!
>>>>>
>>>>> Sincerely,
>>>>>
>>>>> Milu
>>>>>
>>>>> [[alternative HTML version deleted]]
>>>>>
>>>>> _______________________________________________
>>>>> R-sig-Geo mailing list
>>>>> R-sig-Geo at r-project.org
>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>>
>>>>>
>>>>> University of Tasmania Electronic Communications Policy (December,
>>>>> 2014).
>>>>> This email is confidential, and is for the intended recipient only.
>>>>> Access, disclosure, copying, distribution, or reliance on any of it by
>>>>> anyone outside the intended recipient organisation is prohibited and
>>>>> may be
>>>>> a criminal offence. Please delete if obtained in error and email
>>>>> confirmation to the sender. The views expressed in this email are not
>>>>> necessarily the views of the University of Tasmania, unless clearly
>>>>> intended otherwise.
>>>>> .
>>>>>
>>>>> --
>>>> Dr. Michael Sumner
>>>> Software and Database Engineer
>>>> Australian Antarctic Division
>>>> 203 Channel Highway
>>>> Kingston Tasmania 7050 Australia
>>>>
>>>>
>>>> [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
More information about the R-sig-Geo
mailing list