Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
2answers
240 views

projection conversion from mercator to google maps format

Is this spTransform(Finland3, CRS("+proj=longlat +ellps=WGS84 +no_defs+ellps=WGS84 +towgs84=0,0,0 ")) the right way to project a shapefile with this projection coord. ref. : +proj=merc +lon_0=0 ...
2
votes
5answers
2k views

Counting road intersections and blocks

I have a shp file that consists of the road system of Mexico City. I would like to count the number of road intersections (crossings) and blocks (which I would define as a segment starting from one ...
0
votes
1answer
22 views

Compare two rasters in R with the cell value from one replacing the cell value from another

I am trying to create a single raster from two rasters. The first raster is made up of all 0 values and the second is made up of the current date value (formatted in days from 001 to 365). The problem ...
0
votes
1answer
15 views

Calculate mean for a each object of SpatialPointsDataFrame

I have a list with several SpatialPointsDataFrame objects, and each object has certain slots. How can I calculate the meann value of a certain slot for every object in the list, and then save that ...
0
votes
1answer
50 views

IDW in R with cross validation

I want to perform IDW interpolation using R, and more specifically, using the idw command from the gstat package. Also, I want to use the optimal number of neighbors (point locations) and distance ...
0
votes
1answer
23 views

GlobCover 2009 dataset - importing legend and colormap values into R

Does anyone know how to import a legend for a raster layer (loaded as a .tif) into R such that it can be attached to the raster file itself and used in plotting? In this case, I am using the GLC2009 ...
0
votes
1answer
29 views

Compare two rasters with raster overlay and replace cell value with variable

I want to compare 2 rasters and when there is a change from 2 to 1 create a new raster that replaces the cell where the change has been detected with the change variable. ## Finds Cells that have ...
6
votes
2answers
1k 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 ...
5
votes
3answers
2k views

Reproduce raster with same extent, and 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 have the same number of columns and rows, as well as the spatial extent of B?
3
votes
0answers
32 views

Why does @data@values slot for RasterLayer only contain logical(0) and not the actual values?

Trying to get to the bottom of why, when I read in a raster of NDVI, the @data@values slot does not contain the actual values until I set them manually. For example: NDVI <- ...
1
vote
1answer
24 views

Trying to limit my shapemap to state boundary lines in R

I have a feeling I'm either trying to do this incorrectly, or I'm just not searching for the correct terms, but I cannot figure out how to do what I want to do. I am trying to plot the ranges of fish ...
2
votes
1answer
89 views

Extracting intersection areas in R

I have two polygons. One contains fields(X,Y,Z) and the other contains soil types (A,B,C,D). I want to know what area of every field contains which type of soil. I tried the following: ...
2
votes
2answers
75 views

Use GRASS through R

I want to use GRASS GIS 7 through R 3.1.3 in kubuntu operational system. Could someone help me connect GRASS with R, and use GRASS commands through R (not the other way round!).
1
vote
2answers
45 views

Aggregate SpatialPoint to form SpatialPolygon

Is it possible to convert SpatialPointDataFrame to SpatialPolygonDataFrame by some kind of generalization or aggregation function in R. how can i form polygons from points of similar color/classified ...
4
votes
1answer
170 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 ...
1
vote
1answer
23 views

Workflow for updating raster using polygons of different attributes

I require a specific output but it is proving difficult for me to work out a workflow. I have: 1) polygons of new housing developments (356, non overlapping) 2) a 25m raster of land cover I want ...
0
votes
2answers
57 views

How to get average values per coordinates in ArcMap/R?

I have a point shapefile. It has multiple points at different spatial locations. Within each point there are multiple values that I want to get the average of. In this case the new file would have one ...
2
votes
1answer
21 views

Last SEXTANTE (Processing) update results in missing RScripts examples

I have installed today the new version of the Processing plugin on QGIS 2.8 (on Windows 7 x64) and I cannot anymore find the RScripts example that were available (and functioning) before the udpate. ...
2
votes
1answer
22 views

Mosaic rasterstacks based on minimum of certain layer?

