Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
1answer
10 views

Rasterize gives weird image

ro<-readShapeSpatial("roads") ra<-readShapeSpatial("railways") co<-readShapeSpatial("LIE_adm0") u<-union(union(extent(ro),extent(ra)),extent(co)) rast<-raster(u,res=1) ...
1
vote
1answer
18 views

Shapefile One-to-Many Relationship in R

Is there any way to append a shapefile in a one-to-many relationship with its attributes that R can read? I understand the fix that resides in ArcInfo by creating through MakeQueryTable, but as this ...
1
vote
0answers
36 views

Put output of SAGA algorithm of Processing model in R script

I'm trying to combine the Variogram Cloud model of SAGA with an R script inside a Processing model. First, the R script is: ##Vector processing=group ##showplots ##Layer=table ##X=Field Layer ...
0
votes
0answers
23 views

R: how to get time-zones from latitude and longitude in raster?

I have a raster with longitudes and latitudes for the US with meteorological data (for about 100k grid points). I would like to get the time zone for each point in order to transform the time to local ...
1
vote
0answers
26 views

How to avoid “Unable to compute a transformation between pixel/line”?

I am trying to re-project from Equi-rectangular to the NASA global EASE grid (Equal Area Scalable Earth) grid 1383 586 with a ~25 km cylindrical projection (ESPG=3410). The file is provided as HDF5. ...
3
votes
2answers
46 views

How to compute layer by layer after stack?

I have some rasters that I want to compute the moving average and then rewrite the rasters again. r1 <- r2 <- r3 <- r4 <- r5 <- r6 <- raster(nrows=10, ncols=10); r1 <- ...
2
votes
0answers
23 views

How to re-grid a raster using area-overlap weighted averaging?

I have two rasters r and r2 with different resolutions. I want to re-sample (re-grid) r2 to be the same as r using area-overlap weighted averaging:If an r grid cell is covered by more than 1 ...
0
votes
0answers
21 views

How to add a plot with a different x axis to an existing plot?

I am plotting a raster but I want combine to things in the same plot but in two different axis. library (raster) r <- raster(nrows=10, ncols=10);r <- setValues(r, 1:ncell(r)) extent(r) = ...
1
vote
1answer
35 views

How to compute the number of none NA-values for each row?

I have a matrix(raster) that I am computing the the mean of each row in this raster as: library (raster) r <- raster(nrows=10, ncols=10);r <- setValues(r, 1:ncell(r)) # The x-values will ...
0
votes
1answer
52 views

Using R to combine long/lat data into UK region polygons

I've a CSV file with geoinfo: JobSeekerId LocationId UpdatedDt EndDt Latitude Longitude Country Name JobTitle CompanyName ...
0
votes
0answers
33 views

Transforming GIS based XY data (polygons) so that they overlap in R

So I'm attempting to come up with the average shape of these polygon features as a part of my masters research. To do this, I want to run a shape analysis of GIS-based X-Y data using the shapes ...
3
votes
3answers
98 views

R: How to get latitudes and longitudes from a RasterLayer?

I am an absolute beginner of geographic data, so please, forgive me if the question is not appropriate. I downloaded data from NCDC NARR and managed to load into R using the raster package. I would ...
2
votes
1answer
44 views

How to extract values based on names of rasters?

I have a raster r that contains values for each grid cell (which vary from one cell to another). I have other 24 rasters where the names of the rasters are: the name of r1 is data-00.img, the name ...
2
votes
1answer
31 views

Georeferencing in R Based on the Four Corners

I have a raster image (photograph) that was taken from a helicopter. Along with that raster image, the system also tells me the positions of the four corners of the image in a different file. I have ...
0
votes
2answers
40 views

Count objects in polygons

I have a .txt file containing the coordinate of the two polygons in the picture below as well as coordinates for each of the lines inside the polygons. Could anyone help to count each line inside ...
0
votes
0answers
10 views

DEM and r2stl() distorted models?

If I import a dem file into R and then call as.matrix() on it, I can access z values. I want to create a 3D model, but I'm getting strange results. Most of my dems are spiky and if they are smooth I ...
-1
votes
1answer
75 views

How to turn shapefiles into raster and aggregate them into one raster

