# Tagged Questions

Statistical computing language and software environment.

15 views

### Supervised Random Forest in R

I did an image classification using random forest algorithm in R. I got the result but I do not understand what does the confusion matrix shows ? I mean what does the rows and column show? These are ...
17 views

I have a choropleth map that represents the number of states being affected by a storm event. This is shown in the image below. I want to lay a transparent line or polygon over these states to ...
19 views

### Assigning irregular points to a grid and assigning grid number as attribute

I have a large point data set that has irregular geometry (random sampling) that I want to bin in 2D XY space. I've attached a sketch below to illustrate what I mean. Apologies for hand drawing, hope ...
16 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 ...
9 views

### random sample of raster cells based on multiple classes in R

I have a raster dataset that is classified into vegetation classes. I would like to randomly sample from the dataset based on the vegetation classes, but not sure how to do it. Here is some example ...
857 views

### R : How to build heatmap with the leaflet package

I read a post about interactive maps with R using the leaflet package. Very interesting by the way. In this article, the author create a heatmap like this: X=cbind(lng,lat) kde2d <- bkde2D(X, ...
19 views

### Calculating distances of lines in R

I drew some lines in a GIS application in this projection: +proj=longlat+ellps=WGS84 +datum=WGS84 - is there a name for this projection? I imported my lines into R and to prepare for calculating ...
8 views

### Lock circleMarker size - Leaflet R

I am searching for a way to lock the size of the circle markers in Leaflet for R, addCircleMarkers(). I need the markers to retain the size they are relative to the polygon they are within upon ...
5 views

I want to download the full MODIS archive for the LAI product using the MODIStools R package. I am running the command lines below but the output file only contains data from 2014 onwards. Any idea ...
698 views

### How to get rpy2 for QGIS on OSX?

I am a new QGIS user, have installed QGIS on a Mac running Snow Leopard OSX 10.6.8 following all the instructions. QGIS seems to work well for everything other than when I boot up I get the message "...
104 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 ...
31 views

### Summarizing point data to multi point data and creating convex hull in R

I have latitude and longitude information like 26.847905 73.9575005 for about 800 points, I need to trim these lat/lon information to say 3 decimal places. I used the following syntax in R # ...
97 views

### How to find the distance from a point to a polygon, via another point, in R

I am trying to calculate the distances between a central point, and the edge of a polygon, along straight lines drawn between the central point and another set of points (where necessary extended ...
17 views

### Equivalent of “merge divided highways” in R

I want to make a map to print out based on openstreetmap data, and have successfully loaded the data into R, the programming language I'm most familiar with. To make things look nicer, I want to ...
655 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 ...
30 views

### How to efficiently extract time series from a very large multi-band GeoTiff in R?

First some context: I want to run a time-series analysis function that is only available in R for a continental sized multi-band time-series raster, which is stored in disk in GeoTiff format, that was ...
57 views

### Convert/display grayscale image as RGB

i want to display raster images using a color palette in a leaflet map. The images are tiled (gdal2tiles) from a single .tif to multiple .png files with values from 0 to 100. I add the image using ...
7k views

### Proper way to rbind SpatialPolygonsDataFrames with identical polygon IDs?

What's the proper R idiom for rbinding SPDFs together when the IDs overlap? Note that here (as is often the case) the IDs are basically meaningless so it's pretty annoying that I can't just make ...
23 views

### In R's raster::terrain function, which way is north?

The terrain function in R's raster package calculates slope and aspect from an elevation raster: see http://www.inside-r.org/packages/cran/raster/docs/terrain. With the unit="degrees" option, the ...
18 views

### kde.points SpatialPixelsDataFrame to geojson

I have a multiple projected spatialpixelsdataframes produced from kde.points() and would like to use it in a leaflet map. Basically the same as Brunsdon example with the New Haven crime data, except ...
15 views

### DBSCAN for spatial clustering based on X, Y and additional variables [closed]

Please you can provide a information about DBSCAN. I am trying to implement a spatial clustering for enterprises based on location and activity code (NACE). About the "# import your point data" step ...
190 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. ...
16 views

### How to get an azimuthal projection in an R plot?

I want to use R for geospatial data analysis, and I want to use a map of my local area as from an azimuthal projection if possible. Is it possible to generate a map using R of an azimuthal projection ...
164 views

### iterate over spatial polygon data frame in R

I am trying to iterate over the rows of a spatial polygon data frame in R, but cannot figure out the right indexing. I don't want to select by attributes, but rather just iterate over the spatial ...
44 views

### R will not read shapefile / file.exists returns true

I cannot successfully read a shapefile in R. I'm using Rstudio version 0.99.902 I have read several articles on readOGR errors that concern reading a shapefile. My shapefile is error free, as it ...
11 views

### how to calculate getis ord using R

I'm trying to use getis ord on the new york taxi dataset to identify the hotspots based on the number of pickups. I want to model the data into cells such that that score of each cell is calculated ...
29 views

### Point in Overlapping Polygons using R

I have shape file with about 15,000 polygons. Some polygons overlap with other polygons. Most of them don't overlap with any other polygon. I also have a points data set with about 100 Mil points (lat/...
81 views

### Extracting Data from Raster based on Aspect Raster file

I have 2 rasters, ones shows aspect and another shows date of snow thaw. I want to extract the date of snow melt based on values from the aspect raster. For example I want all the snow thaw dates from ...
16 views

### ArcGis: Count categorical variable per nuts3 by overlapping point-file and polygon-file

Download from this website the NUTS_RG_60M_2006 files (shapefile) and the csv-file T_DischargePoints_West.csv (source) and save them on your computer. Open them through ArcGis and plot xy-points. You ...
14 views

### dismo::randomPoints generating fewer points than requested in R

I'm using the randomPoints function in the dismo package to generate sets of point locations within two polygons. I've converted the polygons to rasters, where the cells within the polygon = 1, and ...
2k views

### How to stop writeOGR from abbreviating Field Names when using “ESRI Shapefile” driver

I'm currently using the following script to add some attribute data from a table to lots of individual shapefiles: library(rgdal) specieslist <- read.csv("SpeciesList1.txt", header=F) attdata <-...
820 views

### Merging multiple SpatialPolygonDataFrames into 1 SPDF in R?

I have created 2 polygons in QGIS. Using them in R, polygons become automatically SpatialPolygonsDataFrame (SPDF). I would like to merge them into single SPDF (as is super easy in ArcGis using Tool ...
28 views

### “Downsample” a dense grouping of points onto a sparse grid

I have a SpatialPointsDataFrame with thousands of datapoints in a relatively small geographic area. The points are grouped around regions of physical measurements and are hence irregularly spaced: ...
15 views

### Error when running v.krige

I've been trying to get v.krige to run in the Grass7 command line, however, when I do so I get the following error: Error : .onAttach failed in attachNamespace() for 'rgrass7', details: call: if (...
15 views

### Extract lat long point values from EASE2 without reprojection

I have the following file: EASE2 and want to extract the values for this geographic location (148.1, -35.6) #lon lat. How can I do this without the need for reprojecting the ease grid file into ...
50 views

### CityGML: Calculate orientation and inclination angles from a polygon's LinearRing coordinates

I have multiple CityGML files of different cities. Only one of them is in such a good condition that it includes the orientation and inclination angles of every roof polygon (as a gen:stringAttribute)....
8 views

### Using predict function in raster package for applications other than species distribution modelling?

I was wondering if the species distribution modelling technique can be used to analyze other variables such as human movement. For example I have data on whether a person attends a facility (binary ...
25 views

### QGIS reads CRS different [duplicate]

I have a data frame with more than 100000 observations. I'm trying to convert this data into a shapefile in R. I give some CRS to data in R but when I open the shapefile in QGIS I see a different CRS. ...
48 views

### R or ArcGis: average per polygon of the shortest distance to a river from each point in that polygon

All the shapefiles necessary can be found here. These are shapefiles of lakes, and rivers. Downloading one shapefile as an example should be enough to get me on the right track. The nuts file can be ...
41 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 ...
35 views

### Identifying differences in polygons across shape files

I am trying to compare the 2000 Census county boundaries with the 2010 Census county boundaries. Each county is uniquely identified in a given year by a FIPS code and I want to compare if the polygon ...
46 views

### How can a statistically significant difference between rasters be calculated?

so after some gruelling use of MaxEnt I have four occurrence probability rasters for the four quarters of the year, each one is about 70MB+. I want to test whether they are significantly different ...
35 views

### Road snapping in R - snapPointsToLine / Projection Problem

1. Introduction (you may skip this if you like) In order to implement a road snapping feature in R for recorded positioning data, I first searched the internet for possible solutions to the problem: ...
41 views

### How to make a loop that interates over large raster cells in R go faster?

I am trying to add +1 to the cell value of certain cells in a raster. I have the cell numbers of the cells on which I'd like to perform said computation saved in a vector. I have a working code but ...
39 views

### Rasterizing in R - how do resolutions work? (e.g. population within a circle)

I'm creeping into building surfaces - useful for a number of public health projects - and can't seem to make sense of what's happening with the resolution and raster building process to get what I ...
22 views

### How to query breadwinning mothers in IPUMS USA microdata?

Overall goal: Map rates of breadwinning mothers throughout South Carolina. I haven't been able to find exactly what I need in American Factfinder. I am looking for something that comes close to what ...
19 views

### R GIS layers not lining up (spplot/plot)

I'm trying to make a choropleth in R using a polygon file, with a points layer of local care homes on top. When I plot each layer individually they're fine, however when I put them both together (...
9 views

### How do you transform a STFDF into a raster?

How do you convert a STFDF object (spacetime in R) to a raster stack?