Statistical computing language and software environment.

learn more… | top users | synonyms

3
votes
1answer
58 views

CRS not embedded by maptools in R

I'm using the maptools package in R to merge some data to a shapefile. When I open the original input shapefile in QGIS, QGIS automatically picks up on the CRS. When I open the output shapefile from ...
0
votes
1answer
45 views

ggplot2 plots polygons with wrong topologies

I'm trying to plot polygons in R using ggplot2. In GRASS, QGIS and normal R the map renders fine, but ggplot2 seems to have some kind of topological difficultes I can't explain. With normal R it looks ...
2
votes
2answers
134 views

What is the “best” way to automate the GIS slope and aspect algorithm?

I am currently obtaining slope and aspect of roofs using ArcGIS as follows: Mosaic several Lidar .asc files to new raster Extract by mask using Mastermap building outlines to get hold of just the ...
2
votes
1answer
176 views

Overlaying lines and aggregating their values for overlapping segments

I have a number of routes (5 in this example data) stored in a SpatialLinesDataFrame called r. These have different origins but all converge on the same destination (Manchester Airport): Each ...
1
vote
1answer
77 views

Conditional statement, apply different equation based on raster value R

I am trying to find the best way to apply a set of equations to a raster conditional on values in a separate raster. For example, suppose r1 has the values of interest and raster 2 (r2) is a raster ...
0
votes
2answers
38 views

How to compute climatology of 3 days moving averages for rasters pixel by pixel?

I have one year of datasets that I want to compute the climatology of 3-day moving averages and then I subtract this climatology from the original values for each pixel. example: # Set up the ...
0
votes
0answers
84 views

polygon shapefile R extract issues

I'm trying to do simple RF classification in R based on https://gis.stackexchange.com/a/39103/48810. The code I am using is as follows: require(sp) require(rgdal) require(raster) ...
1
vote
0answers
70 views

Optimal distance and power exponent in IDW

I want to apply IDW interpolation for my region of interest, and through leave-one-out cross validation I want to find the optimal values for the distance parameter and the power exponent. I know that ...
6
votes
1answer
255 views

Calculating road density in R using kernel density

I have a large (~70MB) shapefile of roads and want to convert this to a raster with road density in each cell. Ideally I'd like to do this in R along with GDAL command line tools if necessary. My ...
1
vote
0answers
27 views

How to export multiple class training data from ArcGis into R?

I want to perform some machine learning classification of images using R. I'm having issues finding out how to export my training data from ArcGis into R and I'm looking for some help. Currently I do ...
2
votes
2answers
152 views

How calculate pixel by pixel the mode (statistic) of multiple rasters (geotiff)?

I have 12 land cover maps, and I would like to calculate the mode to each pixel of the 12 maps (they have the same resolution and dimension). I mean, the final map would be the mode for each pixel of ...
0
votes
0answers
31 views

How to avoid a problem of one pixel when doing non-linear regression?

I am ruining a non-linear regression using nlsLM from package:minpack.lm for multiple rasters (pixel by pixel). My initial values may be appropriate for some pixels but not for others.When I run the ...
3
votes
3answers
319 views

Assigning RGB values from Geotiff image to LiDAR data, using R

I have given a Geotiff image and its corresponding Lidar data (x,y,z) in UTM coordinates. I need to merge the Lidar data with the RGB values from the image. That means, at the end, I need to plot ...
0
votes
1answer
96 views

Can't import libraries to rsaga

I get this error when I'm trying to import a raster to RSAGA: > rsaga.import.gdal(paste(rast_name, ".tif", sep=""),"RASTER", env= my_env) Module 'GDAL: Import Raster' not found in SAGA library ...
1
vote
1answer
84 views

Extract area of polygons inside larger polygon and sum their values to a new column

I have two landcover classifications (as shapefiles) created using eCognition. "Level0 (FID)" consist of larger polygons and "Level1 (FID, ClassName, Area_Pxl)" of smaller polygons within these. I ...
6
votes
1answer
141 views

How to perform a non-linear regression pixel by pixel?