I am trying to mosaic 42 remote sensing rasterstacks (with 250 bands) based on the criterion that in overlapping areas, the pixel should be taken that has the most nadir viewing angle Beside my ...
1
vote
1answer
164 views

Clump and eliminate classes in a raster in ArcMap or R

after interpolation of sediment classes, I obtained a raster which looks like the image below (sample of the river). I would like to clump and eliminate areas within the raster that are below a ...
1
vote
4answers
85 views

Unable to read raster into R: 'TIFFReadDirectory:Failed to read directory at offset'

I'm getting a weird error when trying to read a raster into R. >r <- raster('myraster.tif') Error in .local(.Object, ...) : TIFFReadDirectory:Failed to read directory at offset 2606110 ...
0
votes
0answers
5 views

Using errorsalm() from spdep with multilevel data?

I have a dataset that has multiple observations per county, and I am interested in estimating the effect of a county-level variable on individual-level outcomes. I would like to account for adjacency ...
0
votes
2answers
77 views

R Spatial Kernel Density Estimation

I am new on spatial kernel density estimation with r and need some suggestions. Saying, I like to estimate the density for some event occurring at a location, for example, the probability of ...
0
votes
1answer
40 views

Switch an R script from “MODIS Reprojection Tool” to “ModisSwathTool”

This R script works with MRT (MODIS Reprojection Tool), and its performance is unbelievable for land data. The only problem is when you use Atmospheric data from Modis, like "MOD05_L2". The problem ...
1
vote
1answer
23 views

How to create a Planer Point Pattern in R using a Shapefile of point features

I have just started to learn spatial analysis of point pattern with R. On page 20 of this book, the "Swedishpines" dataset has been used for inspection purposes. However, I want to use my own dataset ...
3
votes
1answer
55 views

Obtaining sink morphometry from local minima points

I am working on LiDAR data from GIS and R and I want to extract landforms from the DEM. I have found a method to obtain local minima points of my LiDAR data. However, I would like to obtain the ...
12
votes
3answers
3k views

Proper way to rbind SpatialPolygonsDataFrames with identical polygon IDs?

What's the proper R idiom for rbinding SPDFs together when the IDs overlap? Note that here (as is often the case) the IDs are basically meaningless so it's pretty annoying that I can't just make ...
8
votes
2answers
585 views

How to create a solar intensity map for a garden plot?

I'm interested in creating a raster surface that depicts the average solar intensity per unit area for a small garden plot. I imagine the inputs into the model would be the following: Plot ...
0
votes
0answers
35 views

Total area of polygons over latitudes

I'd like to calculate the total area of several polygons along a north-south axis. A bit like this http://www.closr.it/canvas/1307/#/spot There is a similar question with R : Spatial graphing, ...
1
vote
0answers
46 views

Simulate water runoff to get water height over each pixel of DEM

Here is my problem that I am trying to deal with. I have given a height map of around 512X512 resolution(It is Geo-referenced and I have the meta-data for this). And I have given that this area ...
0
votes
1answer
67 views

Convert Eps to geographic distance using DBSCAN

I am using the dbscan cluster (package fpc) in R to find clusters on a set of latitudes/longitudes coordinates. I want to find an eps distance that corresponds to a meaningful geographic distance ...
0
votes
0answers
23 views

how to assign the same centroid to polygons grouped by ID , R

I have a SpatialPolygonDataFrame object from a shapefile of different zip codes in New York state, many zip codes are represented by several polygons( for different reasons) so I want to assign the ...
14
votes
5answers
5k views

Which is the best way of working with PostGIS data in R?

I work with R almost all the time, and now I am using it for doing spatial data mining, but I have this question: I have a PostGIS database with (obviously) GIS data, If I want to make statistical ...
0
votes
0answers
38 views

A faster polygon intersection tool than rgeos gIntersection in R?

I'm looking for a R function able to retrieve the polygon intersecting between two SpatialPolygonsDataFrame. I need to use R and the rgeos::gIntersection() is too slow in comparison with ArcGis...
10
votes
1answer
143 views

Point overplotting on maps in R (e.g. with ggplot2) - how to push points to the side, mark original positions, combine close-by points …?

