Statistical computing language and software environment.

learn more… | top users | synonyms

3
votes
2answers
321 views

Snapping raster grids in R

I am trying to align two raster grids in R. Once aligned I would like to be able to add them together. I have tried to check whether making a stack would work: grid_snap <- stack(habi_sdw, ...
11
votes
2answers
175 views

How to anonymise a gps file?

Imagine you have a GPS trace that you want to make anonymous, in the legal sense. How would you do this? Is snapping to the nearest x distance and stripping out the time enough? Are there ...
1
vote
1answer
134 views

Save raster to file when using stack() in R

I'm working on a function for raster package. In the end of the function I have to use stack() to create a RasterStack. When I do this the data source is in memory. I want to have the data source on ...
2
votes
1answer
553 views

Plotting map resulted from kriging in R

I want to plot a map weighted by prices. I got a data frame of latitudes, longitudes and prices: > str(data) 'data.frame': 1253 obs. of 3 variables: $ lon : num 11.2 11.1 11 11 11.3 ... $ ...
1
vote
0answers
75 views

Matching vertices in igraph (R)

This is my first question so apologies if it's poorly explained... I'm currently using a combination of ArcMap 10.2 and igraph in R to analyse a network with associated data. I have an igraph ...
1
vote
1answer
68 views

How to get geodetic area? rgeos::gArea doesn't seem to work. Or area-preserving projection

I need to get an area of different polygons at continental scale (like third of Africa etc.). Usual functions like rgeos::gArea work only in the projection units. Is there any function which works ...
1
vote
1answer
78 views

Simple way to plot netCDF variables on Mollweide projection in R

After spending hours Googling I'm still no closer. I'm very keen to find out if there is a very simple way to plot up variables from a netCDF file that are stored in a regular lat-lon grid (-90to90˚N, ...
3
votes
1answer
33 views

Problem with automated data storing during raster::crop (‘legend’ is not a slot in class “RasterStack”)

I am working with a set of raster layers containing CHIRPS monthly rainfall amounts over Africa. For purposes of reproducing the below code, I staged the decompressed tif files on Dropbox. Now, ...
0
votes
1answer
156 views

Is there any packages to download landsat image by shapefile boundary in R or python? [closed]

I want to find a package which can automatically download images within a predefined administration boundary (shapefile format). Does anyone know a package can conduct or simplify the process?
1
vote
0answers
37 views

Can't properly map Lat/Long data on a googlemap

At the very beginning I should mention that I am a novice in spatial data handling. I am in it because I am recently doing a project where certain mining information needed to be embedded on a global ...
4
votes
1answer
184 views

Clip raster by raster with data extraction and resolution change

I need to stack multiple maps (tif) together and clip them all according to extent of one small raster map (second raster at the top of picture below). However, the size of pixels in each map is ...
3
votes
1answer
65 views

Saving results in automap R package for time series data

I'm planning to interpolate monthly rainfall data from 1980 and 2010. I'm using following code: require(gstat) require(sp) require(automap) require(rgdal) require(raster) for(i in ...
0
votes
1answer
212 views

How to remove zonal anisotropy from directional variogram using gstat in R?

I have a dataframe named seoul315 contains the 107 data of PM10 concentration at 1 march,2012,5.00 am. please, download. I have tried to plot semi-variogram for kriging bt the following code: ...
2
votes
1answer
182 views

Difference between intersect {raster} and gIntersection {rgeos} in polygons - R?

I am interested in knowing the difference between tools: intersect {raster} and gIntersection {rgeos}** tools in R. I have several overlapping polygons and I am interested in their overlap, but mostly ...
1
vote
1answer
80 views

Phantom artifacts after converting to Robinson projection

I'm using ggplot to create a map using the Robinson projection. Ultimately, I'll be plotting individual countries, but I need to provide continent boundaries as a background layer (since some ...
3
votes
2answers
203 views

What percentage of polygon x is in raster pixel y, efficiently

I feel this is a competition worthy problem, due to its size. I would like to weight a set of raster pixels to the attributes of a set of polygons. To do this I need to know the proportion of each ...
0
votes
2answers
129 views

Exporting Matrix from ArcGIS (so readable in R)

I would like to eventually create a shape file in ArcGIS and then extract it as a matrix to be read by a spatial package I use in R. By matrix I actually mean a Raster file. My first step is to ...
0
votes
2answers
337 views

Really slow extraction from raster even after using crop?

I have a large raster file (245295396) cells and stacks of rasters having 4 layers each which lie in the extent of this large raster. To start with I am trying to get value from one stack (3 channels) ...
3
votes
1answer
158 views

Loop to check multiple polygons overlap in r

I have a set of polygons (available here: http://ulozto.cz/x39ELbFt/polygons-zip) created in QGis and processed in R. I would like to know if they are overlapping or not, and if yes, where is the ...
2
votes
2answers
189 views

Is there a way to get undistorted maps in R (when using the OpenStreetMap package)?

When I download a large map within R (using the OpenStreetMap package) and I reproject the map (ideally to +proj=longlat), the map will always turn out distorted, making country labels etc. near the ...
2
votes
0answers
69 views

Efficiently calculate distance between raster patch edges

I have a binary raster which I've classified into patches using raster::clump. I now want to efficiently calculate the edge-to-edge, i.e. minimum, pairwise distance between patches. I am currently ...
1
vote
0answers
122 views

unsupervised classification in qgis (Orfeo toolbox)

I want to run an unsupervised classification of two landsat images in qgis. Therefor I want to compute a kMeans and a SOM (self organizing maps classification). Unfortunately it doesnt work. I tried ...
0
votes
0answers
54 views

how to define threshold value in r.stream.extract

I want to generate streams using r.stream.extract. on what basis we have to define the threshold value. I am using aster dem with 30m posting.Also i want to know the minimum stream length to be ...
1
vote
1answer
323 views

How do I convert WGS84 to Lat, Long to Google Maps in R?

I have this coordinate which I believe it's in WGS84 format x=1005740.867110, y=243957.356623 I want to plot that in Google Maps which I need to convert that to Lon, Lat. I've found this script ...
1
vote
1answer
223 views

R filter shapefiles with dplyr

How to filter shapefiles data in R with dplyr and then put it in a leaflet map? not reproducible example sorry: library(dplyr) library(leaflet) library(sp) library(maptools) library(rgdal) ...
1
vote
1answer
44 views

Spatial representation of Data

I'm a new users of spatial analyses packages in R. I have created a SpatialPolygonsDataFrame which contains a number of rectangular polygons that i named "Square1" to "Square64". Until now there is no ...
4
votes
2answers
71 views

how to create geo-referenced random data?

I'm writing a dissertation on different parameter settings in GWR . In order to perform tests I'd need the availability of geo-referenced data that show some sort of spiatial correlation (i.e. values ...
1
vote
0answers
158 views

Performing Theil-Sen regression on raster data by R software

I have seven NDVI raster layers (in ERDAS img format) of an area. Each NDVI layer is the peak growing time of that year. I want to do trend analysis of NDVI values change over the years pixel by ...
1
vote
1answer
212 views

Overlaying grids with a polygon to determine the average value of the overlapping grids for that polygon

I would like to add the average, minimum and maximum value of, let’s say soil moisture (variable "value" in my case), to each NUTS3 region (= a NUTS3 region is a polygon of a certain small area in ...
0
votes
0answers
44 views

Spatial segregation from a raster of racial distribution in the USA

I am trying to measure the degree of racial segregation at some geographic level (let's say the county level, for simplicity) in the USA. I have a shapefile with these geographic units. To do so, ...
3
votes
2answers
71 views

Add information from a cvs/text file to a raster shapefile based on latitude and longitude information

I have an empty raster shapefile that only contains the latitude and the longitude of the centroids of each grid. I now want to add an extra variable to each grid cell coming from a cvs or txt file. ...
2
votes
1answer
122 views

How can I conduct dimension reduction using Geographically Weighted Principal Component Analysis?

I want to know how to compute the importance of components for geographically-weighted-principal-component-analysis(gwpca)? That is, I want to reduce dimension according to cumulative proportion of ...
1
vote
0answers
79 views

Unable to load Postgresql spatial data in R (with rgdal)

I'm trying to load spatial data from a postgresql database in R, using functions from the package rgdal, but I'm having trouble getting the functions to work. For example, when trying to read a ...
2
votes
1answer
234 views

ggmap: clip a map

I'm using ggmap to grab Washington DC and I have a shapefile that I downloaded from here: library(ggplot2) library(ggmap) library(maptools) dc = get_map(location = 'DC', zoom = 12) nhbds = ...
2
votes
2answers
368 views

Merge multiple SpatialPolygonDataFrame into 1 SPDF in R (analogue to “Merge” Tool in ArcGIS)

I have created 2 polygons in QGIS. Using them in R, polygons become automatically SpatialPolygonsDataFrame (SPDF). I would like to merge them into single SPDF (as is super easy in ArcGis using Tool ...
0
votes
1answer
75 views

How to do union that results to a SpatialPolygonDataFrame in R?

I have the following code coastline<-readOGR(dsn=".",layer="shp") wetlands<-readOGR(dsn=".",layer="shp") wetb<-gBuffer(wetlands,width=500,byid=T) ...
1
vote
1answer
96 views

Transforming coordinate in the Swiss reference system LV95 into LatLong/WGS84

I would like to transform coordinates expressed in the Swiss reference system LV95 into LatLong/WGS84. On the website of the Swiss topography centre, there is an application to do so, however ...
2
votes
1answer
327 views

Find intersections between spatial lines and points using R

This question assumes that I'm using R with the sp and rgdal packages installed. Now that I have a set of spatial segments of class SpatialLinesDataFrame (called 'segmentData') and a set of spatial ...
0
votes
1answer
71 views

Extracting Data from Raster based on Aspect Raster file

I have 2 rasters, ones shows aspect and another shows date of snow thaw. I want to extract the date of snow melt based on values from the aspect raster. For example I want all the snow thaw dates from ...
4
votes
1answer
235 views

Difference between gdalwarp and projectRaster

I am trying to project a Raster. In R there is the projectRaster() function to to this (below a fully reproducibly example) : # example Raster require(raster) r <- raster(xmn=-110, xmx=-90, ...
1
vote
1answer
187 views

Big performance difference reading shapefiles between QGIS and R

I'm trying to read the belgian landuse ESRI shapefile from geofabrik.de: http://download.geofabrik.de/europe/belgium.html In QGIS it's just a matter of seconds, but in R using the readOGR function ...
1
vote
1answer
78 views

Merge a table with a shapefile (not the same dimension)

I am trying to merge a table with a shape file using R. The shapefile's database is bigger than the table and I need to have null or zero values where the two data sets don't match. Table data no. ...
2
votes
1answer
927 views

How is R used with ArcGIS for Desktop? [duplicate]

How is R used with ArcGIS for Desktop? I have seen posts talking about combining rasters while using R. I have not had much experience with R so not 100% certain of its capabilities. I had ...
0
votes
1answer
121 views

iterate over spatial polygon data frame in R

I am trying to iterate over the rows of a spatial polygon data frame in R, but cannot figure out the right indexing. I don't want to select by attributes, but rather just iterate over the spatial ...
2
votes
1answer
163 views

How to find the coordinates of the intersection points between two SpatialLines objects (or SpatialLines and SpatialPolygon edges)

I am try to find the co-ordinates of points where SpatialLines cross the edge of a SpatialPolygon. I have searched and searched, but can only find results such as over which tell me which lines cross ...
4
votes
1answer
139 views

Grid vs. Polygon Overlay in R gives different results than in QGIS

I have a shapefile of range polygons. Each colored set of polygons represents a different group of species/genera/whatever. I next overlay a 5x5 grid onto this map. And then use join attributes by ...
4
votes
1answer
199 views

Generate grid shapefile in R

I have the following shapefile of a 10x10 degree latitude/longitude grid that I created in QGIS. I can read it into R using the rgdal package. Grid<-readOGR(".","GridShapeFile") It has the ...
-1
votes
1answer
467 views

How to reclassify a raster in R?

wet<-readOGR(dsn=".",layer="shp") #wetlands r.raster <- raster() extent(r.raster) <- extent(wet) res(r.raster) <- 100 wet.r <- rasterize(wet,r.raster) #rasterize plot(wet.r) ...
2
votes
1answer
343 views

Changing the extent of a Shape file in ArcMap for distrubution modelling in R

I am currently trying to create a species distribution model in R using maxent. The shape file I have is a map of an island. When viewed in ArcMap it has a set extent--in Lat and Long. I can ...
4
votes
1answer
79 views

How to find the distance from a point to a polygon, via another point, in R

I am trying to calculate the distances between a central point, and the edge of a polygon, along straight lines drawn between the central point and another set of points (where necessary extended ...