Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
1answer
19 views

Perform affine transformation on shapefile with OGR, GDAL, or other command line tools?

Transformations with WKT or EPSG code are made easy with ogr2ogr, but are there tools for me to define my own affine transformation to apply to the coordinates of a shapefile? Or, in general, is ...
0
votes
1answer
19 views

Add Polygons to SpatialPolygons via loop / iteration using R?

Just out of interest: I'm creating a SpatialPolygon (R with package "sp") with a number of Polygons within. Is there a way to loop this task? I'm doing it manually as follows. The Polygons consist of ...
2
votes
1answer
33 views

Extracting point information from raster in R

I'd like to work with climate data available from here and extract values of certain locations (for which I have lat and lon). This is what I've done so far: library(SDMTools) library(raster) test ...
1
vote
2answers
47 views

How can I loop through a list to create rasters and write them to .tif files?

I received 3 .mat files that each contain several daily maps. I need to take them and get them into ArcMap (10.2 if that matters) as a .tif with spatial information. I have already used the R.matlab ...
0
votes
0answers
25 views

Rasterize and union problem

i've done the union first and then rasterized it. But now i want instead of that, to rasterize each one and then merge it as one. How do i do that? I mean without the union first off. ...
2
votes
1answer
62 views

How can I parse modis MOD13Q1 quality layers in R?

I'd like to parse MOD13Q1 VI quality layers in R. My original code must have been incorrect, because it gave lots of "deep ocean" flags in the middle of Brazil. After the changes suggested by ...
0
votes
0answers
12 views

Manual install of R-package “xlsReadWrite” on OS X [closed]

I have an R-script that I'd like to use that relies on a slightly older package thats available called "xlsReadWrite." I'd like to install this on my Mac (OS X 10.10.3) However, when I use the usual ...
0
votes
1answer
24 views

Image classification using R [on hold]

I am a newbie in R. I want to classify images using random forest and svm in R. I am trying to learn the codes. But in the mean time, is there a push button (like a gui) in R that can be used for ...
2
votes
2answers
134 views

Classifying DEM according to elevation in R?

r<-raster("DEM.tif") How to do the classification based on every ten meters for example and have different colors too?
0
votes
0answers
49 views

Error in downloading MODIS image using R script

I am trying to download "MOD13A3" MODIS image using R script (http://r-gis.net/?q=ModisDownload) but each time it's ending in error. How to make it work ? ...
0
votes
0answers
20 views

Location allocation optimization using R?

I need to allocated zip codes to offices. Each zip code has certain demand from 0 to 120 clients and each office has certain capacity from 500 to 2500. How do I do this so that: All the zip codes ...
2
votes
1answer
60 views

Difference between raster() and readGDAL()?

I am new in working with rasters and after having trouble working with them i'd like to know the difference between those two import functions. for example i did this library(raster) ...
3
votes
1answer
75 views

Reading and plotting shapefiles with a custom function in R?

I have this piece of code that want to turn into a function r<-readShapeSpatial("roads") b<-readShapeSpatial("buildings") lc<-readShapeSpatial("landcover.shp") here is the preparation ...
1
vote
1answer
26 views

error of randomforest classification with Landsat data

I want perform randomforest classification on Landsat data. Here is some code I found from a paper. But when I run into the "classification" part, there is an error said "Error in eval(expr, ...
1
vote
0answers
38 views

Matching (joining) two slightly incompatible polygon shapefiles

I have two shapefiles that represent two slightly different zonings of the same area (municipality zoning and transport zones), about 3000 polygons each. Several smaller municipalities may form a ...
1
vote
2answers
27 views

Include non-raster object in overlay function in R

I have two raster objects and I would like to calculate values of the first conditional on values in the second. I am currently using the overlay function, but unfortunately I can't seem to pass non ...
2
votes
1answer
52 views

Defining projection using readOGR if the shapefile doesn't have it?

I think that by using readOGR to import a shapefile renders worthless to put proj4string to the script since if any coords are available in the shapefile, it will be transported through the readOGR. ...
1
vote
1answer
56 views

encoding error between maptools and arcgis

I am having a trouble of encoding at writing shape file by maptools (0.8-34) of R by MacOSX and reading that by ArcMAP 10.2.1 in windows 8.1 through parallels desktop. Using an original shape file, I ...
1
vote
0answers
43 views

What is the most user friendly OSM route planning API?

I ran a workshop last week on GIS for Transport Applications. In Nick Bearman's tutorial (available from the previous link) we used Google's routing API (via ggmap) and CycleStreets.net routing ...
0
votes
0answers
44 views

How to set raster projection in R

I am new to R and grib files. library(raster) I have a "grd" file in and I am trying to set the coordinates to polar stereographic projection r <- raster("p190001.grd") # class : ...
2
votes
0answers
33 views

How to create geometric shapes in R? [closed]

I want to plot some geometrical shapes but I dont know what values to put in a vector so they can be plotted. How do you know what numbers should be inserted in a vector so they can create certain ...
0
votes
1answer
35 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
24 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
45 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
42 views

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
49 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
51 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
29 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
47 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
56 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
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 ...
3
votes
3answers
123 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
47 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
37 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
43 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
11 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
vote
2answers
23 views

How to read ArcGIS files in R?

I am new to using spatial data in R. So far the tutorials I have seen consist of using maptools, map, ggplot2 and rgdal to open ".shp" files along with ".csv" files to plot the polygons/ points using ...
0
votes
1answer
93 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
44 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
39 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
69 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
79 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
67 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
33 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
50 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
17 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
68 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
24 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
36 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 ...