Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
1answer
207 views

Export a QGIS print composer file (.qpt) as PDF from the command line

I have a workflow where my R script produces csv's and shapefiles. Those csv's and shapefiles then serve as layers in a QGIS project. Every time the R script is run, it overwrites the previous data, ...
0
votes
2answers
120 views

Error when reading in shp file using R

I'm trying to read in a shapefile in R, but keep getting this error: nul character not allowed (line 1). I have tried various shapefiles, all which work fine in QGIS and I have even tried open-...
6
votes
2answers
455 views

Clipping vs Intersecting

I was curious why clipping shapefiles was just so difficult and whether it was different to intersecting shapefiles? You will see from one my questions that I gave up trying to clip a polyline with a ...
1
vote
2answers
91 views

Improves performance on R working with raster files

I´m trying this code to look for NA and negative pixel values and replace it for 0. But it´s too slow. Any tip for improve the performance of it? "all.files" is a list of address of the images. "r1" ...
3
votes
2answers
208 views

Reclass raster stack based on condition and other layers

I want to reclassify raster r1 in the following form: all the values that are larger than r2 to be 1 all the values that are less than r3 to be 0 all the rest of the values to be equal to r4 I ...
0
votes
1answer
524 views

Different origin problem while merging rasters

I have two dem files downloaded via the getData function in the raster package. Here you can see the code: I tried to make the example reproducible so there you have it. library(raster) dem_n1<-...
5
votes
2answers
215 views

Map algebra in QGIS

How do you calculate standard deviation for each raster if you have set of rasters (100)? I was searching in raster calculator, but I didnt find it. Also google redirect me to using R or python. But I ...
1
vote
1answer
63 views

R: Change RasterBrick dimensions from TXY to XYT

