Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [r]

Statistical computing language and software environment.

0
votes
0answers
16 views

Create Semivariogram from Satellite Image

I need to generate a semi-variogram for the entire satellite image (about 20 square km in size, about 50 megabytes) so I can determine the semivariogram's range. The satellite image contains near-...
0
votes
0answers
17 views

Performing PostGIS spatial joins with remote host?

I have approximately 600,000 points that must be joined to ~12 million polygons. This process happens weekly, with the potential to happen daily. The polygon data never changes, and is stored in a ...
0
votes
1answer
16 views

How to extract raster attributes by lat/long location?

How can you extract an attribute value from a raster from a point (lat/long)? Example data: Raster with attribute table - value of interest is temperature I have a list of points with lat/long ...
0
votes
0answers
9 views

How to define 3 average month values in a NDVI Modis time serie

I am working with MODIS NDVI rasters from 2016. I have 365 rasters (one per day). I need to have 3 rasters per month (total = 36). First raster = average of the first 10 days. Second raster = average ...
0
votes
0answers
7 views

SAGA_cmd crashes (using RSAGA)

I'm using SAGA-GIS to compute some terrain attributes with a DEM of file size 3.52 GB. I use Rsaga to operate on a 64 Bit operating system with an Intel(R) Core(TM) i5-2400 CPU @ 3.10 GHz Processor, ...
0
votes
1answer
14 views

R-Scatterplot: How to match palette() to not incrementing color-column

