Statistical computing language and software environment.

learn more… | top users | synonyms

3
votes
2answers
904 views

Extract Raster from Raster using Polygon shapefile in R

I am new to R and using the raster package. I have a problem extracting polygons from an existing raster file. If I use extract(raster, poly_shape) function on the raster it always creates a list ...
4
votes
0answers
28 views

Projecting polygon when calculating its area? [duplicate]

I have a broad range of polygons (in vector format and in SpatialPolygonsDataFrame class), some going east-west, others going south-north, while even others span polar regions or very large ranges as ...
2
votes
1answer
132 views

Compute the area of a given polygon (in vector format) lying between specified lines of latitude

I have species distributions (in vector format) and I would like to calculate how much of the area for a given species distribution is within certain lines of latitude, such as temperate and tropic ...
2
votes
1answer
75 views

Plotting spatial data when two spatial objects have different CRS

I have a spatial polygon object and a spatial points object. The latter was created from xy latlong data vectors (called latitude and longitude, respectively) in a dataframe, while the former was ...
1
vote
1answer
55 views

How to deal with empty corners in raster when calculating fragmentation index

I have clipped buffer area around coordinate from one big raster (forest cover). Such created raster was loaded in R where PatchStat function (library SDMTools) gives fragmentation index. After ...
2
votes
3answers
201 views

R - color SpatialLines by attribute

I have a SpatialLinesDataFrame dataset of rivers in R. The dataset consists of lines (river segments) with a "Turbidity" attribute. I want to create a map and legend, where: Turbidity between 0 and ...
4
votes
2answers
170 views

Converting shapefile to raster: Character attributes

