Statistical computing language and software environment.

learn more… | top users | synonyms

4
votes
1answer
1k views

Clip Spatial object to bounding box in R

Given a Spatial object in R, how do I clip all of its elements to lie within a bounding box? There are two things I'd like to do (ideally I'd know how to do both, but either is an acceptable solution ...
4
votes
0answers
50 views

ArcGis Raster Resampling Question [duplicate]

Possible Duplicate: How do you decide what interpolation method to use for resampling raster data? I want to interpolate a certiain target variable over a large territory. I trained a ...
23
votes
6answers
6k views

Tutorials to handle spatial data in R

Does anyone know some good tutorials to handle spatial data in R? I know that there are some packages like rgdal and maptools but I haven't actually found usefull tutorials to get in touch with the ...
1
vote
1answer
585 views

Produce raster map using universal kriging as interpolation method

I want to do kriging with external drift(universal kriging) in R. The covariate I use is in WGS84 refrence system. Because of nature of kriging which calculates distance in planar surface I have to do ...
4
votes
1answer
139 views

How to stack rasters for ecological analysis?

The attached image shows two different forest openings. Each opening has the following layers associated with it: Point shapefile 1 = A red X which represent a large "legacy" tree in the gap Point ...
2
votes
1answer
2k views

Converting geographic coordinate system in R

I have points in geographic coordinate system and I wanted to convert them to swiss grid (CH1903+). Sample data: id lon lat 2 7.173500 45.86880 3 7.172540 45.86887 4 7.171636 ...
6
votes
1answer
305 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 ...
4
votes
3answers
1k views

Reproduce raster with the same extent, and the same number of columns and rows

I have two raster A and B. A and B have the same grid size but different extent. How can I make A has the same number of columns and rows, as well as the spatial extent of B?
5
votes
2answers
922 views

How to implement bivariate Ripley's K function in ArcGIS 10?

The attached image shows a forest gap with red pine represented as circles and white pine represented as crosses. I am interested in determining if there is a positive or negative association between ...
6
votes
1answer
1k views

use proj4 to specify Robinson projection with R ggmap and ggplot2 packages?

I want to project this map in robinson projection: library(ggmap) world <- map_data("world") ggplot() + geom_path(data = world, aes(long, lat, group = group)) ...
1
vote
1answer
410 views

Intersection between two SpatialPolygonsDataFrame using gIntersection function in R

I want to select a subset of my map (a SpatialPolygonsDataFrame) to create a new vector map = part of the initial map included inside a given polygon (eventually, inside several polygons). I have a ...
2
votes
1answer
692 views

Convert a SpatialPolygonsDataFrame to raster using rasterize function

I'm trying to convert my map (a SpatialPolygonsDataFrame) into a raster, using rasterize function, here is a bug that I don't understand... > class(parcel) # this is my map [1] ...
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 ...
3
votes
2answers
422 views

How to transform coordinates to location in x-y grid in R?

I have a polygon with a 40m diameter and several points that lay inside it. Now I want to reformat the point locations (projected in DHDN/GK-3, but could vary) to x-y coordinates ranging from zero to ...
2
votes
3answers
2k views

How to produce spatial grid from raster?

I need a Spatial Grid as a master grid for diverse thematic maps. How do I produce a Spatial Grid from a raster discarding all NA pixels?
5
votes
2answers
635 views

Spatio-temporal block kriging with R package gstat?

In the documentation of sp I saw that the coords argument of the SpatialPolygons function only accepts 2 columns. Is it not possible to create 3-dimensional polygons? I am doing spatio-temporal ...
3
votes
1answer
3k views

How to calculate polygon centroids in R (for non-contiguous shapes)

I've spent a little while figuring out the answer to this question. It's not immediately obvious from a Google search, so thought it may useful to post the answer on here. There is also an additional ...
12
votes
1answer
3k views

How to create an attractive choropleth map in R?

I've been experimenting with choropleth mapping techniques in R, having reaped the benefits of ggplot2 for creating beautiful graphs within a powerful data analysis package. When it comes to mapping ...
-1
votes
1answer
551 views

Exporting Grid from R to use it in ArcGIS

i want to export a grid from R into format readable by ArcGIS. how can i do so? jones
3
votes
2answers
135 views

Where can I get public transportation route information for USA?

I'm trying to find a list of public transit route information, mainly location of bus and train stops for the US. I've looked around at some of the Google products and openstreetmap but can't find ...
1
vote
1answer
251 views

Function that applies another function to nearest neighbors of a specified location?

I'm sure this is quite basic, but I just couldn't find anything appropriate: I am looking for a function that applies another function to variables of a SpatialPointsDataFrame, but only for locations ...
14
votes
3answers
475 views

How to determine if trees within forest gaps are clustered?

