See also FAO GAUL 2015 Edition (is the latest I blieve):
https://geonode.wfp.org/layers/geonode%3Aadm1_gaul_2015
And the UN Humanitarian Data Exchange for all latest official
country boundaries:
https://data.humdata.org/
--Mel.
On
Tom,
Try something like that:
spplot(raster, at=1:3,
col.regions=c(col1, col2, col3),
colorkey=list(labels=list(labels=c("Af", "Am", "Aw"),
at=1:3+.5)))
Else use package `tmap` (friendlier interface).
--Mel.
On
Dear List,
I am a long term user of raster::getData to easily retrieve
historical time-series from WorldClim. Is there a plan (or
separate R packages) to extend this feature to other bioclimatic
datasets, in particular:
- USGS RFE v2.0
Cotton,
Why use the ESRI format? Will be much easier to download the
GeoTIFF rasters and raster::extract() to conduct your analysis.
--Mel.
On 05/02/2018 02:56 PM, Cotton Rockwood
wrote:
Hi Roman -
As far as I know, 'readOGR' does
This works for me (`f` is a data.frame of X,Y origin locations,
`t` is a data.frame of X,Y destinations):
osrm_api <- function(f, t, key=NULL) {
url <-
"https://router.project-osrm.org/table/v1/driving/"
url <- paste0(url,
paste(f$X,
Sorry the exact code is:
xy.r <- extract(r, xy.sp)
xy.r.sample <- lapply(xy.r, sample, 10)
On 10/24/2017 01:34 PM, Bacou, Melanie
wrote:
Andy,
Simple use `extract()` instead of `mask()`, and then randomly
sample
Andy,
Simple use `extract()` instead of `mask()`, and then randomly
sample cells in each polygon. Should be much faster, e.g.:
xy.r <- extract(r, xy.sp)
xy.r.sample <- lapply(xy.r, sample.int, n=10)
--Mel.
On 10/23/2017 12:57 PM, Andy Bunn
I would assume `raster::getData("worldclim", ...)` uses WorldClim
version 2?
--Mel.
On 09/25/2017 05:14 PM, Andy Bunn
wrote:
Great. Thanks Marcelino. I have all the data dowloaded. I'm surprised that
there isn't a dedicated package for
://www.sciencedirect.com/science/article/pii/S0304380007001949
best wishes,
Rafael H M Pereira
On Fri, Sep 1, 2017 at 11:42 AM, Bacou, Melanie <m...@mbacou.com> wrote:
On 09/01/2017 03:53 AM, Roger Bivand wrote:
On Fri, 1 Sep 2017, Bacou, Melanie wrote:
I am wondering if current R
On 09/01/2017 03:53 AM, Roger Bivand wrote:
On
Fri, 1 Sep 2017, Bacou, Melanie wrote:
I am wondering if current R raster operations (e.g. `extract()`,
`resample()`, distance(), etc.) can be modified to work with
honeycomb
I am wondering if current R raster operations (e.g. `extract()`,
`resample()`, distance(), etc.) can be modified to work with
honeycomb (hexagonal) grids instead of simple square grids? This
is driven by e.g. work at Uber
p the attributes.
> Option2) rgeos:over I know this tool, but O have several lines
> crossing among them. I am afraid, that can be a bit messy.
> I doesn't know the gTouches...I check it after your suggestion..
> But I think the rgeos:Over os the best option for me.
> Thanks for
Marta,
Option 1) using CreateSegments() seems to do what you want. Why don't
you simply use rgeos::over() or rgeos::gTouches() between your old and
new SLDFs to match the index positions of your old attributes to your
new segments?
--Mel.
On 2/23/2017 2:27 PM, marta azores wrote:
Hi all,
I have not tested yet, but there is an R package to interact with 2 NASA
APIs:
- Earth Observatory Natural Event Tracker (EONET) web service
- Earth Imagery API and Earth Imagery Assets API (Landsat8)
https://github.com/Eflores89/nasadata
http://www.gis-blog.com/nasadata/
--Mel.
On 2/11/2017
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
Hi,
I need to generate a large series of NetCDF files (over 800) and I'm
trying to follow good metadata practices per
http://www.unidata.ucar.edu/software/netcdf/examples/files.html.
Could some of you suggest an approach to:
1) add projection information to .nc files (using
Chris,
Actually I take that back, using extract() with `weights=TRUE` returned
`0` instead of NA values for these problematic coastal admin units.
Think I might have to impute them manually.
--Mel.
On 10/18/2016 2:33 PM, Bacou, Melanie wrote:
>
> Chris,
> Thanks, using `wei
r::extract it looks like you want to employ the
> weights are if your polys are relatively smaller than your cells.
>
> HTH
> Chris
>
>
> On Oct 18, 2016 4:35 PM, "Bacou, Melanie" <m...@mbacou.com
> <mailto:m...@mbacou.com>> wrote:
>
> Hi,
>
Hi,
I'm summarizing biophysical rasters (UDEL precipitation and temperature)
across administrative units for countries in Africa using (pseudo code):
raster::extract(udel, admin, fun=mean, na.rm=T, small=T)
Out of the 756 units I need data for, extract() fails to return means
for a few
In addition, you could also take a look at IIASA global data:
http://www.iiasa.ac.at/web/home/research/modelsData/models-tools-data.html
--Mel.
Hi,
About Vegetation can you use the Tree Cover map, develop by Hansen team.
They use Landsat data to identify the tree cover coverage.
The research
Here is a stump that might also work with levelplot():
# Plot raster with no scalebar first
raster::plot(r, col=vector_of_colors, legend=FALSE, axes=FALSE)
# Add a custom scalebar
raster::plot(r, legend.only=TRUE,
col=vector_of_colors,
axis.args=list(at=1:length(vector_of_labels),
l at
http://environmentalinformatics-marburg.github.io/mapview/introduction.html
which has all the details.
HTH
Tim
On 20.09.2016 11:06, Bacou, Melanie wrote:
Tim,
Both `leaflet` and `tmap` currently offer quick interactive
visualization of geospatial data in R. Does `mapview` provide
different fun
Tim,
Both `leaflet` and `tmap` currently offer quick interactive
visualization of geospatial data in R. Does `mapview` provide different
functionality at this point?
https://rstudio.github.io/leaflet/
https://cran.r-project.org/web/packages/tmap/vignettes/tmap-nutshell.html
Thx, --Mel.
On
Jaya,
Have a look through the `leaflet` and `tmap` package documentation.
There are examples there.
--Mel.
On 8/29/2016 7:51 PM, Jaya Krishnan wrote:
HI,
I've been trying to make an interactive web map using leaflet package in R.
Just have a couple of issues.
1. Is it possible to get a
Sorry I meant reproject using nearest neighbor:
projectRaster(from, to, method="ngb")
On 8/28/2016 2:37 AM, Bacou, Melanie wrote:
Isaque,
If your LandScan raster is at 30m resolution, then best might be to
`aggregate()` to as close as 250m (e.g. using `fact=8` or `fact=9` and
saggregate to greatest common factor (5
> or 10m) cells first, then aggregate up to 250m MODIS. With mode on
> categorical data, that should still give you your expected results;
> with continuous raster values and other functions, it might not be
> appropriate.
>
> Tom 2
>
Isaque, check this thread on StackExchange:
http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work
--Mel.
On 8/26/2016 10:07 PM, Isaque Daniel wrote:
> Hi dear all,
>
>
> I need to resample a tree cover map create by Landsat imagery to the MODIS
>
Barry,
This looks great. Til now I've been using `tmap` (with leaflet) to
explore spatial data interactively and to print maps within R, but a
QGIS widget offers interesting options for creating and re-using styles.
What about editing features within the widget as well (e.g.
Maybe create a function that takes a date as input and returns a
meteorological season, and pass this function to `zapply(by=fun)`.
--Mel.
On 8/16/2016 8:38 PM, Thiago V. dos Santos via R-sig-Geo wrote:
Dear all,
I am using the raster package to calculate seasonal averages of climatic
I also recommended browsing through NOAA PSD curated catalog. I believe
it's up-to-date and provide useful metadata and links to original sources:
http://www.esrl.noaa.gov/psd/data/
--Mel.
On 8/2/2016 5:34 PM, Tom Philippi wrote:
Without knowing what part of the globe you need climate data
Here is an approach using raster::extract(). I assume your point
locations are unprojected.
library(raster)
library(tmap)
data(World)
proj4string(World)
# [1] "+proj=eck4 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84
+units=m +no_defs +towgs84=0,0,0"
pts <- SpatialPointsDataFrame(temp [,
getData("GADM",
country=x, level=1))
m <- do.call(bind, m)
Robert
On Sat, Jul 23, 2016 at 4:10 AM, Bacou, Melanie <m...@mbacou.com> wrote:
Edzer, Rolf,
Many thanks for the clarification!
Just to confirm that Rolf's `do.call()` example works for me using the
latest GitHub commi
>> On 7/22/2016 5:53 PM, Edzer Pebesma wrote:
>>> The correct call to rbind would be
>>>
>>> mm = rbind(m[[1]], m[[2]], m[[3]], makeUniqueIDs=T)
>>>
>>> with sp on CRAN this doesn't work; with the version on github it does.
>>>
>>
>
> with sp on CRAN this doesn't work; with the version on github it does.
>
> An alternative with sp from CRAN is to make the IDs unique by hand:
>
> spChFIDs(m[[1]]) <- paste0("A", seq(length(m[[1]])))
> spChFIDs(m[[2]]) <- paste0("B", seq(lengt
Hi,
I'm getting weird results trying to rbind a list of
SpatialPolygonsDataFrames with R 3.2.1 and raster 2.5.8. I believe the
code below used to merge all 3 country boundaries, but instead I now get
a list with 6 elements (incl. 3 logical TRUE). Am I doing something wrong?
Thx, --Mel.
>
No self promotion, but in case you're looking for code examples using
leaflet plugins (scalebar and minimap) available through `tmap` :
http://tools.harvestchoice.org/ar/ (code is linked at the bottom of the
page).
--Mel.
On 7/18/2016 8:36 AM, Tim Appelhans wrote:
My suggestion would be the
Just chiming in, but I don't see any reason for wrapping `readOGR()` and
`writeOGR()`. For the sake of code portability and readability, the fact
that these 2 functions work for a myriad of vector-based GIS formats is
a great thing. You can skip naming parameters to save typing if that's
an
Also when summarizing classified rasters, it is usual to use the `mode`
function (instead of `sum`) since you're typically interested in the
dominant class.
On 7/11/2016 5:48 PM, Fernando Gimeno wrote:
i have a raster with attribute table and i need extract values with a
polygon. Help me
Simply refer to the documentation for `raster::extract(..., factors=TRUE)`.
http://www.inside-r.org/packages/cran/raster/docs/extract
--Mel.
On 7/11/2016 5:48 PM, Fernando Gimeno wrote:
i have a raster with attribute table and i need extract values with a
polygon. Help me please.
Interesting problem, it seems the exact approach is given by Fischer,
2003 and is implemented in a C++ CGAL package (see
http://stackoverflow.com/questions/9063453/how-to-compute-the-smallest-bounding-sphere-enclosing-other-bounding-spheres).
I haven't found any binding for R, but there's an
Seems the simplest might be to use the circle that contains your points'
bounding box (same center as the bbox and with a diameter equal to its
diagonal?
Spatial circles may be defined as SpatialPolygonsDataFrame using
sampSurf::spCircle().
Note that NDVI trend decomposition is also available in package
greenbrown by Matthias Forkel :
http://greenbrown.r-forge.r-project.org/trends.php
On 7/8/2016 1:58 AM, Bacou, Melanie wrote:
Sorry, sent that too fast. `seasonal()` is defined in the bfast
package here:
https://github.com/cran
Sorry, sent that too fast. `seasonal()` is defined in the bfast package
here:
https://github.com/cran/bfast/blob/master/R/seasonal.R
--Mel.
On 7/8/2016 1:51 AM, Bacou, Melanie wrote:
Guillaume,
See https://www.rforge.net/doc/packages/hydroTSM/seasonalfunction.html
for the `zoo:seasonal
Guillaume,
See https://www.rforge.net/doc/packages/hydroTSM/seasonalfunction.html
for the `zoo:seasonal()` function. In general just look into the
package's NAMESPACE to see which libraries are imported.
--Mel.
On 7/7/2016 5:10 PM, Guillaume Clair wrote:
Hi,
I'm using the function (and
Tony,
I can confirm this seems like an issue with `projectRaster()`. Using
`gdalwarp` instead on the same tile seems to work.
# Download geoTIFF
BS.terra <-
curl::curl_download("https://lance.modaps.eosdis.nasa.gov/imagery/subsets/?subset=BeringSea.2016182.terra.721.2km.tif;,
45 matches
Mail list logo