I've got a shapefile that I would like to convert into a raster, but the trick is that the attribute I want a raster version of is character data. I'm familiar with geoprocessing using GDAL (in the ...
0
votes
0answers
31 views

formula for GWPCA cross validation on GWmodel package on R software

i want to know the formula of for GWPCA cross validation to get the best bandwuth on GWmodel package on R software. thanks
1
vote
2answers
180 views

How to create a time series with a NetCDF raster from Ensembles E-OBS using GDAL, R, GRASS GIS or SAGA GIS

I downloaded a NetCDF file that contains daily precipitation values from 1-1-1950 to 30-6-2013. The raster has 23191 bands. http://eca.knmi.nl/download/ensembles/download.php My goal is to analyze ...
0
votes
0answers
70 views

Failure to display R script result plots in QGIS

I'm trying to run R scripts (3.0.2) from QGIS (2.0.1) on Windows 7 x64. There seems to be a known bug whereby the output results do not display in the QGIS GUI, but rather just an html path ending in ...
5
votes
1answer
289 views

R raster Package Moran's I interpretation

I am using raster package to calculate the local Moran's I . The example gives the range of Moran's I between - 1 to 2.47. On my own data I have see the value range -3.070423 - 7.228558 How can ...
7
votes
1answer
143 views

How can I conduct Geographically Weighted Analysis using an exponential decay function?

I have some points (representing 30 study sites) and I want to calculate the weighted mean of several variables (landscape layers) using a negative exponential decay (weights function) to give more ...
4
votes
2answers
157 views

join grid or polygon layers in R

I have two grids. Cells in each grid have an attribute. Size of grid cells differs between the two grids and the two grids do not overlay each other perfectly. I would like to create a new layer, ...
2
votes
1answer
126 views

Plot a Raster in R with white space for NA values

I want to produce a .png of a raster with background values plotted as white space. Below you can see the current state of the plot. As you can tell, the pixels which should contain NA values, ...
3
votes
3answers
469 views

Convert 800 .hdf4 files to Tiff using GRASS/QGIS/SAGA/GDAL/R

I've have MODIS ndvi data (MODIS_Grid_16 days NDVI) from the iberian peninsula, from February of 2000 to August of 2012 (really big data). How do I batch convert about 800 .hdf MODIS files to .tif ? ...
2
votes
2answers
103 views

R - What is the purpose of .GAL lattice file?

Could someone please explain to me what the purpose of a .GAL lattice file is? I want to see if my data are spatially autocorrelated and I've been following Bivand (2013). I have loaded my polygon ...
4
votes
0answers
187 views

R Raster package loop over pixels

I want to perform a trend analysis for each pixel over it's time dimension. Therefore I wrote a loop over each pixel doing the calculation but this is extremely slow. I am sure there must be a faster ...
0
votes
0answers
63 views

Resources for mapping and displaying spatial data in R

I'd like this to be a repository for all resources available specifically for mapping and displaying spatial data in R. I've seen (and contributed) to this post, but would like this post to focus ...
1
vote
1answer
822 views

How to process MODIS ndvi data using QGIS/GRASS/R?

I have MODIS ndvi data (MODIS_Grid_16 days NDVI) from the iberian peninsula (3 tiles), from February of 2000 to August of 2012 (really big data). I want to know how to deal with this kind of files. My ...
6
votes
2answers
267 views

Calculating spatial lags per year in R

At the moment I am having some difficulties with calculating a spatial lag in R. I know how to calculate the lag in space-wide format but am unable to do it in long form, i.e. have repeated ...
0
votes
0answers
110 views

Defining the boundary of a catchment area

I digitized contour lines from topographic maps and created a DEM. With the DEM, I estimated the boundary of a catchment area. Estimated positional accuracy of topographic maps is RMSE = 65 m, with a ...
2
votes
1answer
76 views

Matching two point clouds without loss (nearest neighbor, but more complicated)

I have two point clouds, one with demographic and one with electoral data. Points in both clouds represent the same empirical entity (say, a village, or an urban neighbourhood), but are not in the ...
1
vote
1answer
229 views

R - Dealing with missing data in SpatialPolygonDataFrames for Moran.test

I'm trying to use Moran.test on a SpatialPolygonDataFrame consisting of 7194 elements in R. I know that there is around 150 polygons with NA values. First I generate a spatial weights matrix: ...
3
votes
3answers
384 views

Per-pixel (statistical) calculations on a raster stack using GDAL

In R, it's relatively trivial to perform per pixel calculations based on a raster stack (e.g., get std.dev for each pixel on a 12 layer GeoTIFF). Unfortunately, the speed is less than desirable when ...
2
votes
1answer
181 views

Conversion of Latitude/Longitude to different map projection

I have two m*n matrices coming from a WRF-ARW simulation: one exclusively with longitude values and one with only latitude values. For both matrices I know the originatin projection (lambert conic ...
7
votes
4answers
1k views

Overlay a spatial polygon with a grid and check in which grid element specific coordinates are located

How can one use R to split a shape file in 200 meter squares/sub-polygons, plot this grid (incl. ID numbers for each square) over the original map below, and evaluate in which square specific ...
-1
votes
1answer
580 views

How to create a loop in R to average ndvi raster time series?

I have monthly ndvi raster geotiffs for multiple years. I need to run a loop to get the average of each of these ndvi grids/rasters. Each of my ndvi rasters contains 143 pixels. I would like the ...
1
vote
1answer
68 views

How to infer a relationship between two spatial points using R

I am quite new to the area of spatial statistics, but I'm very interested. For learning and demo purposes, I've created three datsets. Dataset - Persons: This describes individuals at a certain ...
3
votes
0answers
122 views

Performing cluster analysis in R with Point Datasets

I am a R-Beginner, but I want to use it for some spatial statistics. I want to check the relation between the occurrence of ill persons and the existence of water in a area of interest. To give you a ...
6
votes
1answer
328 views

Calling external files in Python Geoprocessing Service

I have created a Python script which calls an R script and then reads the output back into Python. I can run this tool in ArcGIS Desktop (10.2.1) and it works fine. When I publish as a geoprocessing ...
2
votes
2answers
828 views

SpatialPointsDataFrame properties and operators in R

I have created an object of type SpatialPointsDataFrame using the sp package in R. However, I am confused about the @, $, . and [] operators and when to use them to access the different properties of ...
2
votes
3answers
147 views

How to reclassify only a part of a raster but keep the rest unchanged (ArcGIS or R)

I'm trying to reclassify only a certain part of a raster...not the entire raster. Here's the problem. I have a LULC raster of the entire US. There are some issues with the raster that I want to ...
8
votes
1answer
232 views

Help choosing most suitable bivariate choropleth mapping coloring scheme

I am trying to overlay a nominal variable (2 categories - rainfed vs irrigated) in a choropleth map over a numeric variable. In order to highlight the difference in pattern among the two ...
1
vote
1answer
354 views

Convert from eastings and northings to latitude and longitude without ArcGIS

I am not a GIS user, but I was given some shapefiles to work with. I do not have ArcGIS or any other GIS tool, but I do have Matlab with the mapping toolbox and R. From what I can tell, the data is ...
2
votes
3answers
75 views

Relative areas projection independent?

I need to calculate how much (in percent) each of thousands of spatial polygons shrink after some events. I use R and the very useful sp-library. Example: Projection: "+proj=longlat +datum=WGS84 ...
3
votes
2answers
288 views

How can I create a choropleth from the 2010 census ZCTA shapefile using R and ggplot2?

I have created state and county choropleths in R using ggplot2. The method I have used for this came from Winston Chang's "R Graphics Cookbook". For those choropleths the map was already represented ...
0
votes
1answer
44 views

linked maps not working in R

I am trying use the micromap package in R, but something is not working. This is the code: library(micromap) library(rgdal) library(ggplot2) setwd ('C:/Users/Jesus/Dropbox/linked maps/Chapter4') ...
2
votes
2answers
389 views

What is the latest version of R that supported gpclib?

Does anyone know what the latest version of R that supported the gpclib package? I was using the latest version but when I tried to install gpclib, it said that it was unable due to my version of R. ...
2
votes
1answer
61 views

R generated files getting scrambled on import in ArcGIS

I want to put this out there just in case someone somewhere has experienced similar issues. I have a .csv file that I have generated in R 3.0 using this code: ...
0
votes
0answers
66 views

Dates are off when opening netcdf file in R

I have a netcdf file with the time dimension that goes from 12/2007 until 12/2010 with monthly time steps. I can see the correct dates in both arcgis and panoply. Panoply tells me this file is a ...
2
votes
1answer
135 views

Null values coerced to zero (0) when exporting to csv or txt

I extracted values from several rasters, and in some cases, the value is null. However, when I export the attribute table to a csv or a txt file (from ArcMap), the null values are converted to 0. Is ...
0
votes
1answer
167 views

How to load Georeferenced Scanned Maps in R

I have a geo-referenced scanned Map in GeoTiff format, which I would like to load into R. My intention is to plot some vector data (points and polygons) over this map using maptools package. Is ...
1
vote
2answers
477 views

Processing HDF4 data in R

I am trying to process MODIS files in R, which are in HDF4 format (link to data). I have experience reading in HDF5 and netCDF files in R, but HDF4 seems to be a common problem in R. I am using a MAC ...
2
votes
1answer
331 views

how to extract a variable at specific time and depth from netcdf in r

I have the following netcdf file containing 7 variables and 4 dimensions. [1] "file data.nc has 4 dimensions:" [1] "depth Size: 12" [1] "time Size: 37" [1] "x Size: 305" [1] "y Size: 432" ...
2
votes
1answer
78 views

shape file for linked micromap not working

I am trying to replicate the example provided in the micromap R package of a linked map with the poverty rate for the 50 US states. I am trying to achieve the same results with a Shapefile from ...
2
votes
0answers
81 views

python equivalent of spatstat's spatial point process functions

Is there a free python package (i.e. PySAL?) that implements the standard summary statistics for spatial point processes, e.g. the F, G, J, and K functions? I'm happy to use R (i.e. spatstat) if ...
1
vote
3answers
167 views

How to access shapefile table in QGIS Modeler R scripts?

I need to develop .rsx scripts for QGIS 2.0.1 Modeler to do statistical elaborations on data tables of loaded vector layers. In this case I am not interested in accessing shapefile geometries, I'd ...
3
votes
2answers
146 views

Exporting Maps as PDFs in R

In R, trying to export choropleth maps with density and frequency histograms as legends; have had success exporting as an image but not as a pdf. Exporting as an image (.png) works well; the map, ...
1
vote
1answer
71 views

R: distance from one point to many polygons

OK so I have a spatial polygons data frame, and I have a point of interest. I want to add a row to the SPDF that contains the distance from the centroid of each polygon to this given point. How do I ...
0
votes
1answer
169 views

Units of gBuffer from rgeos package

I have this polygon: library(maptools); library(sp) setwd(system.file("shapes", package="maptools")) columbus <- readShapeSpatial("columbus.shp") proj4string(columbus) <- CRS("+proj=longlat ...