Statistical computing language and software environment.

learn more… | top users | synonyms

3
votes
1answer
38 views

Ripley's K function in QGIS Chugiak 2.4

I'm a noob user and I need to apply the Ripley's K-function on a point pattern in QGIS 2.4 Chugiak, but I don't know how to do. I think I need to use some plugin or extension (maybe GRASS, R or ...
5
votes
1answer
367 views

Rgeos drops associated values when intersecting polygons

I am trying to intersect two SpatialPolygonsDataFrames and get a SpatialPolygonsDataFrame as the result. Unfortunately, using the gIntersection function from rgeos (which works impressively quickly ...
3
votes
1answer
64 views

Fixing orphaned holes in R

I'm trying to perform a union on a common field after merging two adjacent shapefiles. The shapefiles end up with at least one thin sliver of space between them. When I attempt a union I get the ...
2
votes
2answers
45 views

Convert shapefile with lists to data frame in R

I would like to ask some help for converting a shapefile to data frame. I downloaded data related to roads from Natural Earth. I imported the shapefile using shapefiles package like the following. ...
1
vote
1answer
32 views

How to convert raster to im object for point process model covariate in R

I am trying to convert a raster object to an .im object for use with a point process model in the spatstat package in R. I begin by creating the raster from a tiff file using the raster() package. No ...
1
vote
0answers
57 views

Using r, readShapeSpatial fails with simplified mapshaper.org shape

So I'm mapping out the postal regions of my country and it's an enormous, 5.4million row dataframe. I don't need every single little twist and turn of the boundries, so I was super excited to ...
1
vote
1answer
75 views

How to find highest kernel density point

I've been using spatstat to analyse point patterns in R. Here's an example to put this in context: library(spatstat) library(maptools) # to convert sp class to ppp Some point data: set.seed(1985) ...
0
votes
1answer
37 views

Subset netCDF based on last valid variable by level

I have a netCDF file (in this LINK) which contains monthly average values for 4 parameters at 11 different depth levels (0-200m). I would like to extract the monthly value for temperature "votemper" ...
2
votes
1answer
683 views

GDAL loads in Python, but not IPython (Linux)

I am trying my hardest to utilize the work of the good folks at the GeoDa center, but I cannot seem to get all of the components to load. GDAL, in particular, has been giving me some difficulty. The ...
1
vote
2answers
85 views

Transforming and Projecting Shapefiles in R & ArcGIS for Desktop?

Perhaps this is an issue with one of my original data sources, but I've searched extensively to address this problem both through ArcGIS and R. I've got 2 separate sources of a county layer SourceA ...
3
votes
0answers
36 views

Resampling air temperature gridded data to sub-grid resolution

I'd like to obtain a 30-m resolution gridded dataset of air temperature from the ~1km gridded data of WorldClim, of Hijmans et al., 2005) for a mountainous region. The easiest procedure (I thought ...
1
vote
0answers
27 views

How to convert shapefiles to rasters? [duplicate]

I have my environmental variables such as elevation, soil, vegetation and others as shape-files. I want to use a raster command to upload them as tiff files for running a boosted regression tree in ...
4
votes
3answers
67 views

Create a rectangular buffer from point shapefile using QGIS/GRASS/SAGA GIS/R

I have a points shapefile and I want to create a rectangular buffer (22 x 16 km) around each point. My goal is to create a 16x22 km grid where each of the points is the centroid of the grid. Seed the ...
3
votes
3answers
330 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 ...
1
vote
1answer
92 views

How to open and plot Globcolour chlorophyll image in R?

Level 3 globcolour chlorophyll images (download from hermes) are in netCDF format. Those files can be imported via ncdf package to R 3.1. ch.nc = ...
0
votes
0answers
32 views

R PostGIS convert SpatialPolygon to PostGIS table

I've been having some success in scraping some webdata and converting it from HTML to spatial data as originally asked here: Parse PHP/HTML to shapefile or similar I've been using R to both fetch the ...
6
votes
1answer
273 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 ...
0
votes
1answer
400 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. ...
1
vote
1answer
34 views

Clump and eliminate classes in a raster in ArcMap or R

after interpolation of sediment classes, I obtained a raster which looks like the image below (sample of the river). I would like to clump and eliminate areas within the raster that are below a ...
3
votes
2answers
105 views

How to iterate through features in a shapefile using R?

I am interested in iterating through a point shapefile to perform tasks on a point by point basis using R. In Python, this can be accomplished using the following workflow: import arcpy shp = ...
1
vote
1answer
59 views

Problem in creating neighbors, area and perimeter in spatial econometrics using R

I’m working on a spatial cross section model with R-programming-language. I’m running these codes which refers to anselin data (spatial_columbus) in spdep package. I found them from these links: ...
0
votes
0answers
18 views

Doing joint hypothesis test in spatial regression using R?

I'm doing estimation of spatial lag/error model using R package "spreg"/"spdep" but I cannot find any method to do anhypothesis test after regression. For example, I want to test whether two ...
0
votes
1answer
93 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 ...
4
votes
2answers
529 views

Reduce the resolution of a shapefile in R (or QGIS if necessary)

I'm using shapefiles of history U.S. state boundaries from NHGIS to make maps in R. These shapefiles are much higher resolution than I need when making maps at the scale of the country: over 2 million ...
4
votes
1answer
100 views

Why covariance values are different in R and ArcGIS?

I've calculated covariance between 7 rasters using R and ArcGIS. It gives me different results. Each times covariance values from R are approximately 1.874 times higher than ArcGIS values. R - ...
6
votes
1answer
361 views

Route analysis in R based on the OSM transport network: possible?

I'm analysing the likely paths taken by commuters on their way to work, based on Census flow data, job density distributions and the transport network. At the moment I'm using pgRouting and the ...
8
votes
2answers
1k views

How to Find the Average Raster Value of an area defined by a shapefile using R?

I have a set of raster images which represent a specific month over the years, and I want to make a timeline of the average values of an area using a shapefile. How do I extract the values from the ...
1
vote
2answers
47 views

Avoiding R for windows gui front-end has stopped working error?

I am trying to load huge number of points (shape file) in R. But when I load it, the program displays following error message and just stops. "R for Windows GUI front-end has stopped working" My OS ...
2
votes
1answer
34 views

How to create header files for multiple rasters in R

I have nearly 1000 generic binary images, i.e., headerless, band sequential and binary (16-bit signed integer). I have been succesfully able to load these with package 'raster' only when I create an ...
0
votes
1answer
114 views

Why Stacking rasters return all values as NAs?

I have several rasters that I want to do some calculations ,basically calculating the moving average. dir2 <- list.files("D:\\2010+2011", "*.bin", full.names = TRUE) ...
1
vote
1answer
36 views

Adding a grid and selecting random cells from spatial polygon in r

I have a fairly similar question to this: Similar Question I am working with a map of Denmark or more a subset of a Denmark Map. This file comes from the Global administrative areas site GADM site ...
7
votes
4answers
940 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 ...
2
votes
2answers
391 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 ...
1
vote
0answers
43 views

R-Studio - Bare Soil Line using landsat data in R

I am using R-studio with landsat package for computing and plotting the Bare Soil Line (BSL) on landsat tif image running on my HP Pavilion i7 laptop. The codes for running the BSL() function is as ...
0
votes
1answer
47 views

How to get specific coordinate system to get arcGIS point shapefile in r?

I have a Point shapefile from arcGIS 10. I want to get it in r and also want to get it a specific predefined coordinate systen for my data. I can read the shapefile in R but summary in r Shows ...
0
votes
1answer
44 views

Extract single datapoint from netCDF file in R using ndcf

I'm trying to extract a single variable from a 3-dimensional netCDF file. [1] "file blah.nc has 3 dimensions:" [1] "longitude Size: 200" [1] "latitude Size: 100" [1] "time Size: 2000" [1] ...
15
votes
2answers
4k 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 ...
4
votes
1answer
53 views

Convert ESRI Shapefile to Raster using R - biggest polygon area to raster cell value?

I want to create a raster from an ESRI shapefile. Multiple polygons may exist in one raster cell. If so, I want to assign the attribute variable which occupies the biggest area of the raster cell. ...
4
votes
2answers
44 views

Map location of unknown point with distances to two known points

I'm trying to develop a function in R that will locate a point (A) on a map given distances between that point A and two other points (B and C), for which exact coordinates are known. The problem I'm ...
2
votes
2answers
35 views

Counting number of points in particular polygon for list of individuals using R?

I have distribution points for a set of individuals and a file of polygons-with matching IDs. What I would like to do is to go through and for each individual find the total number of points and the ...
1
vote
1answer
31 views

(R)SAGA: saga_cmd 2.1.0 error? inconsistency?

frequently I am using (R)SAGA, but after SAGA became >2.1.0 the R package is no longer working. The last update for RSAGA was 07/2013. Thus I downgraded SAGA to 2.1.0 (first try was skipping the ppa ...
2
votes
0answers
147 views

Moving point on OpenStreetMap route

Basically I generate random numbers in R language which are indeed times between bus arrivals. I need to simulate a moving point(a bus) in OpenStreetMap by using this generated numbers. I have read ...
1
vote
0answers
51 views

Rounding off coordinates in an SpatialPolygonDataFrame in R

EDIT AFTER COMMENTS After a comment of Whuber (Thank you!) I realized it will probably be most easy to incorporate a round(...) statement within my code to be able to work with less decimals. ...
0
votes
1answer
20 views

How to batch export using r.out.gdal command in GRASS

I created a list of files (NPPFILES) using g.mlist command in GRASS 7. Now I would like to export these files as .tiff files. I tried this command in GRASS prompt for files in $NPPFILES; do ...
2
votes
2answers
194 views

Create Raster file in R from Matrix and latlons

I could use some advice on how to create a Raster file in R with a Matrix of data points and the coordinates stored in a separate file. Both, data and coordinates come from a NetCDF file. I extracted ...
1
vote
0answers
47 views

Calculating surface and lines in 3D projection in R

For my internship research I am trying to compare the surfacearea and length of geometric shapes and lines in one coordinate system to another. I have a SpatialPolygonDataFrame in the European equal ...
1
vote
1answer
300 views

r.surf.contour in QGIS 2.0

I have a problem with r.surf.contour. I create a DTM with v.to.rast.attribute and then use the r.surf.contour and it works fine in QGIS 1.9 but with QGIS 2.0 doesn't work. I have a contour shapefile ...
0
votes
0answers
29 views

How to reference a number variable in r.mapcalc within QGIS graphical modeler

I need to run the following formula in r.mapcalc: (xor(abs(A-B),abs(A-C))>120)*A I would like to however use a user defined number input variable instead of the 120. I already have this variable ...
1
vote
0answers
27 views

Calculating average raster values around set of points using ArcGIS for Desktop (or R)? [duplicate]

I have a 30-m elevation raster as well as a set of points that overlay the raster. For each point, I want to calculate the average elevation within a 5-km radius of the point. One way I was ...
1
vote
1answer
115 views

How do I peform a true GIS Clip of polygons layer using a polygon layer in R

I would like to do a true GIS Clip in R of soils polygons using a series of single boundary polygons, but I cannot find an R function to properly do it. It should work just like the CLIP function in ...