Tagged Questions

Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
2answers
300 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
131 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 ...
3
votes
1answer
1k 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
62 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
27 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
141 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
152 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
241 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
118 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
117 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
342 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
616 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
138 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
295 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
208 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
158 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
80 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
222 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
111 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
186 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
383 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
270 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
1k 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, ...
0
votes
0answers
148 views

Spatio-temporal prediction with KrigeST in R

I'm new in R and ST kriging, I've constructed a STFDF object with the first 4 hours historical data, and want to forecast the fifth hour data. By using krigeST in R, I've constructed vgm model. But ...
1
vote
1answer
273 views

Buffer analysis - use of surface area based on DEM

I have one problem and this is that I would like to create a buffer around point. This is simple with ArcMap using the buffer tool. But is it possible to create the buffer considering also the true ...
8
votes
2answers
388 views

Simple way to detect/select border polygons of a shapefile

I am looking for a simple way to detect/select border polygons of a shapefile. Border polygons are here polygons that are not completely surrounded by other polygons i.e. polygons located at the ...
0
votes
0answers
26 views

calculating mean and standard deviation for raster values using whole pixels within a polygon [duplicate]

i have a raster image and a corresponding shape file. i would like to calculate the statistics of the values within polygons which have a common attribute but only using pixels which are fully ...
1
vote
2answers
668 views

How to access each raster in a stack with a loop

I have a stack of rasters and I want to access each layer, combine each later with another file and finally export the resulting file as a csv file. Is there any way to do this with a loop? So far I ...
3
votes
0answers
381 views

Fortifying re-projected shapefile for ggplot2 in R

I have a shapefile of US county boundaries which I got from the NHGIS. I can load the file using the rgdal package and see information about it: library(rgdal) shp_1860 <- readOGR("shp", ...
2
votes
1answer
1k views

Is it possible to create and run custom R scripts in QGIS 2.0?

I am new to QGIS and most of the tutorials I have found are for 1.x and the overhaul has me confused. I would like to create R scripts and run them in QGIS. I have read here that it's possible using ...
3
votes
0answers
264 views

R with ggplot2/ggmap - How to load a png image as a map

I am trying to find a workaround for ggmap's missing support of world maps (i.e. you can't create any maps that show latitudes > 80°, due to idiosyncrasies in the mapproj package). To a limited extend ...
0
votes
1answer
491 views

r openproj to plot in open street map in a different projection

I am very new to geographic data, so I am sorry for the stupidity of the question. I need to plot some data that are in this projection EUREF_FIN_TM35FIN Projection: Transverse_Mercator ...
1
vote
3answers
470 views

How to create random point in according polygon for each dataset entry in a list (with R)

I have an area divided into polygons, and a dataset of observations which has a common field with the polygon layer. I now would like to generate a random point for each dataset entry within the ...
0
votes
0answers
149 views

why readOGR() is not reading projection information from .spj - r

0 down vote favorite I successfully import a polygon shapefile with readOGR, however the information in the .prj file is not being imported. test class : SpatialPolygonsDataFrame nfeatures : 19407 ...
5
votes
1answer
272 views

Why does ManageR and rpy2 not work in QGIS (1.8.0-Lisboa)?

I have been trying to get R scripts to function and ManageR to work within QGIS (1.8.0-Lisboa). (Windows 7). Python2.7.5. Two problems indicated that R was not working in QGis. First - when I run an ...
2
votes
2answers
341 views

What is faster for geoprocessing (intersect) big shapefiles?

I have 200 Mb shapefiles of polylines downloaded from OSM. I've been working with QGIS 2.0 in Ubuntu 64 Bit 8 Gb RAM to make some geoprocessing tasks and it's taking 2 days for processing. Once I've ...
2
votes
1answer
348 views

How do I convert longitude & latitude to a 3d (geocentric x,y,z) coordinate?

I'm interested in finding the centroid of a point cloud. I understand that to do this I need to convert latitude and longitude values to 3d coordinates, average them and then convert the resulting ...
5
votes
1answer
1k views

Shortest distance from point to line (big dataset)

What is the best method to calculate the distance from the nearest road for a series of address points in QGIS, having a very big dataset? (QGIS 2.0.1, Win XP) I read the answers to previous similar ...
3
votes
1answer
637 views

Layer map plots on top of one another in R/ggplot2

I'm making a choropleth map in R/ggplot2. I have the colored part working just fine. This code p <- ggplot() + geom_map(data=c_1860, aes(map_id = GISJOIN, fill = AHL002), ...
0
votes
1answer
140 views

How to convert 'RasterBrick' object to 'im' object in R?

During script execution I need to convert 'RasterBrick' to 'im' object. Package 'geostatsp' is supposed to do this job: library(geostatsp) myraster = raster(matrix(1:100,10,10), ...
3
votes
1answer
167 views

Given a Lat and Lon, identify if the point is over land or ocean?

In R, what is the quickest way to identify if a point is over land or ocean? e.g. for: set.seed(0) lat <- runif(10, -80, 80) lon <- runif(10, -180, 180) points <- expand.grid(lat, lon) ...
3
votes
3answers
216 views

programmatically add field to shapefiles and insert shapefile name in every row of field

situation We have a folder containing 1 sub-folder for every participant in a study. The subfolders are named with the participants' ID, e.g., 1000, 1001, 1002, 1003. Every participant folder ...
5
votes
1answer
255 views

Legend of a raster map with categorical data

I would like to plot a raster containing 4 different values (1) with a categorical text legend describing the categories such as 2 but with colour boxes. I've tried using legend such as : legend( ...
4
votes
1answer
248 views

How to join data from NHGIS to make choropleth maps in R/ggplot2?

I have downloaded shapefiles of county/state boundaries and census data keyed to those shapefiles from the NHGIS. Both the shapefiles and the census data have a GISJOIN column to be used for merging ...
3
votes
1answer
336 views

How to link R script to Algotithm output in QGIS modeler?

I constructed a simple R script for QGIS modeler (.rsx) that calculates groupwise summary statistics of a vector layer table (sum by field "subject" and "FRC"). The script correctly works. When ...
1
vote
1answer
316 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 ...
3
votes
1answer
290 views

ggmap, ggimage… - Saving and loading maps in R

In my current R project I'm working with the ggmap package to download and display maps. What bothers me is that you need internet access to load maps from google etc. I'd like to load a map from the ...
3
votes
2answers
163 views

How to do regression analysis out-of-memory on a set of large rasters in R?

I am trying to do a regression analysis on a set of large rasters (254,004,000 cells each). Ultimately, I want to run something like the following (or a bit more complex, but let's start simple!): ...
2
votes
1answer
733 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 ...
0
votes
2answers
130 views

How can I fix a geoTiff with an incorrect CRS?

Trying to load and plot a raster (it's a DEM) in R, but having problems. Using R I read in a raster file: library(raster) dem <- raster("DEM_Victoria.tif") # >70 MB print(dem) class ...