I am having difficulties in R getting climate data from a netCDF file into the right format for further analysis. I am working with gridded global data on Standardized Precipitation Index (downloaded ...
5
votes
2answers
262 views

Is it possible to clip a shapefile to an image() in R?

I am working on mapping some netcdf data in R and have been having a tough time trying to perform a clip with an imported country shapefile that I'm using. Here is my question from yesterday. If you ...
1
vote
0answers
16 views

Is there a replacement for ggmap::geocode? [duplicate]

I've found ggmap's geocode() function really useful over the years as it's got a 'fuzzy' search implemented by Google. However, I'm wondering if there are alternatives, because geocode() seems ...
1
vote
1answer
208 views

Example of simple kriging with varying local means in R

I'm looking for an example of how to use simple kriging with varying local means in R. I've tried google, a few books (for example Aplied Spatial Data Analysis with R) and I've found almost nothing. ...
1
vote
1answer
99 views

How to clip a spatial polygon to a large matrix (that is plotted as a large trellis, originated as a netcdf) in R?

I would first like to issue a disclaimer that I am a novice at GIS, and I have only just begun learning R. So if I use the wrong terminology for something or my question is confusing, please help ...
-2
votes
1answer
66 views

Points don't show up on an overlaying shapefile?

library(ggmap) library(rgdal) cities<-c("city A","city B") country<-readOGR(dsn=".",layer="country") gc<-geocode(cities,source="google") gc$names<-c("city A","city B") coordinates(gc)<-...
4
votes
2answers
368 views

Alternatives of spTransform?

Let's say that we have a shapefile with a certain projection. s<-readOGR(dsn=".",layer="Spain") We also have the airports of Spain as points in another projection. a<-readOGR(dsn=".",layer="...
8
votes
3answers
648 views

Fastest way to convert big raster to polyline using R or Python?

I have a big raster file (129600 by 64800 pixel) with global water bodies (1 bit values 0 and 1) and try to extract ocean and inland water shorelines. I've tried with ArcGIS and QGIS to convert from ...
10
votes
1answer
393 views

Identifying overlapping time intervals with two more criteria in R?

I have to check birds observations made over a longer period for duplicate/overlapping entries. Observers from different points (A,B,C) made observations and marked them on paper maps. Those lines ...
0
votes
1answer
57 views

Split by attributes with 2 fields

I am using SplitLayerByAttributes toolbox. It’s a very useful tool for me to process certain activities. As you know, I can split the feature class as per 1 field. What if I want to split the features ...
0
votes
0answers
27 views

Putting shapefile into spplot graph?

I have a spplot with a kriging but I need to put a shapefile into this spplot? How can I do that? I could obtain this with a intersection but I just need the shapefile over this.
1
vote
1answer
47 views

Adjusting sampling points to closest land surface QGIS

I have many sampling points in mangroves of Southeast Asia and am trying to extract climatic data for each using the WorldClim dataset. However, many of the points fall on areas classified as "water" ...
1
vote
0answers
282 views

Converting UNIX time to datetime in R [closed]

I am trying to convert a 13 character UNIX timestamp to datetime and I am getting a year that is in the 44000's. I'm not sure what I am doing wrong, hopefully someone can help. library(maptools) GMT ...
5
votes
1answer
348 views

R fortify causing polygons to tear

I'm am having some trouble plotting my spatial data using ggplot2. The map looks fine when plotted using spplot, so I'm assuming that the tearing occurs at the fortify stage. The code is as follows: ...
0
votes
1answer
104 views

Plotting distribution of two different species in R?

I have data for species distribution modelling of two different species. I need to plot the predicted distributions of the two species in the same raster plot to be able to find the areas where they ...
1
vote
2answers
124 views

Pan sharpening with surface reflectance data

The surface reflectance data for landsat 8 is only available for bands 1-7 (via EPSA bulk download). I want to pan sharpen surface reflectance data. But I don't have a surface reflectance band 8 (pan ...
0
votes
1answer
98 views

variogramST in R

I've been following the tutorial in this site to compute the spatio-temporal variogram in R. The result from variogramST is the object called var, and it contains several NAs for np, dist, and gamma, ...
1
vote
0answers
34 views

Clear QGIS plot results window

How do you clear old plots from the plots result window in QGIS? Is there a line of R code that you'd need to run to do so, or is there a means of doing so through the GUI?
1
vote
1answer
133 views

Pan sharpening using R

I want to pan sharpen my Landsat8 scene (according to FIHS algorithm, see here). According to the paper the following equation should do the pansharpening: MS_high <- MS_low + (pan - I) "...
0
votes
2answers
366 views

how to remove cloud values of Landsat image from R [closed]

How can I remove cloud value of the Landsat8? How can I estimate cloud values for eg: modis cloud values are from 700 to 800. By using R how can I estimate>
1
vote
0answers
26 views

Batch Geocoding in R over daily limit with pay as you go? [duplicate]

I have found the the geocode function in ggmap to be very helpful in the past. Now I am trying to geocode about 60,000 addresses. The google maps API daily limit is 2500. Google offers a "pay as you ...
2
votes
1answer
67 views

How to separate out bands from hyperspectral data using R

I'm having one hyperspctral data with 426 bands, with dim 250*250*426. I want to seperate each bands. I tried like this img <- stack("name.tif") rr <- array(, dim= c(250,250,426)) for(i in 1:...
6
votes
1answer
111 views

How to make a wedge shapefile in R?

I'm quite okay at R programming, but fairly new in GIS (especially in R). I have a set of coordinates and I'd like to create a custom shape around them. What I want to do step-by-step: Create a ...
7
votes
2answers
627 views

How to download MOD16 (Modis Evapotranspiration) image?

I use a 'R' script for downloading MODIS imageries. However, it doesn't give MOD16 product. I could neither find the MOD16 product in earthexplorer website. Though the desired product is available at ...
5
votes
0answers
141 views

Interpreting semivariogram high nugget

I made a semivariogram in R using package gstat, variogram() function. I want to see if there is spatial autocorrelation in the residuals of my model (species abundance as a function of habitat, ...
6
votes
2answers
227 views

Create large amount of random points in binary raster

I want to create a point vector dataset of 10000 points (or larger) within a binary raster, where the points should be constrained to areas where the raster value is 1. I tried the following steps. ...
-1
votes
1answer
148 views

How to read metadata file from R [closed]

How to read metadata file parameters( like sun elevation,REFLECTANCE_MULT_BAND etc ) from the user interface or from R How can end user validate the parameter of metadat file(.mtl) How can I pass ...
0
votes
1answer
44 views

Exporting “pennLC” object stored in R as a shapefile

I need to export the pennLC object from package:SpatialEpi as a shapefile. pennLC contains different components of lung cancer dataset for Pennsylvania state such as: $geo, a data frame $data, a ...
-2
votes
1answer
494 views

How can open a shapefile using R maptools package? [closed]

library(maptools) mn.map.shp = readShapeSpatial("minnesota.shp") Results this error at second line: Error in getinfo.shape(fn) : Error opening SHP file
-2
votes
1answer
478 views

How to calculate statistical NDVI in R (for Landsat8) [duplicate]

Is there any function to calculate statistical NDVI in landsat8 package
2
votes
0answers
51 views

About shp for ggmap in the R

I am a new in R and GIS, so I kindly ask you on advice. I had a shp which I want to plot on google map. The shpfile is here: http://www.filedropper.com/exercisestanddata First I do this: ogrInfo(...
0
votes
0answers
92 views

Variogram to assess spatial auto-correlation in grouped surveys in R

I have a large dataset with coordinates of survey locations, and results for presence or absence of a species. These surveys are spatially clustered, with four in a line separated by 1km each, and the ...
1
vote
0answers
19 views

How can I quantify whether locations of one 'type' are closer to one another compared to a second 'type'?

This might have an obvious answer but I'm new to GIS and can't seem to find the right technique... I've got GPS points for a bunch of households and have calculated the distance (in km) between each ...
3
votes
2answers
109 views

How to remove bounding box extents based on reflectance values of the image of Landsat8 by using R programming

I have taken the reflectance image from Landsat8 bands. Now the extents of bounding box showing negative values , to proceed to my next level of the process i need to remove this negative values and ...
-1
votes
2answers
577 views

unable to find an inherited method for function ‘writeRaster’ for signature ‘“SpatialGridDataFrame”, “character”’

Error in (function (classes, fdef, mtable) library(rgdal) x<-readGDAL("LC81360442014322LGN00_B5.TIF") z<-reflconv(x,2.0000E-05,-0.100000) writeRaster(z,filename="test.tif",format="GTiff",...
2
votes
1answer
140 views

R: Convert Extent Object to Shapefile

I want to convert R 'library:raster' 'extent' object to a shapefile. I have the CRS available too. e= c(4304916, 4305325, 365216, 365439)#xmin, xmax, ymin, ymax proj4string(e) = CRS("+proj=utm +...
6
votes
1answer
153 views

Segmentation of a big raster

I'm actually trying to convert one raster into a SpatialPolygons. I've got a big raster (12 millions pixels) with a lot of zeros, and some negative values (representing some depression in a DEM). I ...
6
votes
5answers
650 views

Estimating river Channel Width using Python/ArcGIS/MATLAB/R?

I am trying to estimate the river channel width from digitized polygon or poly-lines shapefiles. To do so, I converted poly-line shape files to points.shp at regular intervals (at 1 cm). Later, I ...
0
votes
1answer
45 views

Debugging spplot() and reflconv() on R Cannot allocate vector of size …?

I am trying to perform LANSAT data of Digital Numbers (DN) to reflectance in R(coding) using reflconv(). When I apply that function to example it shows below error: >library(rgdal) x <- ...
3
votes
1answer
131 views

Define cellsize from spsample in meters

I use a shape file to create a regular grid using spsample, from sp package. Two problems here: (1) I would like to define the size of my grid cells in meters, but I've checked the documentation of ...
0
votes
0answers
90 views

Union overlapping shapefiles (poylgons) and merge the attributes where overlap occurs in R

I have 30 shapefiles of overlapping polygons and would like to union them into one shapefile. The attribute table of the 30 layers is exactly the same (two columns, Type and Origin). A new polygon ...
1
vote
1answer
311 views

Using Loop for calculating NDVI

I am using MOD09Q1 now and I would like to calculating NDVI whole year data. One year, I have 46 band 1 images and 46 band 2 images. list.files I creating list of band 1 and list of band 2. ...
1
vote
0answers
73 views

R raster stack 4 dimensions

I am trying to create a raster stack / brick from a list of ncdf files with the dimensions 160x160x24x1). r = stack(files) This gives me a raster stack but without the 4th dimensions which is ...