Statistical computing language and software environment.

learn more… | top users | synonyms

4
votes
1answer
2k 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
203 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
175 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
173 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) ...
8
votes
5answers
3k 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 ...
6
votes
2answers
553 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
161 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
264 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
232 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
172 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
291 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
4answers
1k 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
759 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 ...
0
votes
1answer
241 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
3answers
913 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
4answers
3k views

Dissolve ploygons in QGIS or Grass to new polygons of defined population sizes

I have a shapefile with 3800 polygons representing the smallest administrative areas in Ireland. Many of these, in rural areas, have tiny populations, under 100 people. In urban areas, all would have ...
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
126 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
565 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
653 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
399 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
831 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
347 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
0answers
81 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
0answers
32 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
370 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
3answers
389 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 ...
1
vote
1answer
481 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 ...