Re: [R-sig-Geo] Elevation data

2017-01-13 Thread Miluji Sb
Dear Loic,

Thank you for your reply!

Re. aggregation, I agree - I will use either mean or median.

gcp_grid are points as below

structure(list(longitude = c(-179L, -178L, -177L, -177L, -177L,
-176L), latitude = c(-15L, -15L, -14L, 51L, 52L, -22L)), .Names =
c("longitude",
"latitude"), row.names = c("1", "2", "3", "4", "5", "6"), class =
"data.frame")

Thank you for your suggestion on the additional options, I will look them
up. Would you say I am on the right path after the changes? Thanks again!

Sincerely,

Milu

On Fri, Jan 13, 2017 at 3:35 PM, Loïc Dutrieux  wrote:

>
>
> 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  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 
> >>> 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  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@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 

Re: [R-sig-Geo] Elevation data

2017-01-13 Thread Loïc Dutrieux


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  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 
>>> 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  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@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@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: [R-sig-Geo] Elevation data

2017-01-13 Thread Miluji Sb
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)

# Extract by lon lat (1° x 1° - gcp_grid)
elevation <- cbind(gcp_grid, alt = extract(elevation_world_1deg, gcp_grid))

elevation <- as.data.frame(elevation)
###

Is this correct? Thanks again!

Sincerely,

Milu

On Fri, Jan 13, 2017 at 3:11 AM, Bacou, Melanie  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 
>> 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  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@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@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: [R-sig-Geo] Elevation data

2017-01-12 Thread Bacou, Melanie
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  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  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@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@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo