Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
3answers
205 views

Import shapefiles on my postgis table using R

Using R, I would like to import shapefiles that are in a directory on a geometric table i have on postgresql / postgis. What is the instruction that allows me to do it? EDIT: here is my code to ...
2
votes
2answers
210 views

MODIS Level 1B batch process

I am a new MODIS Level 1B user. I have been using the MODIS Swath tool to process my images. However, I have over 1000 images to process. I was wondering if there a script available in IDL or R (very ...
2
votes
0answers
62 views

Using R to subtract the polygon area of one shp file from another

I'm looking to produce a map from two separate maps in R. My Maps files are as follows: ftp://ftp.cpc.ncep.noaa.gov/GIS/us_tempprcpfcst/610prcp_20140822.zip #Map1 ...
0
votes
1answer
48 views

going from hillshade to percent shaded (gdaldem)

I assumed hillshades output percent shaded (scaled to 255) at the given azimuth and altitude but this is incorrect. A flat raster at 80 degrees altitude has a maximum value of 251 instead of 255. How ...
1
vote
2answers
92 views

How to produce “SpatialPixelsDataFrame” from stacked RasterLayer?

How to produce "SpatialPixelsDataFrame" from staccked RasterLayer ? I have a stacked rasterlayer and I want to convert them to SpatialPixelsDataFrame. RasterLayer information is > RAD.all[[1]] ...
1
vote
1answer
145 views

create the postGIS table error No such driver: PostgreSQL

I'm trying to create the postGIS table with spatial features I can do it by: library(RPostgreSQL) library(spacetime) library(rgdal) dbname = "geodatabase" user = "postgres" password = "***" #password ...
1
vote
1answer
192 views

Step-by-step: How do I extract Raster values from Polygon overlay with Q-GIS or R?

I am writing my master thesis at the moment and am having the exact same problem as user Curley in this question: I first need to overlay a Corine 2006 raster with a polygon layer (2638 polygons). ...
0
votes
2answers
109 views

R -plot 12 images per plot or save 12 images per image file in R

Here is R script and my question is How can I plot 12 images per plot or save 12 images per image file because I have total 864 images. RAD1998 <- raster(paste(getwd(), "/1998bil ...
2
votes
1answer
110 views

Levelplot(RasterVis) two marginal plot scale?

How can I add/display scale to two marginal plot? RAD1998.all <- stack(list.ras) list.files <- mixedsort(list.files(paste(getwd(), "/1998bil/", sep = ""), full.names = F, pattern = ...
3
votes
2answers
112 views

How are kappa and overall accuracy related with respect to thematic raster data?

I recently calculated kappa (using confusionMatrix{caret} in R) between a thematic raster dataset at 1m spatial resolution and another at 30m spatial resolution. I was interested in quantifying the ...
2
votes
1answer
64 views

How to assign CRS to RasterLayer in R

I have a layer with coord. ref. : NA. How can I assign coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 to coord. ref. : NA? class : RasterLayer dimensions : ...
7
votes
3answers
233 views

How to compare spatial patterns (crime cases vs population)?

I am looking for a way to statistically compare two spatial patterns in shape polygon data (not point pattern analysis). Let's say I have a city map divided in neighborhoods (barrios), in shape ...
2
votes
1answer
31 views

How to read ASTER metadata in IDL?

I'm trying to read many ASTER images (1B mainly) in IDL (I can try in R also). I'm used to work with Landsat, but the aster metadata is complicated. I write a code with a lots of conditional that can ...
4
votes
0answers
63 views

Classical or robust variogram for incorporation into generalized linear model

I'm modeling counts of organisms over time at eleven locations. I'd like to account for temporal autocorrelation in the counts, assuming it's present. As the data are not equally spaced in time, ...
11
votes
1answer
2k views

How to perform Random Forest land classification?

This is a follow-up to a previous post: Machine Learning Algorithms for Land Classification. It seems that the Random Forest (RF) classification method is gaining much momentum in the remote ...
3
votes
1answer
97 views

Max cell value from a stacked raster

How can I find a max cell value from a stacked raster. Rmax <- maxValue(RAD1998.all[[1]]) works fine but Rmax <- maxValue(RAD1998.all[[2]]) gives NA. Of course not in a stacked raster. ...
3
votes
1answer
77 views

How to overlay a county boundary on a raster file?

I want to overlay California county boundary top of raster layer. Here is is my code: data(coastsCoarse) data(countriesLow) library(gtools) library(maps) library(maptools) library(sp) # Raster ...
3
votes
2answers
235 views

How to automatically draw lines with a given angle from one single point in qgis 1.8?

I'm new to qgis so please be patient. I need to draw a bundle of lines all originating from the same point and with a 10° angle between each line (e.g. lines bearing at 0,10,20 ..90..110..220..350). I ...
3
votes
1answer
476 views

How to cluster Raster data

I have thousands of Raster data concerning the ice coverage at the pole at different times (days) over several years. Now I would like to perform a cluster analysis. I want to split the data into ...
0
votes
1answer
92 views

Cannot properly import MODIS MOD07_L2 .hdf files into R using rgdal

I've been trying to accurately import and process some .hdf files from the MODIS Atmospheric Profile product (MOD07_L2) in R for several days now. Still, there's something going wrong during data ...
1
vote
1answer
91 views

Counts the number of points in a polygon in R

I have two classes sharing the same CRS (Latitute and Longitude): bolognaQuartieriMap: a SpatialPolygonDataFrame containing data of a city boroughts. crashPoints: a SpatialPointsDataFrame containing ...
1
vote
2answers
403 views

What is the equivalent of arcpy “Con” in QGIS and/or R raster-package?

I'm looking for an equivalent of the conditional expression "Con" from arcpy in an open source spatial analysis package. I'd prefer to use QGIS or R. To provide some additional detail, I need to ...
0
votes
1answer
59 views

levelplot index issue

levelplot with static index works fine but not in a for loop. What's wrong with my code? Static index: png(paste("1998",outlist[[1]],".png",sep="")) levelplot(RAD1998.all[[1:4]]) dev.off() ...
2
votes
1answer
76 views

Are there examples of high-level interfaces to NetCDF

The R raster package and GDAL both have independent wrappers around NetCDF-4* that treat an array variable as a "complete" dataset, i.e. they provide objects or interfaces that seamlessly give access ...
1
vote
0answers
50 views

Monte Carlo test of Space-Time clustering in R

I have several point patterns representing the distribution of territories of a bird species. Each point pattern represents the distribution of one year. I already succeeded in computing Ripley's L ...
7
votes
3answers
595 views

Making county-level shapefile from set of points at 30 x30 km spacing using ArcGIS for Desktop?

I have a data set in csv form, like: latitude, longitude, value -45, 45, 10 .... I would like to calculate county level means from these data, using either ArcGIS or R+grass. I have the ArcGIS USA ...
2
votes
0answers
266 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 ...
2
votes
1answer
219 views

NDVI time series in R — how do I create a time series object from a data frame?

I am doing a time series analysis of NDVI using the bfast package in R. Bfast requires a time series (TS) object. I have successfully created a data frame with the NDVI at various point locations ...
2
votes
1answer
140 views

How to remove columns in a spatial polygon data frame in R?

My spatial polygon data frame (spdf) contains too many columns (variables) and I want to remove most of the columns entirely. I know how to do this with a regular data frame in R, but I am unsure how ...
4
votes
1answer
213 views

How to 'reverse clip' (erase) in R

A reverse clip saves only the part of your spatial object that is outside the bounds of another object, as opposed to a regular clip which saves the parts that are inside the other object. Here's how ...
6
votes
2answers
1k views

Clip Spatial object to bounding box in R

Given a Spatial object in R, how do I clip all of its elements to lie within a bounding box? There are two things I'd like to do (ideally I'd know how to do both, but either is an acceptable solution ...
3
votes
0answers
63 views

Multispectral image segmentation for natural-resources applications using R

R has the capacity for image segmentation, although all of the examples I have come across utilize a single band for the segmentation (example). I am interested in combining R's capacity for random ...
1
vote
0answers
67 views

spatialpolygons heatmap in R - NAs in grey?

I have a spatial polygon data-frame and I am trying to plot a heatmap via spplot. It's a map of Europe and the values for the heatmap are in a column of the data-frame. Plotting it works fine but I ...
1
vote
0answers
54 views

Not able to bulk download MODIS images

I am trying to download Modis NDVI and EVI images. I have used the following R-code: setwd("/home/karthik/Valmiki/Modis_bands/") library(raster) library(RCurl) ...
2
votes
2answers
118 views

How to determine in which grid cell each coordinate of an x,y series is located?

I have a circular arena which I have divided into a number of equal-sized 'cells' using a grid-like arrangement of concentric circles and line segments (in grey below) and also a series of x,y ...
1
vote
1answer
99 views

Automating Intersect between two polygon layers

I have a spreadsheet that has county-level occurrences of around 1000 species within the US in the column headings (Species State County). Thus, for some counties there may be multiple species. I ...
5
votes
1answer
372 views

R raster Package Moran's I interpretation

I am using raster package to calculate the local Moran's I . The example gives the range of Moran's I between - 1 to 2.47. On my own data I have see the value range -3.070423 - 7.228558 How can ...
0
votes
1answer
101 views

Test for spatial randomness with Ripley's K or L function in R

I have a spatial point pattern that I would like to test against complete spatial randomness. I managed to plot a Ripley's K function for my data and a function for a random distribution with a ...
0
votes
1answer
115 views

Reproject MODIS level 3 chlorophyll data using gdal

I am trying to reproject MODIS Level 3 chlorophyll data (for instance, this file) using gdal in R. I used gdal_translate and gdalwarp functions. There was no crs information associated with ...
1
vote
0answers
86 views

What's the difference in these two shp files?

I'm trying to plot points on these maps in R, with points from "Coordinates" in the same folder. The WL.shp plots fine with the data, but the NG.shp (which should only be larger and of the same area ...
6
votes
2answers
2k views

Resources on using R in QGIS for R users?

This is a very basic question, but I'm having a heck of a time figuring it out because so much of the QGIS documentation is oriented toward use of the GUI. I want to be able to run R scripts in QGIS, ...
6
votes
1answer
112 views

Competing approaches to line & polygon simplification

There seems to be a few theoretical options around at the moment for geometric simplification. Douglas–Peucker seems the most established, followed by Visvalingam's approach (used by d3.js). Now ...
-3
votes
3answers
1k views

How to add a field to a shapefile using R

This question is trying to make sense of a post that already exists that looks good, but is failing in practice. The second ranked answer uses the foreign package to read a shapefile attribute table ...
0
votes
0answers
37 views

Neighbours list extracted out of polygon regions

I've got a SQL database which contains some coded polygon structures. Those can be extracted as follows poly <- data.frame(sqldf("SELECT ST_astext(geometry) FROM table")) The data.frame 'poly' ...
2
votes
1answer
225 views

Splitting strings into new rows, retaining geometry

UPDATED BELOW I have 9 shapefiles, each shapefile has 700,000+ rows and I have roughly 12 attribute fields in each shapefile. There are three attribute fields, common to every shapefile, that I am ...
1
vote
1answer
113 views

R giving error when attempting map algebra

I'm trying to manipulate some downloaded rasters using R, and keep getting the same error when I try to do any type of map algebra. The example below uses a raster file downloaded from ...
3
votes
1answer
83 views

How to create randomly points within polygons for each row of a dataframe matching a Polygon ID with R

My question is similar to this post, but because there are no "perfect" answer and above all no reproducible example I open this question. I have a "SpatialPolygonsDataFrame" and a data frame. Both ...
2
votes
0answers
122 views

Doubts with Ripley's K function Interpretation

I'm a self-taught person, I'm studying the K Ripley's function and I would need some person who give me some advices. First, I have written a little script of R in QGIS processor: ##Point pattern ...
1
vote
3answers
485 views

How to create random point in according polygon for each dataset entry in a list (with R)

I have an area divided into polygons, and a dataset of observations which has a common field with the polygon layer. I now would like to generate a random point for each dataset entry within the ...
1
vote
2answers
598 views

Processing HDF4 data in R

I am trying to process MODIS files in R, which are in HDF4 format (link to data). I have experience reading in HDF5 and netCDF files in R, but HDF4 seems to be a common problem in R. I am using a MAC ...