# Tagged Questions

Statistical computing language and software environment.

8 views

### raster::rasterize set wrong values with enclosed polygons

Similarly to this post rasterize (R package raster) fail to rasterize island polygons? the rasterize function in the raster package is giving me problems with enclosed polygons. In my case, some ...
22 views

### How to define season by month and average data

I have 10 year NDVI data i.e. two values per month. I would like to average values within a season e.g Season A (January, February and March) per year and plot a graph. y axis=average ndvi value, x ...
46 views

### Comparing point pattern and raster data?

I have a simulated data set showing distribution of a certain habitat type as a point pattern. Then I have a empirical data set but there the format is raster. The two datasets are covering the ...
219 views

### plot 3D graph based on raster pixel values

I am new to raster data. I have a raster tif file with population density value in each grid cell. I am interested in plotting a 3D graph based on raster values in ArcGIS or R. The similar graph is ...
17 views

### Exponential function variogram sill values

I am using gstat package for deriving a variogram using exponential model. My R code goes like this: g <- gstat(id= "HV",formula=HV~X+Y,data=vari) vari.var <- variogram(g) vari.var plot(vari....
30 views

### Select polygons (A) that contain polygons (B) by using R code

I am wondering how to select polygons (A) that contain polygons (B) by using R code. B<-readOGR(dsn="H:/AP", layer="WWTP") A<-readOGR(dsn="H:/AP", layer="catchment")
26 views

### Calculate mean value for each raster and convert output array to data frame

How do I calculate mean value for each raster and convert output array to data frame? r <- as.data.frame(cellStats(x,mean))
34 views

### Calculate area for each polygon in R

I am working with a shapefile that has many polygons. How do I add one more field named "area_sqkm" and calculate area for each polygon in the shapefile?
39 views

### very basic question on extracting data from .tif raster layer in R- projection not in lat/long

I have data on N deposition in the US, which can be found in a .tif file from a zipped directory, which can be accessed here: nadp.sws.uiuc.edu/maplib/grids/2006/TotalN_dep_2006.zip. I loaded the ...
31 views

### Crop raster files when importing with readGDAL from DB

I have quite a lot of raster files stored in a PostgreSQL DB. Each of them has around 200MB and is representing EU-wide data. However I only need the the rasters to cover the area of Germany. I'm ...
38 views

### Add information from a raster nc-file to a polygon shapefile

DATA Download from this website the following ZIP file: NUTS_2006_60M_SH.zip and save all the NUTS_RG_60M_2006 files. In what follows I refer to this as "NUTS3 regions". Download from this website ...
15 views

### making pacific center of map in ggmap

I am trying to produce a travel route map using ggmap package of R, but I found that GMT being at the centre of the map cuts off the travel route from New Zealand to America. I have surfed the net but ...
224 views

### Switch an R script from “MODIS Reprojection Tool” to “ModisSwathTool”

This R script works with MRT (MODIS Reprojection Tool), and its performance is unbelievable for land data. The only problem is when you use Atmospheric data from Modis, like "MOD05_L2". The problem ...
29 views

### hdf files in GDAL throwing an error in R gdalinfo

I am having issues using some modis hdf files in R. Working on Windows 10. I had a previous question where gdal wasn't working but I think I have resolved that. I tested with existing tifs and they ...
47 views

### Is there a spatial gradient in my data

I already posted the question here, but I thought that maybe it is a question for GIS as well. I have a grid with densities of one animal and would like to find out if there is a spatial gradient in ...
206 views

### Loop to check multiple polygons overlap in r

I have a set of polygons (available here: http://ulozto.cz/x39ELbFt/polygons-zip) created in QGis and processed in R. I would like to know if they are overlapping or not, and if yes, where is the ...
4k views

### Reproduce raster with same extent, and same number of columns and rows?

I have two raster A and B. A and B have the same grid size but different extent. How can I make A have the same number of columns and rows, as well as the spatial extent of B?
3k views

### Increasing speed of crop, mask, & extract raster by many polygons in R?

I'm extracting the area and percent cover of different land use types from a raster based on several thousand polygon boundaries. I've found that the extract function works much faster if I iterate ...
416 views

### Really slow extraction from raster even after using crop?

I have a large raster file (245295396) cells and stacks of rasters having 4 layers each which lie in the extent of this large raster. To start with I am trying to get value from one stack (3 channels) ...
17k views

### How can I convert data in the form of lat, lon, value into a raster file using R?

I have a data set of values over a km grid in the continental U.S. The columns are "latitude", "longitude", and "observation", e.g.: "lat" "lon" "yield" 25.567 -120.347 3.6 25.832 -120....
129 views

### Extracting a large layer from NetCDF using R

i am trying to extract specific data from an .nc file my nc file has the following variables hur-relative humidity lat-latitudes lon-longitudes time-time plev-pressure levels so i ...
91 views

### GDAL error in R path.expand(path): invalid 'path' argument

Using windows 10. I would like to stick to using R since that's where a lot of my pre-processing and analysis will take place for a bigger project. I have downloaded a number of MODIS files for the ...
258 views

### How to download the MODIS data from R using MODISTools library

I want to download MODIS product MOD13Q1 to use the Scientific Data Sets (SDS) layers of "250m_16_days_EVI", "250m_16_days_pixel_reliability". MODISTools library in R software provides the capability ...
22 views

### Plot in rstudio a NetCDF File - latbox by lonbox

I have two NetCDF-Files. One of them holds information about the temperature in 2m (t2m) , the other one about outgoing long wave radiation (olr). I want to make a scatter plot. The first part of this ...
890 views

### Iterating polygons on a SpatialPolygonsDataFrame in R with readWKT

I have fetched some data (39 objects) from my PostGIS database and converted this data into a matrix: rs <- dbSendQuery(con, "SELECT ST_AsText(polygon_accumulation) AS ShapeWKT from accumulation;")...
57 views

### Copy resolution extent CRS metadata from one raster file to another using raster R

I have two geotiff raster files, one has all the metadata information and in the other the information was lost. I know that all the metadata information was exactly the same so I want to copy it from ...
27 views

### Raster time series smoothing package using R

Does somebody knows if exist a package in R specifically for raster time series smoothing? I´m using aproachs like this one (using the equation suggested by Hamunyella et al., 2013) for (i in 2:(...
21 views

### Pixel based 10 year NDVI time series

I would to do pixel based 10 year NDVI time series analysis using MODIS data. I’ve 3 seasons in a year. Should I average all values in the study area per season?
25 views

### Running QGIS Python code from the R rPython package

The following script works fine from python or ipython at the command line: from qgis.core import * from qgis.gui import * import sys sys.path.append("/usr/share/qgis/python/plugins") from PyQt4....
24 views

### Resample raster to lower resolution

I am trying to resample a forest cover raster with high resolution (25 meters) and categorical data (1 to 13) to a new RasterLayer with a lower resolution (~ 1 km). My idea is to combine the forest ...
52 views

### Can I extract circular buffers from polygon layers?

I have been working in QGIS with a large and detailed shapefile where remaining forest fragments are represented as polygons. I would like to extract circlular buffers, of various radii, from this ...
14 views

### How do you write classify that you are using a time varaible in R?

I am using R. I am including time as a co-variate in my model. 10:30, 11:56, 12:00 etc Is there a way to tell R that my values are time measurements?
24 views

### Checkbox using PlotGoogle Maps in R

I want to introduce checkbox in my map when I plot it using PlotGoogleMaps Package of R. My data set (LatLng) consists of points classified on the basis of vehicleID. I want a checkbox such that ...
184 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. ...
185 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: library(maps)...
23 views

### R: Overlay using functions containing if/else statements

I have two rasters, x and y, and I'd like to do calculations with them using the overlay function. For example, MyFun <- function(x, y) x * y res <- overlay(x, y, fun = MyFun) This seems to ...
94 views

### Matching vertices in igraph (R)

I'm currently using a combination of ArcMap 10.2 and igraph in R to analyse a network with associated data. I have an igraph network object based on the OS ITN network with associated TOIDs for each ...
11 views

### How to perform an anisotropic Elliptical Inverse Distance Weighting (EIDW) interpolation in R?

River bathymetry is generally more variable in the transverse than the streamwise direction, so I need to use anisotropic interpolation technique like Elliptical Inverse Distance Weighting (EIDW) (see ...
20 views

### Subset of lines that are within polygon in R

I have a large SpatialLinesDataFrame (~23000 features) and a SpatialPolygonsDataFrame (8 features). I want to make 8 new variables, each with the lines that are on the same locations as the polygons. ...
20 views

### How to use osmar behind a proxy?

I've been trying to use osmar behind a proxy without success. Here is the test code : require(osmar) api <- osmsource_api() box <- corner_bbox(11.579341, 48.15102, 11.582852, 48.1530) ...
10 views

### Loop Quality layers of Modis in R

I want to parse quality layers of Modis MOD13Q1 in R. I´m using a code from another question here! and it works fine, but i want to loop it for 300 files. I grouped them in stack of rasters and tried ...
118 views

### Extract river polygons from DEM

I would like to use DEM to extract a river network but I don't want to use the polylines. Is it possible for me to extract polygon (or raster) rivers from DEM? I'm using both ArcGIS 10 and R. If ...
52 views

### Don't understand error : Error in if (nchar(projargs) == 0) projargs <- as.character(NA) :

When I run two different scripts from examples (which seem to work where I took them from) I get an error in both cases. Something seems to be wrong in my general set up or something. But I have no ...
50 views

### Random Forest out of the bag and confusion matrix

I have implemented Random Forest classifier to classify remote sensing data in R. The original code comes from here: How to perform Random Forest land classification? Everything works fine, but what ...
35 views

### R and osmar : the doc's example does not work for me, “Opening and ending tag mismatch”

I can't make osmar work anymore. I tried to reproduce the documentation's example, and even that produces a very long error code. I could not find the same error anywhere. Any idea ? The code is : ...
41 views

### Overlapping polygons in the same table/ layer [duplicate]

I have catchment areas as polygons in a GIS layer. They were derived from two different sources (coded as "ws" and "dr" in a separate column named "use"). It's good to have these two sources as they ...
26 views

### R, given a set of center points how to define the cell area? [duplicate]

I have the coordinates for the police stations in a city, they are grouped close together at the center and sparse towards the suburbs. Since I do not have the shape file for the jurisdiction of each ...
354 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 ...