Using nlsLM from Package ‘minpack.lm’ is straightforward for a simple example like this: MODEL:y=(exp(a*x+b*z+c)+d)^f x=c(0.5,0.3,0.2,0.4) z=c(0.1,0.6,1,0.9) y=c(0.2,0.3,0.9,0.9) ...
3
votes
2answers
204 views

How to load projection along with raster in R?

Why the operation myraster = raster("test.asc") does not load the associated projection file test.prj located in the same directory as test.asc? Does raster() need a specific argument? It seems ...
0
votes
0answers
42 views

crop shp file leads to different results for same extent

I cropped a shapefile to a smaller extent (my AOI - area of interest) - to work with a reduced working directory. During my workflow I rasterize the shapefile. Here is my problem: I saved both of my ...
-1
votes
1answer
65 views

Single point in R

My question might be very simple. I want to create a single point (with xy coordinates) in a specific region, in a specific position. I don't want to do that with qgis I want to do that in R. Is there ...
2
votes
2answers
434 views

Join spatial point data to polygons in R

I am trying to perform a spatial join between point data and polygon data. I have data that indicate the spatial coordinates of an event in my csv file A and have another file, shapefile B, that ...
1
vote
1answer
41 views

Add information from polygon to raster in R

I would like to add information from a spatial polygon to a new raster. r <- raster(nrow=10, ncol=10) r[] <- runif(ncell(r)) * 10 xym = matrix(c(0,0,0,45,45,45,45,0),4,2,byrow=T) ## create ...
1
vote
1answer
109 views

unsupervised random forest classification in R

I want to compute an unsupervised random forest classification out of a raster stack in R. The raster stack represents the same extent in different spectral bands and as a result I want to obtain an ...
1
vote
0answers
53 views

Problem between files with same coordinate reference system

I have 2 shape-files. The first created with Qgis and the other with R studio(driver=ESRI). When I import them in qgis i see they doesn't "fit". Both have EPSG:4326 - WGS 84. The only difference I ...
6
votes
2answers
317 views

How to make a bivariate colour ramp with QGIS, R or similar?