The attached dataset shows approximately 6000 saplings in approximately 50 variable sized forest gaps. I am interested in learning how these saplings are growing within their respective gaps (i.e. ...
5
votes
1answer
343 views

Stats on individual grid points nearest neighbours

First, thank you for this extremely useful and easy-to-access forum! I have shp of points where each point is the centroid of the individual cells of a 1*1km grid (~ 500 000 points). For each of ...
6
votes
1answer
500 views

How to convert an Erdas training set to .csv?

I am working with Erdas Imagine's Signature Editor to perform maximum likelihood classification. I need to use the same training set created in Erdas for other classification using R. Is there a way ...
14
votes
2answers
2k views

Performing Raster Noise Reduction and Edge Smoothing?

I have a raster image like this I want to delete the isolated noise point and smooth the edge (say the white single points, and I want the edges of the entity look smooth). How can I do this in ...
4
votes
3answers
582 views

How to create an intensive map of Russia using QGIS or any other software?

I am trying to create an intensive (heat) map of Russia. I have an excel sheet of 36 Russian regions and their corresponding values. I know that there were similar questions: How to create a map ...
1
vote
1answer
1k views

rpy2 installation ERROR “Tried to guess R's HOME but no R command in the PATH”? [closed]

I tried to install rpy2 (pip install rpy2). I want to use the SDAPP4 extension with QGIS (QGIS shows up the message missing rpy2...). The system tells me always the same error: Tried to guess R's HOME ...
14
votes
2answers
3k views

Using R to calculate the area of multiple polygons on a map that intersect with another overlaid polygon

I have a shapefile downloaded from the Ordnance Survey that gives electoral ward (division) boundaries for a county of the United Kingdom. I have successfully used R to load the shapefile and plotted ...
11
votes
1answer
2k views

How to perform Random Forest land classification?

This is a follow-up to a previous post: Machine Learning Algorithms for Land Classification. It seems that the Random Forest (RF) classification method is gaining much momentum in the remote ...
4
votes
1answer
659 views

book/tutorial on using rpy2 in python for kriging?

I am proficient in Python, but have no knowledge of R. Can you suggest a good tutorial in using rpy2 or any other R library to perform Block/Cokriging "Kriging"
3
votes
1answer
341 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
0answers
241 views

How do I access layer attributes from within QGIS' manageR plugin?

This is probably a fairly basic question, but searches for manageR come up with a lot of noise, and there's no manageR tag. What I'd like to do is load the attributes from a particular field of a ...
1
vote
2answers
561 views

Rename a SpatialPolygon class object in R

I am completely new to GIS but am quite familar with R. I was able to dissolve some zip codes into a larger sales territory. For reference, my previous question is located here. However, because ...
1
vote
3answers
453 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 ...
4
votes
2answers
495 views

What is the cause of 'tearing' of polygons (artifacts) using R, ggplot and geom_polygon?

Thanks to the answer given in this question I have been able to subset and draw a map of electoral divisions in part of the UK, in this case Pembrokeshire. The resulting data frame is large and ...
7
votes
1answer
900 views

How can I use fortify() to create a filtered R data frame from a shape file?

I am in the process of building a ggplot choropleth map of population in administrative areas in Wales. I have downloaded the Boundary-Line data from the Ordnance Survey and extracted what seems to be ...
7
votes
1answer
4k views

How do I change the polygon fill color and border color for SpatialPolygons objects?

I have SpatialPolygons or SpatialPolygonsDataFrames which I'd like to plot. How do I change the color using the three plotting systems in R (base graphics, lattice graphics, and ggplot2)? Example ...
2
votes
2answers
426 views

How to single out country data from a world data map?

Say that i have two "data sources"; A global map of average wind speeds, A shape file (or similar information) of all country borders in the world. How do i combine these two sources and extract ...
4
votes
2answers
388 views

R- alphahull - duplicate points error help

I came across R function -alphahull- and believe it is the best option to turn gps points into a polygon (3 or 4 days worth of gps points across residence/neighborhood for each of 300 subjects). ...
4
votes
1answer
432 views

Iterate features on SpatialPolygonsDataFrame in R

I have a SpatialPolygonsDataFrame object. Is there way to use apply on this object rather than using a for loop to iterate features in this object?
27
votes
2answers
2k views

How can I conduct Geographically Weighted Principal Component Analysis using ArcGIS, Python and SPSS/R?

I am after a description/methodology for conducting a Geographically Weighted Principal Components Analysis (GWPCA). I am happy using Python for any portion of this and I imagine SPSS or R being used ...
4
votes
0answers
335 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 ...
6
votes
2answers
683 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 ...
2
votes
2answers
1k views

[R]Function to calculate mean for missing or NA values in a dataframe

I am trying to develop a function that will calculate a mean lat/long for my missing or zeros location (lat/long) data in my dataset. I have locations for many SETS within the same TRIP, which tends ...
5
votes
3answers
295 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 ...
1
vote
0answers
677 views

Raster grid for zonal statistics in R

I have two raster layer, the first one r is my zonal mask as a raster grid, and I created as: ext <-extent(Yraster) r <- raster(nrows=32,ncols=32,ext) r[] <-(1:ncell(r)) and project it ...
3
votes
1answer
196 views

Extract pixel value for corresponding gps location in R

I have animal gps data with several locations for each day and regular gaps of several days when no location of the animal was recorded. Additionally, I have satellite data in intervals of 16 days. I ...
0
votes
2answers
261 views

Detect whether there is a spatial polygon in a spatial extent

Given a spatial extent (for example cbind(c(0,0),c(10,10)),I want to see whether there is a part of a SpatialPolygons falls in this extent? How can I do this? Thank you very much!
2
votes
2answers
1k views

How to create a map with states by attribute value?

I'm using Qgis, but I am quite familiar with R and python. So I could use any of these. I want a map of mexico but want to color the stats according to a certain variable. It goes from 0 to 100. So ...
2
votes
1answer
832 views

Opening .lyr file via rgdal/OGR

According to this answer I can read in a .lyr file via OGR as long as it was made with ArcGIS version 10. I have such a file (from the ArcGIS Maps & Data page) but I can't quite make R's readOGR ...