I've got a database containing languages, their longitudes and latitudes and a feature value (either category 1, category 2 or both - in the plot these are marked red, blue and green respectively). ...
0
votes
0answers
66 views

How to reference a number variable in r.mapcalc within QGIS graphical modeler

I need to run the following formula in r.mapcalc: (xor(abs(A-B),abs(A-C))>120)*A I would like to however use a user defined number input variable instead of the 120. I already have this variable ...
1
vote
2answers
97 views

Reversing “combine” function on raster using R?

I have a raster that I think was "combined" using an ArcGIS function. I am wondering if there is a way to extract just one raster layer from the combined dataset in order to use it separately, using ...
2
votes
1answer
574 views

Inverse distance weighted interpolation for categorical and/or binary datasets

I want to perform an Inverse distance weighted (IDW) interpolation to a series of points. However my data set can be categorical or binary and just like the IDW I want to interpolate the new values ...
1
vote
2answers
258 views

How to resample a raster to higher resolution in QGIS?

I'm fitting a SDM using R. A requirement is that all environmental predictor layers have the same extent, origin and resolution. I have high resolution bathymetry data (25m) that I will resample to ...
1
vote
0answers
17 views

Creating Concentric circles using the ggmap function from GGMAP package R [duplicate]

I would like to create two concentric circles using the ggmap package and ggmap function, one being 1/4 mile and the other 1 mile radius around the 16 metro rail stations in Los Angeles California. It ...
1
vote
0answers
39 views

Effects of heterogeneous vegetation in mapping canopy cover using randomForest in R

I have a 5.8 m resolution satellite image (LISS IV by IRS-P6, in bands 4, 3 and 2) of a densely forested region in the Eastern Himalayas. My objective is to predict regions of canopy cover. Regions of ...
1
vote
1answer
38 views

The stability of randomForest models after increasing predictor variables

With reference to the posts: Incorporating terrain data to predict canopy cover using randomForest in R and Random-Forest Classification of 10cm Imagery for species-distribution in R (no point-shapes) ...
2
votes
1answer
66 views

Incorporating terrain data to predict canopy cover using randomForest in R

This is a subjective question. Thank you bearing with me. I have a 5.8 m resolution satellite image (LISS IV by IRS-P6, in bands 4, 3 and 2) of a densely forested region in the Eastern Himalayas. My ...
1
vote
1answer
50 views

gDistance to determine closest point to polygon: does changing projection change results qualitatively?

I'm using gDistance from the rgeos package for R to find the nearest point to a polygon. The projection of both points and the polygon is +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 ...
0
votes
1answer
60 views

Extracting point data for each lat and long from raster file into a dataframe

I have gridded data files ( see sample -each file consist of monthly precip and is label pYYYYMM) https://www.dropbox.com/sh/63z166tjxyu12s5/AAAs3Ccn1zdVoBYMj8Y1o303a?dl=0. I am trying to extract ...
1
vote
0answers
22 views

Assign Z value to new coordinates based on interpolated response surface in R

I've created a response surface of sorts based on interpolated z values (bottom of post). I'm looking for the most efficient way to assign the respective z value to a new point (actually, a dataset ...
2
votes
2answers
1k views

Variogram model fit compatability among geoR, gstat, and nlme packages in R

I'm trying to specify the covariance structure parameters in a linear mixed model (using the correlation structure facilities in nlme). The parameters are estimated from a gstat or geoR variogram ...
0
votes
0answers
20 views

Creating a for.loop to randomly extract data from a raster stack within shapefile extents

I'm currently comparing a MODIS time series of about 15 years to determine the effects of pasture management practices on the "greeness" of pastures in a water catchment. So far I've been able to ...
2
votes
2answers
37 views

R apply function in turn to each subset of a spatialPolygonsDataFrame

I'm trying to get the area of all the polygons in a SpatialPolygonsDataFrame: parcProj. library("rgeos") gArea(parcProj[2,]) works fine but: apply(parcProj,1,gArea) or ...
1
vote
1answer
363 views

Spplot labels in R how to change

Can anyone tell me how to change the labels in a legend created by spplot in R? It is a typical vertical ribbon legend automatically generated by spplot. Based on color, it is labelled 1-7 but I ...