Statistical computing language and software environment.

learn more… | top users | synonyms

7
votes
2answers
845 views

Is it possible to run an R script on a layer in QGIS?

I'd like to run an R script on a layer loaded in QGIS (to rotate a set of points created there using the Vector:Research Tools:Regular Points tool). I thought ManageR might work but cannot get it ...
6
votes
3answers
554 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 ...
10
votes
5answers
4k views

How best to fix a non-noded intersection problem in PostGIS?

I'm using a PL/R function and PostGIS to generate voronoi polygons around a set of points. The function that I am using is defined here. When I use this function on a particular dataset I get the ...
9
votes
2answers
1k views

Aggregating points to grid using R

I have a question with regard to spatial aggregation in R. What I am trying to do is aggregate a point dataset to a grid. I am unsure however how to do this as I have little experience with this sort ...
8
votes
3answers
582 views

Identification of consecutive points within a specified buffer

I have a point file, hourly relocations of an animal, and I want to be able to place a buffer around each point and calculate the number of subsequent points which are within the buffer zone. I am ...
8
votes
3answers
2k views

R: Download a large DEM, change projection, and adjust to smaller scale

This is a process that takes just a few seconds in GIS software. My attempt to do it in R uses a large amount of memory then fails. Is there something wrong in my code, or is this just something R ...
7
votes
4answers
5k views

How can I export raster data from Arcmap to an R *.grd file format?

I want to work with raster data in R, but I have problems exporting my raster dataset from ArcMap. By "export data"/GRID I get a file with an *.aux extension. What I need is *.grd. Can anybody help ...
4
votes
1answer
576 views

Self organizing maps and spatially Constrained Clustering in R

There are a few algorithms to perform spatial clustering in R but most of them focus on point pattern analysis (for example here). I would like to perform spatial constrained clustering for polygon ...
4
votes
1answer
3k views

How to plot points on maps using ggplot2 and R?

Thanks for help me in GIS 101 Problem #1, now I have geocoded a few hospital in Connecticut using google map, I have able to visualize them in QGIS, now I am trying to do it in R. ct <- ...
3
votes
1answer
93 views

Spatial Classification

I am not sure what to call my problem. From this image, I have a set of classified polygons (colored). I would like a way to classify the white polygons in the image. I don’t have any attributes to ...
3
votes
1answer
270 views

How do I create a heatmap in ggplot?

I'm using R with ggplot2 to generate maps from shapefiles and from data in SQL Server. I'm trying to get to a stage where I can automate a large chunk of the mapping I do. So far this is working well ...
3
votes
1answer
226 views

How to speed up band math in R 'raster' package?

I have some GeoTiff rasters with over 100 bands in total, but they are not huge: resolution is about 1200x600 and total size is less than 7 mb. I'm trying to do a simple NDVI calculation: raster ...
2
votes
1answer
230 views

Bubble Plots in R not displaying

I was attempting to follow a tutorial to create a bubble plot of school district proficiency rates. Data shapefile of school districts (Census2010.shp) ...
6
votes
2answers
682 views

Convert several SpatialPointsDataFrames to raster