For example i tried this but it doesn't work rast_a<-raster(extent(shp_1)) res(rast_a)=100 rsh<-rasterize(shp_1,rast_a) rast_b<-raster(extent(shp_2)) res(rast_b)=100 ...
0
votes
2answers
36 views

Re-sample raster to acre grid using ArcGIS Desktop or R?

I have a 1m classified landcover raster layer that consists of values 1-4 representing various land covers. I need to resample this layer to an acre grid. Each acre in the resultant grid should ...
0
votes
1answer
35 views

plot 3D graph based on raster pixel values

I am new to raster data. I have a raster tif file with population density value in each grid cell. I am interested in plotting a 3D graph based on raster values in ArcGIS or R. The similar graph is ...
1
vote
2answers
60 views

How to convert a spatialpolygon to a SaptialPolygonsDataFrame and add a column to the atrribute table

coast<-readShapeSpatial("coastline.shp") landc<-readShapeSpatial("landcover.shp) ro<-readShapeSpatial("roads.shp") bc<-gBuffer(ro,width=100) landc$ratings=1 ...
2
votes
1answer
63 views

Monthly weather averages using NCEP/NCAR Reanalysis data

I'm a political science grad student and I've recently (and probably foolishly) committed to dipping my feet into GIS. Right now I need to build a table that has monthly precipitation and temperature ...
2
votes
2answers
66 views

A raster map without a legend?

I simply download a map from here http://neo.sci.gsfc.nasa.gov/view.php?datasetId=MCD12C1_T1. this map is a tiff file. mapd <- raster("C:\\MCD12C1_T1_2011-01-01_rgb_1440x720.TIFF") plot(mapd) ...
0
votes
1answer
31 views

DEM files and r2stl()

In R The Volcano dataset has elevation values, but is not a DEM file. How can I convert my DEM files (from earthexplorer.usgs.gov) so that the I can access all the elevation values in a matrix (what ...
1
vote
1answer
44 views

How to create a US map in R with separation between states and clear labels?

I was trying to figure out how to create a map like down below in R on the Stack Exchange but maybe that's the wrong community and the GIS side is a better spot. Currently, I'm able to add the ...
1
vote
1answer
13 views

Iterative Mean of Means Infinite Loop for calculating H-t Index

I'm trying to create a function that will calculate an Ht-Index for Quantifying the Fractal or Scaling Structure of Geographic Features (but am new to R) which basically just finds nested means of ...
1
vote
0answers
28 views

Performing Maximum Likelihood Classification in R

I'm trying to perform maximum likelihood classification of landsat imagery using R, I have been searching for a package that implements it but so far I haven't found it. What is the easiest way to ...
0
votes
0answers
18 views

Choosing R package for discrete choice model?

I am at a loss as to which R package and approach to use for my modeling. The background is: I have a transportation survey dataset combined with many other GIS datasets. I am attempting to ...
1
vote
1answer
35 views

Mapping Disease Incidence in the Northeast in R

I am trying to map disease incidence by county in states in northeastern states in the US. I have the shapefiles for the entire US but I am having a difficult time deleting the states that I do not ...
0
votes
0answers
49 views

Error of memory for vector allocation while kriging [duplicate]

When I run the krige.conv function from the geoR package in R: kc <- krige.conv(as.geo,loc=prd.loc,krige=krige.control(cov.pars=c(0.29,0.79))) it throws me the following error: Error: cannot ...
1
vote
1answer
33 views

legend colour with specific value

i have model plotted in R base<- raster("example.tif") plot(base) image i'd like to change value (0,5,10,15,20,25) breakpoints<-c("0,5,10,15,20,25") plot(base,break=breakpoints) Error in ...
0
votes
0answers
29 views

ArcGIS implementation of an R-script for estimating spatial autocorrelation

How do I implement the following in ArcGIS? rho.from.data <- function(ras){ require(spdep) require(maptools) #-- Generate Spatial Pixels data frame from raster file --# r2r <- as(ras, ...
2
votes
3answers
79 views

Plotting Netcdf data. How to get right projection?

Maybe it's very easy for someone to fix, but I'a a new one in R, so I really need help. I/m trying to plot data containing lat, lon and variable (nmf2). The grid isn't a regular one, so there are some ...
2
votes
1answer
35 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: ...
1
vote
2answers
98 views

Calculate distance between a set of points: lat and long in QGIS or R

I have shapefiles containing the location of several individuals along several months. Positions were documented with a 30 minutes interval. Tables contain the following data fields: collar (ID), ...
0
votes
1answer
30 views

Sampling one shapefile with polygons of another using R?

I have two shapefiles that partially overlap. One (the bigger one) consists of several polygons which represent fields I am interested in. The second, is a rectangular shape that overlaps about 30% of ...
0
votes
1answer
37 views

chi-squared for two rasters in R

I am kind of new with statistics. I have two raster with categorical values and I want to get chi-square. How can I do this using R? Rasters have the same region and same resolution. Is chi-square ...
3
votes
1answer
44 views

CRS not embedded by maptools in R

I'm using the maptools package in R to merge some data to a shapefile. When I open the original input shapefile in QGIS, QGIS automatically picks up on the CRS. When I open the output shapefile from ...
0
votes
1answer
24 views

ggplot2 plots polygons with wrong topologies

I'm trying to plot polygons in R using ggplot2. In GRASS, QGIS and normal R the map renders fine, but ggplot2 seems to have some kind of topological difficultes I can't explain. With normal R it looks ...
2
votes
2answers
80 views

What is the “best” way to automate the GIS slope and aspect algorithm?

I am currently obtaining slope and aspect of roofs using ArcGIS as follows: Mosaic several Lidar .asc files to new raster Extract by mask using Mastermap building outlines to get hold of just the ...
2
votes
1answer
95 views

Overlaying lines and aggregating their values for overlapping segments

I have a number of routes (5 in this example data) stored in a SpatialLinesDataFrame called r. These have different origins but all converge on the same destination (Manchester Airport): Each ...
1
vote
1answer
42 views

Conditional statement, apply different equation based on raster value R

I am trying to find the best way to apply a set of equations to a raster conditional on values in a separate raster. For example, suppose r1 has the values of interest and raster 2 (r2) is a raster ...
0
votes
2answers
28 views

How to compute climatology of 3 days moving averages for rasters pixel by pixel?

I have one year of datasets that I want to compute the climatology of 3-day moving averages and then I subtract this climatology from the original values for each pixel. example: # Set up the ...
0
votes
0answers
48 views

polygon shapefile R extract issues

I'm trying to do simple RF classification in R based on https://gis.stackexchange.com/a/39103/48810. The code I am using is as follows: require(sp) require(rgdal) require(raster) ...
1
vote
0answers
33 views

Optimal distance and power exponent in IDW

I want to apply IDW interpolation for my region of interest, and through leave-one-out cross validation I want to find the optimal values for the distance parameter and the power exponent. I know that ...
5
votes
1answer
111 views

Calculating road density in R using kernel density

I have a large (~70MB) shapefile of roads and want to convert this to a raster with road density in each cell. Ideally I'd like to do this in R along with GDAL command line tools if necessary. My ...
1
vote
0answers
24 views

How to export multiple class training data from ArcGis into R?

I want to perform some machine learning classification of images using R. I'm having issues finding out how to export my training data from ArcGis into R and I'm looking for some help. Currently I do ...
2
votes
2answers
109 views

How calculate pixel by pixel the mode (statistic) of multiple rasters (geotiff)?

I have 12 land cover maps, and I would like to calculate the mode to each pixel of the 12 maps (they have the same resolution and dimension). I mean, the final map would be the mode for each pixel of ...
0
votes
0answers
25 views

How to avoid a problem of one pixel when doing non-linear regression?

I am ruining a non-linear regression using nlsLM from package:minpack.lm for multiple rasters (pixel by pixel). My initial values may be appropriate for some pixels but not for others.When I run the ...
3
votes
3answers
151 views

Assigning RGB values from Geotiff image to LiDAR data, using R

I have given a Geotiff image and its corresponding Lidar data (x,y,z) in UTM coordinates. I need to merge the Lidar data with the RGB values from the image. That means, at the end, I need to plot ...
0
votes
0answers
41 views

Can't import libraries to rsaga

I get this error when I'm trying to import a raster to RSAGA: > rsaga.import.gdal(paste(rast_name, ".tif", sep=""),"RASTER", env= my_env) Module 'GDAL: Import Raster' not found in SAGA library ...