I want to visualize the feature space in my training areas using scatterplots. I use a nested classification schema, so my class values are not incrementing but sorted in categories like 100 (...
-1
votes
0answers
22 views

Graphing and coloring parts of map with precipitation data and include legend?

I need to graph rain data from OpenWeatherMap. I also need to shade in a red color with an opacity of 0.3, on top of the prcipitation layer. This is the code I have, but it gives me an error, that ...
2
votes
0answers
22 views

Detecting QGIS file lock

I tried using rgdal::writeOGR in R to overwrite a SHP file that was open in QGIS. Error in writeOGR(x, "C:/myFiles", "testFile", : Creation of output file failed Not only did it fail to ...
0
votes
0answers
20 views

How to use httr R package to query thematic polygons from api.ohsome.org?

OpenStreetMap (OSM) nodes and ways provide key value pairs, for instance: key:landuse and value:vineyard. How to query the latest polygons (ways) of Toulouse from api.ohsome.org that contain the key ...
2
votes
1answer
42 views

Calculating standard metrics in multiple LiDAR files with lidR 2.0 [on hold]

I am porting my existing code to lidR version 2.0 and would like someone to let me know if I am coding efficiently. My objective is: to process a directory of LAS files normalize las files calculate ...
0
votes
1answer
9 views

Using catalog_apply in the lidR 2.0 package, convert raster outputs to data frame format

I've moved over to version 2 of the lidR package. In previous versions, the output of producing stdmetrics using catalog_apply was a data frame. In version 2.0, the outputs are stored in raster ...
-1
votes
0answers
10 views

Calculating average distance between points using r [on hold]

I have a data set with headings Date, Latitude and Longitude. I would like to be able to calculate the average distance between points each month to measure spread of points over time, and was ...
0
votes
1answer
18 views

st_read option does not work if parameter is separated from equal (=) sign

This is a small pet peeve. I'm reading a latin1 encoded shapefile in R using st_read and the encoding option. I just found out that if I write encoding=latin1 everything works as expected but, if I ...
0
votes
1answer
18 views

Manipulating Elevation Data from the USGS National Map

I am trying out @tylermorganwall Rayshader R library. Some instructions are given here by tylermw8 to get elevation data from the USGS National Map. I am interested in obtaining data around the ...
0
votes
1answer
25 views

R levelplot: How to shade some pixels out to show statistical significance

I am posting this also on stackoverflow because the topic is in the middle between GIS and R programming. I need to include statistical significance in a map in R using rasteVis, which is based on ...
0
votes
1answer
29 views

Measure distance for spatialLine in R returns bad value

I have this spatialLine in R: library(sp) library(maptools) library(SDraw) library(leaflet) x <- c(153.9, 152.67072,147.9879,144.25364,135.45557,116.03998,76.92708,45.10622,37.02522,36.76888,36....
0
votes
0answers
51 views

Convert classified point matrix to shapefile

I've use R to generate a matrix of points tagged to separate categories. Each point has a lat, long. and category. When I plot them in QGIS (using colored points of the appropriate size) it looks like ...
2
votes
1answer
28 views

Calculate distance between buffer and geographic points for grouped subsets (and get tally)

The data I used can be found here. After importing my data, I select a subset of points (Nest2017 in column type) to create 30 m buffers around: library(dplyr) nests<-df %>% filter(type %...
0
votes
1answer
45 views

Spatial (nearest neighbour) Join Between Points (GPS coordinates) and Line in R

I want to do spatial join to an OSM line data and GPS point data both in geographic coordinate system, the result which I want is a road layer(has a unique ID) with the attributes of of road and the ...
0
votes
0answers
21 views

Changing the spatial resolution - stacked raster in R

Want to change higher spatial resolution UAV dataset stacked in R. Used raster package to stack the individual band. Want to change the spatial resolution to 1 m. stacked_UAV <- stack(stack_list)...
0
votes
0answers
17 views

Snap to grid with sf in R

Is there a snap to grid function available in sf for R similar to ST_SnapToGrid(geometry geomA, float size)in PostGIS? It is mentioned as a solution to non-noded intersection problem for PostGIS and ...
0
votes
1answer
31 views

Alignment and distribution tools for shapefiles?

Does anyone know of a native Esri tool, Python, or R package that would allow one to emulate arcmap's graphic element toolbar functionality, but for shapefiles rather than graphic elements? For ...
0
votes
0answers
19 views

Function in R to get difference between two sets of polygons comparable in speed to QGIS

I have two very large polygon shapefiles for which I need to calculate the difference between the two shapefiles. One is a shapefile of forest polygons, the other is a shapefile of road polygons. I ...
1
vote
1answer
27 views

After calling projectRaster in R, missing right edge of world map when plotting with ggplot

I'm using projectRaster and rasterToPoints in R to get a dataframe with lat/lon coordinates for plotting in ggplot but I seem to be losing the right edge of the map (New Zealand). I'm not sure if this ...
-1
votes
0answers
18 views

Addition of rasters which has same basename in R

I have rasters with same basenames in two different folders. I want to perform addition of two rasters with same basenames and save it in an output directory with same basename. library(raster) ...
-1
votes
0answers
23 views

Why does KML file imported into R result in blank 'Description' column but data is present when viewed in QGIS?

As the title states when I import a KML file into R the Description column is blank despite the data being visible when the same file is viewed in QGIS. The KML file was a KMZ file from the Avenza app....
0
votes
0answers
34 views

Calculate Bare Soil Line Intercept using R

I am using an R package called BSL (Bare soil line), package is at https://rdrr.io/cran/landsat/man/BSL.html. The BSL package uses R's lmodel2 function (https://cran.r-project.org/web/packages/lmodel2/...
0
votes
1answer
29 views

Unscramble RGB raster - 4D interpolation/lookup

I have a 4-band raster image (RGB), downloaded from a WMS, representing clay content of topsoil ranging from brown (high clay content) to yellow (low clay content). The 4th band is alpha-band, with ...
0
votes
0answers
15 views

Zero variance-series and NaN error in CAR models - CARBayes (S.CARbym) in R

I've been trying to run a CAR model (CARBayes package - S.CARbym function in R) to predict the risk of visceral leishmaniasis diseases in Sao Paulo state, Brazil. The covariates are precipitation, ...
2
votes
1answer
15 views

Expand plotting area of raster::plot

I have a raster that I'd like to plot in the Azimuthal Equidistant projection with a grid and labels. So far I've been able to do that. However, I cannot get the labels inside the plotting area. ...
0
votes
0answers
35 views

Converting raster x/y to lon/lat pairs using R? [closed]

I was able to georeference a jpg of a world map using georeferencer.com and export as a geotiff, then used the raster package in R to convert to a dataframe: dilmap <- raster("dilmap.tif") df1 <...
1
vote
0answers
45 views

Inconsistencies in R rasterize polygons, packages raster and sf

I was trying to calculate species richness from IUCN distribution data in R, and I decided to check my results with two different methods, both of which rely on rasterize function from the raster ...
0
votes
0answers
32 views

Selecting and deselecting markers in leaflet under R shiny?

I would like to write a script that selects a marker on the map whenever I click on it and then deselect it when I click/select another marker (that is, so that no more that one marker is selected on ...
0
votes
0answers
24 views

Extract raster cell values by polygon field

I have a raster as a RasterLayer (raster) and a polygon layer (bound) with 38 individual polygons as a SpatialPolygonsDataFrame. I used the polygon to mask from a larger raster. Each polygon contains ...
1
vote
1answer
45 views

Plot trajectory in R

Does anyone knows a library/technique in R where you can plot a trajectory using multiple timesteps (points) where each point does have a lat/lon coordinate? I have this data x <- read.table("...
2
votes
2answers
35 views

Convert WKT coordinate reference system to PROJ4

I'm currently working on a better support of LAS 1.4 file format in the rlas R package. In LAS 1.4 format the CRS of the point cloud can be stored as a WKT string. For example this is what I read from ...
2
votes
0answers
15 views

Removing a 'non-gap' gap from a polygon that straddles +/- 180 longitude; looking for an R-based, code solution

I am working with a set of polygons from here: http://lme.edc.uri.edu/index.php/digital-data. In the artic, there are several polygons that straddle the +/- 180 longitude line. These are single ...
0
votes
0answers
11 views

Extract values from multiple rasters based on lookup of raster file name

I have 11 raster files (waveheightfiles), and need to extract one value from a different set of coordinates (station) for each raster. I have a list of 11 coordinates (df2) and have used part of the ...
0
votes
0answers
13 views

Limiting decimal digits in attribute table of a dbf file using writeOGR function of R?

I'm writing an ESRI shapefile using writeOGR function of R on a linux platform. Then I visualize the dbf file using dbfdump command to read the attributes but the real numbers in the attribute table ...
1
vote
0answers
19 views

Multipanel with raster (spplot) and scatter plot in R

I have one raster and one scatter plot that I want to put together in a single multipanel plot. However, the par(mfrow=c()) that usually works to put together different normal plots, it doesn't work ...
2
votes
0answers
29 views

How do I load these 11 images into a multi-band raster in R?

I have a landsat image with 11 bands. I need to run k means classification in R. But i do not need the whole of the image as my study area is much smaller. So I have created shape file of the Region ...
0
votes
0answers
34 views

spTransform error (unable to find inherited method for function spTransform)

I am trying to reproject a shapefile. For example, the land shapefile from Natural Earth. library(sf) shape <- read_sf(".../ne_10m_land.shp") shape_proj<-spTransform(shape, CRS("+proj=gnom +...
2
votes
1answer
36 views

RSAGA error using rsaga.pisr2

I just downloaded SAGA and the RSAGA package for R. I would like to use the rsaga.pisr2 function to compute solar radiation for my region of interest. I am currently getting errors related to proj4 (...
0
votes
3answers
57 views

st_intersection failing for overlapping multipolygons in sf

I'm working with some user classification data on a citizen science platform. The way our workflow works is to take multiple user classifications of areas, overlay them on one another, and then look ...
0
votes
1answer
26 views

How to create and empty SpatialLinesDataFrame in R

I need to create and SpatialLinesDataFrame with a predefined structure (9 fields). I'm performing a function over a list of shp which I want to append to this empty spatiallinesdataframe. I already ...
2
votes
3answers
72 views

Batch rename MODIS data?

I have MOD13Q1 NDVI images. Data are named in this format: MOD13Q1.A2007049.h26v06.006.2015161224938_MODIS_Grid_16DAY_250m_500m_VI.tif (YYYYDDD) Here 2007 is a year and 049 is day in year. I ...
0
votes
0answers
25 views

Getting an error while using GRASS GIS from R

I have installed GRASS in my Ubuntu system. Library "rgrass7" is successfully installed and imported. but, while running the code I am getting an error : Error in parseGRASS(cmd, legacyExec = ...
0
votes
1answer
14 views

Problem using 'masker' while plotting KDE - R

The Problem I am trying to plot the kernel density estimate for conflict data in Nigeria. I am using GISTools, rgdal, and sp loaded into R. I want to generate the KDE, plot it out, and then mask the ...
0
votes
1answer
21 views

How to use st_geometry_type() to filter an sf object in r?

Put together this code to filter an sf object by geometry type as suggested by @Spacedman here Posting here for others and for myself in case there are better ways to do this. types <- ...
1
vote
0answers
23 views

Animation of Faceting maps with tm_facets

I am unable to get the facets for 3 years of provincial GDP of provinces of China. My data is as follows. structure(list(Pr_mlnyn = structure(c(2L, 27L, 10L, 25L, 19L, 18L, 17L, 11L, 24L, 15L, 31L, ...