There are 100 SpatialPointsDataFrames in my Workspace. I loaded them on this way: filenames <- list.files(path="", pattern="XYhectareTravelTimes_ez+.*shp") for(i in ...
5
votes
1answer
224 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 ...
5
votes
3answers
294 views

Create Zonal Grid in R

Suppose I have a n*n raster, and I want to create k square blocks (k can be divided exactly by n*n ) for zonal analysis: for example, when n = 4 and k = 4 a 4*4 raster is create with value 1 1 2 2 ...
4
votes
0answers
337 views

Using stat_density2d with coord_map in ggplot2

In my example I am plotting a shapefile for all England & Wales, however I'm interested in the greater London area. If I allow ggplot to simply default and display the entire shapefile then the ...
4
votes
1answer
193 views

How to create cohesive Spatial Pixels from Spatial Points Dataset

I have a Spatial Point DF spo (covering an irregular shaped area of interest). The data are not on a regular grid due to crs transformation. My goal is a raster with predefined resolution and extent ...
4
votes
0answers
334 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
48 views

How to create randomly points within polygons for each row of a dataframe matching a Polygon ID with R

My question is similar to this post, but because there are no "perfect" answer and above all no reproducible example I open this question. I have a "SpatialPolygonsDataFrame" and a data frame. Both ...
3
votes
3answers
339 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 ? ...
3
votes
4answers
2k views

how to overlay a polygon over SpatialPointsDataFrame and preserving the SPDF data?

I have a SpatialPointsDataFrame with some additional data. I would like to extract those points inside a polygon and at the same time, preserve SPDF object and its corresponding data. So far I've ...
3
votes
3answers
1k views

How to extract the US from a North America Shapefile?

I have a north america shapefile, downloaded from ftp://ftp.epa.gov/wed/ecoregions/cec_na/NA_CEC_Eco_Level2.zip How can I get a new shapefile from this showing only us? Is there a way doing this in ...
3
votes
1answer
3k views

Convert a shapefile with northing/easting to ASCII raster with latitude/longitude

Linked below is a polygon shapefile whose projection is NAD83 and whose values are LU/LC codes. Coordinates are meters of northing and easting. I would like to convert it to an ASCII raster with ...
2
votes
1answer
108 views

Wrong projection high quality shapefile for the coastline of Helsinki region (Finland)

I did some spatial interpolations in R and I need a support for those. Looking for shapefiles online the best I could find was and it looks really horrible, the same area in ggplot looks like . I ...
2
votes
1answer
180 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
1k views

joining polygons

I am wondering how to join spatial polygons using R code ? I'm working with census data where certain areas change over time and I wish to join the polygons and the corresponding data and simply ...
2
votes
1answer
2k views

Converting NZMG (or NZTM) to latitude / longitude for use with R map library

I am a statistician with no background in GIS so apologies for the newbie question. We routinely use R for a range of statistical and graphic analysis and are interested in using its map library to ...
1
vote
1answer
287 views

What is the equivalent of arcpy “Con” in QGIS and/or R raster-package?

I'm looking for an equivalent of the conditional expression "Con" from arcpy in an open source spatial analysis package? I'd prefer to use QGIS or R. To provide some additional detail, I need to ...
1
vote
3answers
451 views

Merge Zip Codes to Create new sales Markets

Let me preface this question by saying I am very novice with respect to GIS. With this in mind, I am looking to merge zip codes into sales territories. Instead of plotting data by zip code, I want to ...
0
votes
1answer
375 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 ...
7
votes
1answer
2k views

How to convert point data into a gridded dataframe for histogram analysis?

I am very new at using GIS data and only modestly experienced with R. I've been reading about how to analyze spatial data using the spatial-analyst.net PDF book, so I'm not completely lost, but I ...
7
votes
3answers
960 views

How to cluster points based on a kernel density?

I have a large dataset with 36k points representing commercial land uses, each with a field containing the square footage. I have run a kernel density analysis on this dataset, producing a raster ...
5
votes
1answer
1k views

How to rasterize SpatialPolygons in R?

I'm trying to extract the bathymetry values of my area of interest from a world bathymetry raster layer using the 'rasterize' function in the {sp} package. *Edits: I found the 'extract' function ...
4
votes
1answer
187 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 ...
4
votes
2answers
689 views

How to extract values from a raster according to Lat and long of the values?

having 12 files with 12 hdrs for one year: these files are raster (projected WGS84,lat long):https://echange-fichiers.inra.fr/get?k=rLSyoavrnifGyH5XrlO samples = 1440 lines ...
3
votes
2answers
134 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!): ...
3
votes
1answer
338 views

How to reproject a raster to Winkel Tripel projection?

I'm trying to project a raster map (in ASCII grid format) from longlat to the Winkel Tripel projection. But I'm running into errors, for instance gdalwarp won't accept the proj-string. $ gdalwarp ...
3
votes
2answers
713 views

Clip depth contour with spatial polygon

I need to somehow combine my Spatialpolygons with my depth contour, but not sure how do to so. Maybe create a SpatialPolygonsDataframe? This is what I've done so far: > class(subarea0) #This is ...
2
votes
1answer
728 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 ...
2
votes
2answers
1k views

Setting “R Folder” Path in QGIS Sextante

I have installed R via the R-Project website. I have QGIS installed via OSGEO4W (currently 1.9.0 Master), and have Sextante plugin installed and working with GRASS and SAGA providers. I am now trying ...
2
votes
1answer
376 views

Recreating A Lat/Long Grid Using a Specified Formula

I'm trying to recreate the Gridded Mercury emissions 2000 (0.5 x 0.5 degree grid) designed by the Arctic Monitoring and Assessment Programme. The file is in ASCII format, but without any coordinates. ...
1
vote
2answers
67 views

2 shape files plots together in a GIS, but not in R

I tried plotting these two files and a set of points (dropbox folder) in QGIS and MapInfo. They align pretty good (not perfect though). But in R, only the data from www.naturalearthdata.com can plot ...
1
vote
1answer
73 views

plotting a map of north greenland in R

My knowledge in GIS and R is again tested when I want to map a small part of northern Greenland (called Washington Land) in R (and plot analysis data on top later). I've managed to plot it with ...
1
vote
0answers
101 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: ...
1
vote
3answers
353 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 ...
1
vote
0answers
34 views

How to load or query data directly to R from a PostGIS database using RPostgreSQL and rgdal [duplicate]

Is it possible to load/query a shapefile to R, which is stored in a postgres/postgis database? I've built up a connection to my postgres database via DBI, RPostgreSQL and I want to make some ...
1
vote
2answers
457 views

Plotting large numbers of objects on a chart using R and WKT format

I am retrieving thousands of geometry lines in WKT format from a Microsoft SQL Server database. I would like to plot all of those lines in one map, but I am having some difficulty with the code. How ...
1
vote
1answer
512 views

rpy2 installation on Mac OSX

I'm desperatly trying and retrying to install rpy2 on my Mac OS 10.6 in order to run SDA4PP plugin on QGIS. My version of R is 2.14.0 and it was obviously compiled with the option --enable-R-shlib ...