Statistical computing language and software environment.

learn more… | top users | synonyms

3
votes
1answer
124 views

Unsupervised classification with kmeans in R

I have a time series of satellite images (5 bands) and want to classify them by kmeans in R. My script is working fine (loop through my images, convert the images to data.frame, cluster them, and ...
1
vote
1answer
146 views

How to do supervised image classification in saga with the help of R script or Python script

I am using Ubuntu 12.04 and want to do image classification in SAGA. SAGA has numerous classification algorithms which is not present in GRASS and QGIS. I am new to SAGA, but more accustomed to work ...
1
vote
2answers
727 views

Calculate area covered by a particular raster layer within polygons in QGIS

I am trying to extract information on vegetation cover within a set radius of point locations (my sites). I have succeeded in creating a new vector layer of circles with a 5 km radius around my sites. ...
7
votes
2answers
553 views

How do I call external files in Python Geoprocessing Service?

I have created a Python script which calls an R script and then reads the output back into Python. I can run this tool in ArcGIS Desktop (10.2.1) and it works fine. When I publish as a geoprocessing ...
0
votes
1answer
30 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) ...
2
votes
0answers
100 views

Write raster with its attribute table and symbology

I am classifying lots of rasters and I'd like to automate the legend creation and symbology displaying for easy manipulation. Here is the kind of raster I'm dealing with: library(raster) r <- ...
1
vote
1answer
20 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
42 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
27 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
39 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 <- ...
0
votes
1answer
181 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 ...
0
votes
2answers
207 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 ...
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 ...
20
votes
2answers
7k views

How can I convert data in the form of lat, lon, value into a raster file using R?

I have a data set of values over a km grid in the continental U.S. The columns are "latitude", "longitude", and "observation", e.g.: "lat" "lon" "yield" 25.567 -120.347 3.6 25.832 ...
2
votes
0answers
25 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
23 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
36 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
115 views

Package getcartr Installation Problems

I want to build a cartogram by following this tutorial. The first thing I did, I spent the R-R-3.1.1 version 3.1.2 then I did the following: library(devtools); ...
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 ...
0
votes
0answers
35 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 ...
-1
votes
1answer
77 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 ...
1
vote
1answer
168 views

Unable to access R from QGIS 2.4

I have been unable to run R from within QGIS on my computer. I have R version 3.03 installed and QGIS 2.4 on Windows 7. R is located at C:\Program Files\R\R-3.0.3\bin\and this is the path e specified ...
0
votes
3answers
469 views

Unable to run R in QGIS 2.6 - rgdal unavailable for R 3.1

I'm attempting to use R within QGIS2.6 on OSX Mavericks but cannot get R to run because rgdal is not available as binary for R3.1.2 (see QGIS log output from R execution console below). I have ...
2
votes
3answers
2k 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 ...
3
votes
3answers
103 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 ...
1
vote
1answer
77 views

Cross-validation of TPS and kriging outputs from the fields package in R

I am looking for existing package or functions that will allow me to cross-validate multiple outputs of Thin plate spline (TPS) and Kriging from the fields package. Does anyone know of any available ...
2
votes
1answer
35 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
41 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 ...
0
votes
2answers
37 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 ...
9
votes
1answer
648 views

Kriging on GRASS+R - cannot allocate vector of size 146.5 Mb

I'm trying to do a groundwater elevation map with an Ordinary Kriging on R, but always resulting on the lack of memory cannot allocate vector of size 146.5 Mb allocation (windows xp 32bit). ...
7
votes
1answer
240 views

Interpolating points observed with different time duration

I am doing spatial interpolation with a group of points. Some points have complete observation of events: for a period of 24 hours we have observed N events in each point. These points have N ...
1
vote
1answer
104 views

Is there any issue using R scripts with sextante processing framework?

I want to use R scripts from the module Sextante treatment QGIS , but I have many difficulties to configure the module in Sextante . Following the procedure described in the official documentation of ...
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 ...
0
votes
1answer
36 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 ...
2
votes
1answer
68 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 ...
1
vote
1answer
48 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 ...
5
votes
3answers
1k views

Kriging with barriers in R?

I wonder if there is a way to interpolate xyz points in a raster within certain bounds using R? In ArcGIS this is called interpolation with barriers. I wonder if there is something similar in R? I ...
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 ...
2
votes
1answer
157 views

Kriging inside a PostGIS database?

I use a PostGIS database with temperature data. I want to use a spatial interpolation method but not the supported IDW method. I need to use kriging, but it is not part of the supported interpolation ...
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 ...
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
0answers
29 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
21 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
121 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
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 ...
16
votes
5answers
8k views

How to cluster spatial data in R?

I am very new to R, so please bear with me : > I have bunch of data points with latitude and longitude. I want to use R to cluster them based on their distance. I have already taken a look at this ...
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 ...