Many recent maps I have seen have these neat two-way color gradients that can be used to color correlations between continuous estimates. Here is an example taken from a recent publication (Source: ...
2
votes
1answer
238 views

R function for Thiessen Polygons

For a point data set with temperature data I have, I want to create their Thiessen Polygons in R. So far, the only algorithm I have found is that of Carson Farmer ...
1
vote
2answers
346 views

How to import several GeoTiff files into R?

I think that must be a "simple" way to import several Geotiff files into R instead of copy and paste n times Rfd<-readGDAL() and then save them as individual objects. I found the following code in ...
1
vote
1answer
91 views

resize map and add points to it using R

I am working with spatial data UK. The map is plotted here. I want to resize the map and make it bigger and clear! here is my code LA <- readOGR(dsn =".", "infuse_dist_lyr_2011_clipped") ...
0
votes
1answer
95 views

using raster.predict for Cubist model, factor levels list

I would like to thank in advance any help or advice. Let me know if I need to provide more reproducible data/code. I am working on a Cubist prediction model for soil texture, using continuous and ...
1
vote
1answer
85 views

Intersection of two Raster objects

I have two raster objects r1 (in grey and green) and r2 (in pink) that I want to intersect with R. I tried with the R function intersect from the raster package but it only intersect the extent of the ...
1
vote
2answers
103 views

Export GRASS raster as GeoTiff : nodata values exported as -nan (what happens in R?)

I am using the package raster to work with GeoTiff raster files which I expoerted from GRASS using r.out.gdal. GRASS assigned the value -nan to some raster files (type FLOAT32) for missing values. ...
0
votes
0answers
194 views

Couldn't load plugin processing in QGIS: Access is denied for R

Couldn't load processing plugin due to flowing error. Any help? thanks. Couldn't load plugin processing due an error when calling its initGui() method Traceback (most recent call last): File ...
0
votes
1answer
142 views

export list as shp in R

I have a list of coordinates with which i can create a path and I want to export this list as shp. I have "shapefiles" package but I didn't find the way to do this. Is there a way to do this with this ...
3
votes
1answer
260 views

Dissolve Polygons using R / join specific polygons

I have data in shapefile format :: UK_boundaries I am new to R and Spatial data as well, I am trying to join some areas to be as one area no line(s) between them. Based on my search I understand ...
1
vote
0answers
74 views

R geographically weighted regression with negative binomial distribution

I'm trying to find a R package that allows me to do geographically weighted negative binomial regression. I'm aware there's 'spgwr' and 'glm.nb' package. But is there a package that combines the two? ...
1
vote
1answer
48 views

Is there any statistical measure/tool that compares two different sets of location configurations in R or ArcGIS/QGIS?

Here is what I'd intend to do; I have a given set of facility locations as shown below; And based on a predefined one optimization criterion, I obtained the following configuration (and there are ...
-1
votes
1answer
59 views

R code for SDM using randomForest

I wonder if someone can provide me with R code for running Species Distribution model using randomForest where I can't find any tutorials or demos for this.
0
votes
1answer
71 views

Raster import from GRASS to R - handling nan/NA

I have several doubts, so I will try to be as clear as possible... thanks for your understanding. I am generating a regression model using several environmental covariates. Before importing the GIS ...
2
votes
1answer
279 views

Geographic Heatmaps with Concentric Circles by Distance

I'm looking to generate a geographic heatmap (using 'ggmap') that overlays some dimension (to start, housing prices) over the lat/lon near a city center. Then I want to create circles of equi-distant ...
1
vote
0answers
45 views

Is it better to work with non-contiguous or contiguous polygons?

I would like to find width-height of a non-contiguous polygon in order to draw paths within it. My question: Is it better to use a bounding box (contiguous polygon) and then clip keeping my real area ...
1
vote
1answer
158 views

Checking if points within shapefile

Zillow has a set of shapefiles for different neighborhoods of major US cities. I wanted to check if certain buildings were present in certain neighborhoods using R: library(rgeos) library(sp) ...
2
votes
2answers
129 views

rasterize produces a raster full of NA values

I am having trouble converting a polygon to a raster. The desired raster is created, however all its values are equal to NA. require(rgdal) require(raster) #download a shapefile with 2010 census ...
2
votes
1answer
152 views

How to do a Kernel Density with “population field” in r?

In ArcGIS, I can generate a kernel density map and weigh it by population field. For example, I can use city's population as weighting factor, so that more populated city has higher influence to the ...
2
votes
1answer
74 views

How to handle duplicate id's when using the as_sp function in the R osmar package

Sometimes when I want to convert a subset of ways from an osm file loaded with the osmar package, I run into an error complaining about duplicate row names. The following code run on this file in ...
3
votes
2answers
74 views

How to compare a classified raster dataset to another polygon dataset?

I am going to perform an unsupervised classification on my dataset and will get a map as a result. The objective is to rebuild an already existing map (of different soil types) with my new dataset. ...
0
votes
0answers
12 views

Converting adf rasters to asc? [duplicate]

I have a number of adf raster files, and I need to use their data in asc format. I have QGIS, but prefer to do the conversion using R so that it can be batched and coded with the rest of my project.
0
votes
1answer
97 views

Plotting an eia shapefile in google maps with R?

I'm trying to plot a eia shapefile onto google maps. I have a code working with the map funciton but can't get it to work with the ggmap function. Where am I going wrong? Working code: ...
1
vote
1answer
31 views

How to add lables/etc with eia shapefiles in R?

I'm trying to create a map of US Shale basins and I'm very new to creating maps. I have downloaded the shapefiles form the eia. I have also, been able to created a basic map with the bases plotted ...
2
votes
1answer
73 views

Construction of a square grid from a given centre (lat,lon) and direction of the sides

Let us consider a point (longitude, latitude) on Earth (location). How to construct a square grid around this point (taking this point as the centre of the square or intercept of the two diagonals) ...
2
votes
1answer
375 views

How to read *.adf files into R?

I want to load .adf files into R. The data is from this page: http://www.fao.org/geonetwork/srv/en/metadata.show?id=14057 I tried the following code that I found after some research in the internet. ...
0
votes
0answers
54 views

Can't run sgolayfilt () on RasterStackTS in R

I'm quite new in R and remote sensing at all. Had followed the following step to filter my MODIS/NDVI data. library(sp) library(raster) library(rgdal) library(rts) library(signal) getwd() ...