Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Statistical computing language and software environment.
0
votes
0
answers
1k
views
Why is coord_sf needed to plot a geom_raster with ggplot2?
Why is coord_sf() needed to plot a geom_raster in ggplot2 and what exactly does coord_sf() do?
According to ggplot2's Map project's documentation: coord_map projects a portion of spherical earth onto …
2
votes
R Error in sp::CRS(SRS_string = from$wkt): unused argument (SRS_string = from$wkt)
/spatial_crs_coding/#defining-a-crs-with-sp
Windows users: to make sure that the rgdal and sf packages use GDAL 3 / PROJ ≥ 6 – which is now highly advised: please update all your packages in a pure R … console (not RStudio) that uses your latest installed R version, by running update.packages(ask = FALSE, checkBuilt = TRUE). …
1
vote
1
answer
2k
views
R Error in sp::CRS(SRS_string = from$wkt): unused argument (SRS_string = from$wkt)
A previous script that I had is no longer working after the sf package major change. I am using sf 0.9.6 and raster 3.0.2. I have tried to modify my code but cannot run raster::extract().
My previous …
7
votes
3
answers
1k
views
Find maximum extent out of list of shapefiles (in projected coordinate system) in R
find_extent)
shapefile_extents
I can't figure out how to go from a list of matrices (shapefile_extents) to a list of absolute max coordinates to use in something like (taken from Crop a raster file in R) … :
e <- as(extent(-16, -7.25, 4, 12.75), 'SpatialPolygons')
crs(e) <- "+proj=longlat +datum=WGS84 +no_defs"
r <- crop(worldpopcount, e) …
8
votes
Accepted
Use mapview r package to display vector data with outline only
alpha.regions parameter is the answer:
m1 <- mapview::mapview(ndvi_cropped_20181005, map.types = 'OpenStreetMap')
m2 <- mapview::mapview(fallowed_reprojected, color = 'cyan', alpha.regions = 0)
m1 + …
4
votes
1
answer
2k
views
Use mapview r package to display vector data with outline only
I'm creating a map in r using the mapview package. I have a raster layer with a vector layer displayed over it. I want to view the raster data completely. …
0
votes
1
answer
418
views
Pattern matching with grepl on SpatialPolygonsDataFrame object in R
I am trying to use grepl as part of an if control statement in R. …
3
votes
1
answer
3k
views
Overlay shapefile on multiband raster using ggRGB and ggplot2 in R
fallowFieldsDataFrame <- fallowFieldsWGS %>% fortify
landsatAprilCropped <- raster::crop(L8_20180420_brick, raster::extent(fallowFields))
p <- ggplot()
p + ggRGB(img = landsatAprilCropped,
r … plotRGB(landsatAprilCropped,
r = 3, g = 2, b = 1,
stretch = 'hist', axes = TRUE,
main = 'Fallow Fields Overlaid on Landsat Image: 4/20/2018')
plot(bardFallowFields, col = 'transparent …
2
votes
0
answers
241
views
Using Band Math in R Creates Raster with Different Coordinate System?
When I run a create a new raster of a simple NDVI calculation in R, the new raster seems to have the same coordinate system in R. … ndvi.tif Raster Dataset Properties in ArcMap:
Here's my R code taken from https://geoscripting-wur.github.io/IntroToRaster/:
# Call required packages
library('raster')
library('rgdal')
L8_p38r37 …