Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
1answer
17 views

Add Points shp attributes to Polygon shp by Point location (as Spatial Join in ArcGIS)

I have a set of points in .shp (ESRI, available here: http://ulozto.cz/xGqRVFrR/voronoi-zip). I would like to calculate Voronoi tesselation from the points, thus create polygons. So far, so good. ...
1
vote
0answers
13 views

rgdal with multiple Feature Datasets in R

I am trying to read shapefiles contained within a geodatabase file (.gdb) into R. The .gdb contains two Feature Datasets with multiple Feature Classes within each. The problem is only one of the two ...
9
votes
2answers
2k views

How to get the second nearest neighbor between two point patterns in R?

Is there a way to get the distances for the second nearest neighbor between two point patterns in R? The spatstat package has a function called nncross but it only applies to the nearest neighbors ...
14
votes
2answers
3k views

Using R with ArcGIS Desktop

In response to comments below, a re-phrasing of the question. I've used the integration of R with QGIS, and found it a very uesful tool. Having taken a look at the R toolbox extension for 9 and the ...
14
votes
3answers
633 views

How to determine if trees within forest gaps are clustered?

The attached dataset shows approximately 6000 saplings in approximately 50 variable sized forest gaps. I am interested in learning how these saplings are growing within their respective gaps (i.e. ...
2
votes
1answer
56 views

R - How to “smooth” a raster map

I am trying to create a map from raster data. The file came from a crop model, with resolution of 0.5 degree. Even when I disaggregate it (i.e. increase spatial resolution), the map looks really ...
0
votes
0answers
16 views

Krige function in gstat cannot see explanatory variables

I have a SpatialPointsDataFrame in R which I wish to interpolate using the krige command in gstat. When I use ordinary kriging (krige(Var~1)) the code runs fine. When I want to use universal kriging ...
1
vote
1answer
100 views

unsupervised random forest classification in R

I want to compute an unsupervised random forest classification out of a raster stack in R. The raster stack represents the same extent in different spectral bands and as a result I want to obtain an ...
12
votes
1answer
3k views

How to perform Random Forest land classification?

This is a follow-up to a previous post: Machine Learning Algorithms for Land Classification. It seems that the Random Forest (RF) classification method is gaining much momentum in the remote ...
1
vote
1answer
186 views

How to do supervised image classification in saga with the help of R script or Python script

I am using Ubuntu 12.04 and want to do image classification in SAGA. SAGA has numerous classification algorithms which is not present in GRASS and QGIS. I am new to SAGA, but more accustomed to work ...
1
vote
3answers
26 views

Creating a new raster layer based on mean of other raster layers, ignoring NA values in R

I am trying to create a new raster layer that is made up of the mean values from 7 other raster layers. I get results using overlay function mean: mean <- overlay(2000, 2001, 2002, 2003, 2004, ...
1
vote
0answers
15 views

Problem with regression kriging using the krige command in r

I want to perform regression kriging in R using gstat. I have a SpatialPointsDataFrame which is of this form: After I have run my glm model, in order to see which variables are statistically ...
1
vote
2answers
884 views

Calculate area covered by a particular raster layer within polygons in QGIS

I am trying to extract information on vegetation cover within a set radius of point locations (my sites). I have succeeded in creating a new vector layer of circles with a 5 km radius around my sites. ...
0
votes
0answers
19 views

plot rasters with the same line diagram

I have 6 raster files with continuous values for an area with the same extent. I have created a raster stack and I want to plot one line for each cell in the raster stack of my six rasters (like the ...
0
votes
1answer
42 views

Cross validation in thiessen polygons interpolation

I apply Thiessen Polygons interpolation using the krige command in the gstat R package. Using krige without a variogram model sets automatically krige function to perform IDW, and when nmax parameter ...
11
votes
2answers
117 views

How does spatial polygon %over% polygon work to when aggregating values in r?

I'm working on an environmental epidemiology project where I have point exposures (~ 2,000 industrial hog operations - IHOs). These IHOs spray on nearby fields, but the feces water droplets and smell ...
0
votes
0answers
21 views

Using R to find attributes of spatial neighbors, especially with big spatial polygon data frames

If it's not too much, I have a specific question that leads to a more general one: I'd love thoughts on both if it's possible. First, the specific: I have an analysis involving census blocks and ...
0
votes
1answer
36 views

in R : get a SpatialPolygonDataFrame from gIntersection{rgeos] with sub-area as attribute?

I am using gIntersection (package rgeos) to intersect a polygon shapefile containing 20 buffers zones, with another polygon shapefile containing "ground occupation mode (GOM)" (an area divided in ...
5
votes
5answers
2k views

Create a ground overlay kml from georeferenced raster

I have a world georeferenced raster (5m resolution, ~4000 x 4000 pixels) that I would like to display in google earth. I am looking for a simple and effective way to generate this kml file. Using ...
4
votes
2answers
131 views

Calculating Shannon's diversity using moving window in R

I have a raster where each pixel is a particular vegetation type. I'm interested in the diversity of vegetation types around each pixel. I'd like to assign a Shannon's diversity index value (see ...
6
votes
3answers
3k views

Converting osm file to shapefile (or data frame) in R

I was looking for a road shapefile for Australia today. I ended up going to Geofabrik. Open Street Map has data in .osm format. But they do not have one in .shp for Australia. If possible, I want to ...
3
votes
2answers
33 views

writeOGR with a spatialpolygon simplified by gSimplify

I'm using gSimplify (rgeos package) to simplify the geometries of a shapefile. The funcion works good, but now I can't write the output in a new shapefile. I tried some ways: writeOGR(simplyshape, ...
0
votes
2answers
23 views

How to produce a finer resolution spatial grid from coarser grid in R?

I have a spatial grid of an image. Now I want to use this grid and make a finer resolution grid out of it. For example an image structure in R is given below: str(c) Formal class ...
0
votes
1answer
144 views

Package getcartr Installation Problems

I want to build a cartogram by following this tutorial. The first thing I did, I spent the R-R-3.1.1 version 3.1.2 then I did the following: library(devtools); ...
0
votes
0answers
12 views

Dynamic polygons grid with specified area based on raster

I'm interested if anyone have idea how to automatically create (maybe in R?) dynamic grid of polygons with specified approx. area (for example around 20000 m2) based raster data or points with values ...
5
votes
3answers
3k views

Reading File Geodatabase using R?

File geodatabase (fgdb) includes numerous file geodatabase tables. As far as I know they exist as dbf files, but are within a Database.gdb. In ArcCatalog, the file pathway resembles ...
2
votes
0answers
20 views

Spatial weight matrix with boundary effects in R?

I need some help to finalize code for a spatial weight matrix that uses a nearest neighbor definition within regions, but does not allow neighbors from across a political border. For example, ...
0
votes
0answers
13 views

Why does R(gdal) mangle data when converting to geojson?

I've encountered issues with projections in .geojson files created by rgdal, but I never thought it would destroy my data, until I tried this (reproducible example): ...
6
votes
1answer
487 views

Stats on individual grid points nearest neighbours

I have shp of points where each point is the centroid of the individual cells of a 1*1km grid (~ 500 000 points). For each of these points, I have their coordinates and elevation. What I want: for ...
3
votes
3answers
44 views

Lines on reprojected sp objects with Mollweide projection

I'm having an odd problem such that when I reproject maps to a Mollweide projection in R using sp, I get additional lines stretching across the globe. What is going on here, and do you have any ...
0
votes
1answer
36 views

How to choose a shapefile interactively in R

I am writing a function in R where i want the user to choose a Esri shapefile from its destination folder. Since a shapefile is made of several files how can i select them. For a point feature class i ...
-2
votes
1answer
30 views

I need to create a function in R that processes rasters in esri grid format [duplicate]

I have loads of data (6500 files that I need to process and find yearly winter sums/averages/variance for. the format for my naming system is Syyyymmdd_rp. Each file is in the same file folder. I ...
3
votes
1answer
74 views

Processing large amounts of Rasters in R

I have 6500 processed and clipped rasters that indicate snow levels on a daily basis in the northern hemisphere. I need to create a raster that represents a sum of the snow for the season. The winter ...
1
vote
2answers
39 views

Getting attribute table from WFS data source

I am attempting to get some WFS 2.0 INSPIRE data from the Finnish meteorological institute into a table format of some kind. Is there any software which can easily grab the attribute data for the WFS ...
2
votes
1answer
584 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: ...
1
vote
1answer
23 views

How to read feature class in file geodatabase using R?

I have a feature contained in a geodatabase that is larger than 2GB as an exported shapefile. I need to run an extract function in R to attribute the polygons with data from a raster file. Exporting ...
0
votes
0answers
14 views

Thin Plate Spline interpolation

I am completely new to spline interpolation, and I want to apply Thin Plate Spline using the fields package in R, and after I have applied Tps then do leave-one-out cross validation. This is how my ...
0
votes
0answers
14 views

How to reference to user input in SQL string in R?

I am building a R Shiny interface that queries the user input in Postgresql and generate the respective map layer. However, I am unsure of the syntax to include the query in the SQL string. my codes ...
1
vote
0answers
19 views

No output when rendering GeoJSON using Leaflet() package in RShiny

I am creating a Rshiny interface on that can take in the user input when a user click on a point on the map, query the user's selection from postgresql and return another map layer. The package I am ...
0
votes
0answers
22 views

How to convert a geojson from Postgresql to geojson format readable in rCharts in R?

I am creating a Rshiny interface on that can take in user input and SELECT the respectively map layer from Postgresql database based on the input. The package I am using to plot the map is rCharts. ...
0
votes
2answers
238 views

projection conversion from mercator to google maps format

Is this spTransform(Finland3, CRS("+proj=longlat +ellps=WGS84 +no_defs+ellps=WGS84 +towgs84=0,0,0 ")) the right way to project a shapefile with this projection coord. ref. : +proj=merc +lon_0=0 ...
2
votes
5answers
2k views

Counting road intersections and blocks

I have a shp file that consists of the road system of Mexico City. I would like to count the number of road intersections (crossings) and blocks (which I would define as a segment starting from one ...
0
votes
1answer
21 views

Compare two rasters in R with the cell value from one replacing the cell value from another

I am trying to create a single raster from two rasters. The first raster is made up of all 0 values and the second is made up of the current date value (formatted in days from 001 to 365). The problem ...
0
votes
1answer
15 views

Calculate mean for a each object of SpatialPointsDataFrame

I have a list with several SpatialPointsDataFrame objects, and each object has certain slots. How can I calculate the meann value of a certain slot for every object in the list, and then save that ...
0
votes
1answer
44 views

IDW in R with cross validation

I want to perform IDW interpolation using R, and more specifically, using the idw command from the gstat package. Also, I want to use the optimal number of neighbors (point locations) and distance ...
0
votes
1answer
22 views

GlobCover 2009 dataset - importing legend and colormap values into R

Does anyone know how to import a legend for a raster layer (loaded as a .tif) into R such that it can be attached to the raster file itself and used in plotting? In this case, I am using the GLC2009 ...
0
votes
1answer
26 views

Compare two rasters with raster overlay and replace cell value with variable

I want to compare 2 rasters and when there is a change from 2 to 1 create a new raster that replaces the cell where the change has been detected with the change variable. ## Finds Cells that have ...
6
votes
2answers
1k views

How to implement bivariate Ripley's K function in ArcGIS 10?

The attached image shows a forest gap with red pine represented as circles and white pine represented as crosses. I am interested in determining if there is a positive or negative association between ...
5
votes
3answers
2k 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?
3
votes
0answers
32 views

Why does @data@values slot for RasterLayer only contain logical(0) and not the actual values?

Trying to get to the bottom of why, when I read in a raster of NDVI, the @data@values slot does not contain the actual values until I set them manually. For example: NDVI <- ...