Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
1answer
69 views

Convert point to grid: Numbers of cells differ

In R I am trying to aggregate points data to a grid. The data for the grid (G-Econ) comes as a csv-file. In this file each row represent a grid-cell at 1x1 degree resolution and the given ...
2
votes
1answer
149 views

Splitting strings into new rows, retaining geometry

UPDATED BELOW I have 9 shapefiles, each shapefile has 700,000+ rows and I have roughly 12 attribute fields in each shapefile. There are three attribute fields, common to every shapefile, that I am ...
2
votes
1answer
143 views

Access Shapefiles from PostgreSQL/Postgis in R

I successfully setup a connection to my PostgreSQL/PostGIS database on Ubuntu Server from my Laptop (Ubuntu 12.04). Therefore I installed RODBC in R to setup a connection and I made a correct entry ...
3
votes
1answer
144 views

Sample size for variogram modelling using the geoR package in R

I am trying to use the geoR package in R to model the variogram for a dataset of 15 000 sample points of bathymetry data. I intend to do a random split to create test (20%) and training samples (80% ...
2
votes
1answer
163 views

R or QGIS? Measuring elevation at points on DTM surface

Based on answers to this recent question I have been able to create natural looking digital terrain models using a combination of raster, rasterVis and rgl working on data held in ESRI ASCII grid ...
2
votes
2answers
119 views

Determine if points fall upstream or downstream from a point on a line (river)

I have a set of fish species occurrences (lat/long) as points and set of rivers as lines. The fish species can of course only occur in the rivers (and not on land). I would like to determine whether ...
3
votes
1answer
226 views

remove land area from marine region polygons

In my pursuit to merge multiple polygons for the purpose of calculating the surface area of marine species distributions, using shapefiles from Marineregions, I am now trying to remove potential land ...
0
votes
1answer
55 views

Can rgdal use an external GDAL installation?

The README for rgdal contains the following text: file.show(system.file("README", package="rgdal")) For additional drivers, users of the CRAN Windows and CRAN OSX binaries can either convert ...
1
vote
0answers
38 views

TPS and Kriging Cross-Validation

I am looking for existing package or functions that will allow me to cross-validate multiple outputs of Thin plate spline (TPS) and Kriging from the fields package. Does anyone know of any availabe ...
8
votes
3answers
209 views

R, rasterVis and RGL: how to prevent reflective surfaces?

I have been experimenting with digital terrain model files in ESRI ASCII grid raster format. Despite zero experience with this type of data I found it very easy to load into R, as per code below. The ...
5
votes
4answers
352 views

Calculating percent cover from shapefiles

I normally do not work with shapefiles, so I am a bit lost here. I have two shapefiles each with multiple objects. The first is a set of 32 polygons (each one is a plot). The second shapefile has ...
0
votes
1answer
124 views

Summarize values from a raster brick by latitude bands in R

I would like to sumarize (sum and/or mean) values from layers on a raster brick based on latitude bands (been using raster package). Been looking at the package documentation and didn't find a way to ...
2
votes
2answers
94 views

How to find the second highest value in a rasterStack in R

I have a rasterStack of rasters representing count data. I want to return a single raster whose values are the index of the raster with the second highest value for each cell. (I used which.max for ...
2
votes
1answer
104 views

Axis of rendered shape files not showing numbers that are latitude and longitude

I am using rgdal to render some shape file. The first is a set of building zones from NYC Open Data. The second is the NYC coast line from OSM. The Zone files seems to generally render an X axis ...
1
vote
0answers
63 views

Making spatial clusters by direct manipulation of raster pixel values using R

I think this is an overambitious million dollar question, but I'm always optimistic when I pose a question even though I feel like I left no stone unturned! I've processed a raster layer with pixel ...
0
votes
1answer
197 views

Scale parameter of the GetMap function within RgoogleMaps

Within the R library called "RgoogleMaps", there is a function called "GetMap" which is used to save a georeferenced image file. The library's manual suggest that the SCALE parameter supposed to be ...
1
vote
2answers
244 views

unionize intersections of merged polygons

[Updated quesion] I am using the following code to merged polygons from shapefiles for the purpose of calculating the surface area; library(maptools) library(rgdal) library(rgeos) #enter slots, ...
7
votes
3answers
282 views

R - How to sampleRandom() from large raster without NA values

I have a number of vary large rasters which need to be randomly sampled with the return value being a matrix of x, y, and value. The raster package sampleRandom(raster,n, na.rm=TRUE, xy=TRUE) will do ...
3
votes
2answers
224 views

Convert polyline shapefile to points 1m apart and add xy coords in R

I have a table with xy coordinates in R and the following packages loaded: spatstat, raster, rgdal, sp and zoo. I do know how to use this to make a point shapefile, a line shapefile that goes through ...
2
votes
2answers
254 views

Plotting a map of New Zealand with regional boundaries in R

I have been asked to make a map of New Zealand using R with regional boundaries. I need something exactly like this example of a map for Switzerland: ...
2
votes
2answers
197 views

How to use ggplot with Processing in QGIS 2.0?

I'm trying to use R scripts within QGIS thanks to Processing. There are some example scripts available and I achieved to plots different columns of the attribute table (with the plot built-in ...
1
vote
1answer
222 views

add unique IDs to mutiple polygons using loop or apply function

I want to add a unique ID (row number) for each polygon in a SpatialPolygonsDataFrame. I'm new at working with spatial data (and programming) so bear with me please. The goal is to merge all polygons ...
4
votes
2answers
72 views

towgs Definition for European Datum 1950

I am new to all things GIS so apologies for a basic questions. I am trying to specify the CRS of a climatic raster layer in R. It is an equal area projection based on Europe Equidistant Conic and the ...
0
votes
1answer
258 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
2answers
578 views

Calculate distance in kilometers between two points

I have a few questions regarding the calculation of the distance between 2 postal codes. Take a look at the following code. ### # load the different packages we need ### require("rgdal") ...
0
votes
1answer
122 views

Update GEOS to 3.4

I want to use the rgeos function gDelaunayTriangulation (which requires GEOS 3.4) on my Mac, but when I load rgeos it says: > library(rgeos) rgeos version: 0.3-2, (SVN revision 413M) GEOS runtime ...
2
votes
1answer
67 views

R - Efficient way to segment rasters into sub-regions and sample… without using extract()

My question is: Is there a more efficient way to sample from a sub-region (defined by a shapefile read into a spatial object) of multiple rasters without having to use extract() for each region on ...
1
vote
2answers
224 views

Calculate a polygon around a point - and conver to WKT

The use case I have is this: I want to take points (in my case a data.frame of lat/long coordinates) and calculate a polygon around each point of a given radius (in km, miles, whatever). To be clear, ...
2
votes
0answers
111 views

Joining nearest neighbor small polygons using R

The figure shows a plot of numerous polygons (zoom in) made from a raster file by require(sp) require(raster) pol100 <- rasterToPolygons(r, fun=function(x){x==1}, dissolve=FALSE) There polygon ...
1
vote
1answer
751 views

How to make RASTER from irregular point data without interpolation

I was trying to make a raster image from an irregularly spaced point database. The data looks like- > head(s100_ras) x y z 1 267573.9 2633781 213.29545 2 262224.4 2633781 ...
3
votes
1answer
57 views

How to re-ID polygons with sapply instead of for loop

I have a line of code that renames the id's of polygons in a SpatialPolygonsDataFrame by directly manipulating the ID slot of the polygon. I'm a bit slow when it comes to sapply, having used for loops ...
3
votes
1answer
23 views

Equidistant projection for northern Delaware

I'm just getting started on a long-term project involving northern Delaware. Most of my distances will use great circle distances from the lat/lon, but for a few applications I'll wind up using ...
0
votes
1answer
101 views

R for loops in Geospatial modelling environment

I am using the isectpolypoly command in GME and would like to iterate over several polygons ("proj_0_ect0207", "proj_1_ect0207"). My code is as follows: for (i in 0:30) { ...
3
votes
2answers
120 views

Is there a way to speed up gIntersections for large spatial objects?

I'm attempting to perform a gIntersection of a big grid on a shapefile for country boundaries, so that I can calculate the % area of each grid cell that lies within the country. It takes a few seconds ...
4
votes
1answer
182 views

Loading a multipoint shapefile in R

This issue has only been raised in the community once, two years ago, to the best of my knowledge. I think it's high time to raise the issue again! readOGR, from the rgdal package, cannot handle ...
1
vote
1answer
101 views

Mapping variables based on STFID values

This quest is an extention of a question that I made earlier today but since it's migration to GIS I haven't been able to comment on my older post. My earlier post is : Mapping Kansas City based on X ...
1
vote
0answers
100 views

Mapping Kansas City based on X and Y Coordinates in R

I have a csv file in R that has coordinates of Kansas City, however, the values at these points aren't in any traditional longitude/latitude formatting that I am aware of. My data looks like this: ...
3
votes
2answers
281 views

Replicating QGIS style in R with rgdal

I want to use rgdal to plot a shapefile graduating the colour of features according to the values of one field (density). I couldn't find online detailed indications on how to do it and the package ...
3
votes
2answers
417 views

Efficient way to handle NA values from analysis in R with Raster

I am not 100% sure if GIS is the correct stackexchange for this, but here we go. A problem I have been bested by: I have a raster layer of approximately 240 million cells. It could be a DEM or ...
2
votes
1answer
92 views

Choosing correct proj4string in R for a set of points

I was given a set of points which I eventually will overlay with a polygon shapefile in R. The issue is that the person who provided me with the points did not give them to in long/lat coordinates but ...
1
vote
1answer
223 views

How to do geometric correction of remote sensing data in R?

My challenge is to replace most of the remote sensing commercial tools with R code (I'm teaching assistant at the University and I would like to move to open source R code to show the added values to ...
7
votes
1answer
191 views

Spatial Interpolation - defining a minimum value for agroup of points

I am doing spatial interpolation with a group of points. Some points have complete observation of events: for a period of 24 hours we have observed N events in each point. These points have N ...
4
votes
2answers
138 views

Problem overlapping shapefile and vector in R

I want to plot a shapefile over a raster file in R but I can't make them overlap perfectly: the raster appears to be rotated of few degrees counter-clockwise. Is it a problem with the projection? ...
0
votes
1answer
69 views

How can I export a point shapefile from ArcGIS to R

I am having several problems in exporting my point shapefile from ArcGIS 10 to R. I tried to save the shapefile as a CSV, but R reads all in one row; somebody in another question answered to use ...
2
votes
1answer
149 views

Convert multiple Shapefiles in Raster in R(and then plot it)

I'm trying to convert several shapefiles in rasters at the same time. I already was able to read the shapefiles by doing this: library(maptools) shps <- dir(getwd(), "*.shp") for (shp in shps) ...
2
votes
3answers
100 views

How to analyze and combine overlaping elevation maps into one?

I have 30 overlapping maps that contain tree density heights (measures between 1-100%) of a large area, and I need to get the highest point by pixel and create a new map with all these highest points ...
0
votes
0answers
137 views

Interpolate/disaggregate point values to an existing raster grid

I have several thousands of ASCII files whose names have the following format: data_"lat"_"long".mon (e.g. data_41.21875_-116.21875.mon). Each file represents one point in WGS84 projection and the ...
1
vote
1answer
278 views

Can't plot polygons with R and ggplot2

I am new to shapefiles so I maybe ask some stupid questions, sorry. I want to plot a map of my region, with colour filled polygons using R. I have downloaded municipal (lines) and province (polygons) ...
1
vote
1answer
219 views

How to get custom color palette in rasterVis plot3D in R?

I am trying to insert an RColorBrewer palette to visualize an elevation raster in R using the rasterVis function plot3D. The rasterVis reference document shows the following parameters: plot3D(x, ...
6
votes
2answers
847 views

Resources on using R in QGIS for R users?

This is a very basic question, but I'm having a heck of a time figuring it out because so much of the QGIS documentation is oriented toward use of the GUI. I want to be able to run R scripts in QGIS, ...