Statistical computing language and software environment.

learn more… | top users | synonyms

4
votes
1answer
75 views

Where are the “band names” of an ENVI file once it is imported in R?

I have a .dat file (ENVI format) with specific band names, as you can see in the snapshot. I've imported this file in R, but I cannot find the band names in the R object. The command ...
6
votes
4answers
672 views

Create interactive maps in R

I am a R user and quite new in GIS. From Adding Attribute data to shapefile? I know how to add/edit attribute data (say population) to shapefile using R. Now, I have some shapefiles with attribute ...
0
votes
1answer
158 views

Preprocessing landsat 8 images in R [closed]

I'm preprocessing landsat 8 images in R using the packages 'satellite' and 'landsat'. I tried to work with a "satellite object" derived from a stack of all my bands, but when applying the correction ...
1
vote
1answer
70 views

Creating boxplots from two rasters using the Raster package in R, using only a subset of classes from one

In R using the raster package, you can create box plots from two rasters (x and y) like so: boxplot(x,y) where: x = Raster* object y = If x is a RasterLayer object, y can be an additional ...
0
votes
0answers
15 views

compile the R arcgisbinding package against 10.2 [duplicate]

I have been searching for the way to compile R arcgisbinding against 10.2, since I don't have 10.3.1 version which is compatible for the arcgisbinding package. Is there any solution?
1
vote
0answers
56 views

What is the usefulness of the angle and direction of the sun parameters in hillshade? [closed]

These parameters refer to the angle as of elevation and direction of the sun hypothetically to the hillshade but why does that must have any importance?
2
votes
1answer
154 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
100 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 ...
6
votes
2answers
353 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
78 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
156 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
322 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) ...
5
votes
2answers
178 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
56 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
184 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 ...
0
votes
0answers
14 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
147 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
88 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") ...
4
votes
2answers
231 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. ...
8
votes
3answers
522 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 ...
9
votes
0answers
255 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
55 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
23 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
43 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
184 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
202 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
87 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
96 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
76 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
101 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
250 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
22 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
62 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 ...
6
votes
1answer
89 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
470 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
98 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
209 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
118 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
33 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
330 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
303 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
45 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: ...
0
votes
0answers
66 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
18 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
102 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
358 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) ...
2
votes
1answer
93 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
121 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 ...