Statistical computing language and software environment.

learn more… | top users | synonyms

3
votes
1answer
91 views

Define cellsize from spsample in meters

I use a shape file to create a regular grid using spsample, from sp package. Two problems here: (1) I would like to define the size of my grid cells in meters, but I've checked the documentation of ...
0
votes
0answers
63 views

Union overlapping shapefiles (poylgons) and merge the attributes where overlap occurs in R

I have 30 shapefiles of overlapping polygons and would like to union them into one shapefile. The attribute table of the 30 layers is exactly the same (two columns, Type and Origin). A new polygon ...
1
vote
1answer
217 views

Using Loop for calculating NDVI

I am using MOD09Q1 now and I would like to calculating NDVI whole year data. One year, I have 46 band 1 images and 46 band 2 images. list.files I creating list of band 1 and list of band 2. ...
1
vote
0answers
58 views

R raster stack 4 dimensions

I am trying to create a raster stack / brick from a list of ncdf files with the dimensions 160x160x24x1). r = stack(files) This gives me a raster stack but without the 4th dimensions which is ...
0
votes
1answer
744 views

R solution for 'TopologyException: Input geom 1 is invalid' self-intersection error?

The 'TopologyException: Input geom 1 is invalid' self-intersection error which arises from invalid polygon geometries has been widely discussed. However, I haven't found a convenient solution on the ...
1
vote
0answers
137 views

Can you check if a gps coordinate is inside a gps polygon in R?

I'm trying to determine if a specific gps coordinate is within a gps spatial polygon. My gps coordinate is being outputted from the geocode function from the ggmap library and the spatial polygons ...
2
votes
2answers
811 views

How do you geocode addresses in R? [duplicate]

I'm wondering how to geocode addresses in R Studio ? Is there a link to Google Developers API ?
3
votes
1answer
99 views

Find which latitude and longitude values are falling in which raster cells

I am an absolute beginner in analyzing geographic data with R. I have a database with longitude and latitude of around a million buildings in a country. I would like to find the average density of ...
4
votes
2answers
546 views

Randomly sampling points in R with minimum distance constraint

I'm trying to randomly select a number of points within my data frame (example data below) with a constraint that the minimum distance between the selected point must be greater than a certain ...
4
votes
1answer
197 views

How do I create a SpatialLinesDataFrame from a dataframe?

I have created a data.frame in R . I want to get SpatialLinesDataFrame as a result so I understand that I have to convert the data.frame into lines, the lines into SpatialLines and the SpatialLines ...
0
votes
1answer
83 views

How to extracting values of 40 plots from different bands of raster image in R?

I have 40 plots(samples) and I want to extract corresponding values from different bands of RapidEye image. So at the end I want to have totally 200 values of 5 bands in the format of txt. Till now I ...
1
vote
1answer
40 views

The shape does not fit the ggmap

I try to fit my shape to the google map. require(rgdal) in.dir <- getwd() sh <- readOGR(in.dir, layer = "Ytor", p4s = "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 ...
2
votes
1answer
922 views

Why is my stacked area graph in ggplot2 returned as stacked lines? [closed]

im having a bit of a problem creating my stacked area chart in ggplot2 in R, for some reason it is returning as a stacked line; eg data: library(ggplot2) Sector <- ...
2
votes
2answers
196 views

Selecting features within polygon from another layer using R or Python?

For Selecting features within polygon from another layer using QGIS? the solution was to: use the "Vector->Research tools->Select by Location" However, I would like to know how to do the same ...
1
vote
1answer
42 views

Unexpected Isopleth Output From GME

I converted a csv file to projected SpatialPointsDataFrame in R, input it to bkde2D, converted the result to raster, saved the raster to a TIFF, and input that raster into the GME Isopleth tool. Here ...
0
votes
0answers
35 views

Interpolate Points with GAM-Model

I'm trying to interpolate some point-data to a raster-map. Until now i used kriging to interpolate the point-data to the surface. now i have to use a generalized additive model for that task. my ...
0
votes
0answers
101 views

Adding additional data to R maps - package data

Is there a way to add data to additional_data result set obtained from below line of code from R maps package? additional_data <- map('county', 'iowa', fill = TRUE, col = palette()) Above ...
0
votes
1answer
66 views

How can i plot this piece of code with ggplot2? [closed]

I have these vectors of the lakes in New Guinea and the coastline and i want to plot it using ggplot2 exactly as it follows but with a more cool appearance. co<-coastline.shp ...
1
vote
0answers
78 views

Delineate watershed using manual points in RSAGA

I'm currently trying for an automated solution to delineate watersheds within a large basin. I have a collection of locations (X,Y coords) for various tributaries reaching a larger river, and the ...
2
votes
0answers
72 views

How to visualise change matrices over time

i've hit a bit of a tricky visualisation issue; I am quantifying some land use and land use change (LULUC) over a number of years. Typically, for data going from year to the next, a land change ...
1
vote
0answers
66 views

Creating grid from spatio temporal point data? [closed]

I have a spatio-temporal point data of species sighting with monthly observation for random locations within my study area. I wish to create a grid(fishnet) for each month for each year. Also, certain ...
2
votes
3answers
504 views

How to export a dataset with “SpatialPolygonsDataFrame” as a shapefile

How to export spatial datasets in R, such as tornados dataset in GISTools package, as a shapefile with the exact same spatial reference and the exact values? library(GISTools) data(tornados) ...
3
votes
0answers
96 views

Interpreting Global Moran's I and should I krig?

I am trying to weigh up if kriging (or cokriging) the residual error from my model is a valid approach. My first step was to compute whether the error is spatially autocorrelated. I have done this ...
2
votes
1answer
169 views

R-bridge minimum requirement

The new R-bridge, unveiled at uc2015, has a dependency on ArcGIS 10.3.1. Has anybody tested it with older version of ArcGIS Desktop? I need to know why it depends on 10.3.1. I need to run it on ...
0
votes
1answer
78 views

Creating polygonal windows for spatial analysis in r

I am attempting to normalize a spatial point pattern using a population density raster in r. My problem is that the function I am trying to run is recognizing the "white space" around the raster I am ...
1
vote
1answer
104 views

Programs/ languages to process netcdf files “fast”

I am using R to loop through thousands of NetCDF files (downscaled climate data), and while I am able to do it using R, the code is too slow. I am looking for a way to speed it up and to maintain ...
2
votes
2answers
80 views

How can I use a DBF layer in an R script in QGIS?

How can I use a DBF layer in an R script in QGIS? For example, I can input a vector by using ##Layer=vector, and a CSV table with ##Table=table, but it will fail if the table is based on a DBF file. ...
0
votes
0answers
62 views

Error with gwr.mixed function in GWmodel r package

I applied the gwr.basic and gwr.mixed on the same SDF file using the codes below. I got an error message on gwr.mixed: Error in SpatialPolygonsDataFrame(Sr = polygons, data = mgwr.df) : row.names ...
0
votes
0answers
39 views

reproject satellite orbit values from irregular grid to regular grid

I have a ncdf file containing measurements covering a satellite orbit. The ncdf contains the corresponding latitude / longitude fields but they ar irregularly spaced. I tried rasterizing the values ...
1
vote
1answer
68 views

Zooming into State

I am using R LeaftLet package to create a interactive choropleth of the US Map. Now my question I want both in one map itself but make zip code visible as I zoom in a state or double click on a ...
0
votes
0answers
65 views

How to effectively read and analyze multiple dbf tables?

I have multiple standalone dbf tables in a geodatabase (when saying standalone, I mean they don't have spatial components). I found this post Reading File Geodatabase using R indicated R is a ...
3
votes
2answers
126 views

Changing raster calculation values - shorten this script?

i'm doing something quite straightforward regarding raster algebra but am struggling either to find the correct function or make a function work correctly; Basically I have 2 rasters, representing ...
1
vote
0answers
44 views

Viewshed with RpyGeo “rpygeo.Viewshed.sa”

This function is not working: rpygeo.Viewshed.sa(mnt, pt,out.raster="viewshed") *Error in as.character.default(<S4 object of class "RasterLayer">) : no method for coercing this S4 class to ...
0
votes
0answers
17 views

Reclassifiy raster in R [duplicate]

I have a raster file which has been classified from 1 to 255. I have to reclassify into binary form where 1 to 11 must be classified as 1 and the rest must be 0.How would I be able to do it in R. My ...
2
votes
1answer
116 views

Proj4 for EPSG3857

I am using leaflet and the R library sp. The CRS from my leaflet map is EPSG3857 - WGS84 Web Mercator. I am retrieving the coordinates of my current map view with getBounds(). For further calculations ...
0
votes
0answers
65 views

How to convert raster files from R to arff format (for Weka software)?

I'm trying to convert some raster file to .arff format for Weka software. I used the following code to convert my files, but I got an error. Does anyone know whats the problem?
1
vote
0answers
87 views

Subset moving window when using focal on raster in R

I have a classified Landsat image, and I'd like to pass a filter over it converting certain cells to 0. For some categories, I'd like to set cells to 0 unless an entire 7x7 window contains only that ...
3
votes
1answer
79 views

Variogram for data along linear routes

I have a dataset of some measurements along a bus route (image below). The purpose of my study is to be able to detect the values at any location along the route using Kriging interpolation. I have ...
3
votes
1answer
103 views

integrate elevation and Euclidean distance

I have a number sequential GPS locations from marked animals - usually 4 to 5 locations per day for 1.5 years - and am trying to delineate seasons based on elevation and distance. From low ...
0
votes
1answer
45 views

How to convert shapefile of India into a system with longitude and latitude system?

I have two shapefiles of India. One is without PoK and other is with Pok. I want to convert the shapefile of India with PoK into a co-ordinate system with longitude and latitude (same as without PoK). ...
1
vote
2answers
58 views

Create a raster with ranges from another raster

I have a raster that contains values ranging from 1-180. I am looking for a way to create a new raster where if the values of a cell in the original raster is between 1-10 the new raster cell gets the ...
1
vote
1answer
76 views

osmar returning objects with no features- mapping with R

> src <- osmsource_api() > bb <- center_bbox(51.3528, -0.4468, 7000, 7000) > wb <- get_osm(bb, source = src) > wb osmar object 0 nodes, 0 ways, 0 relations Trying to pull data ...
1
vote
2answers
125 views

Extract raster values to points (1 per cell) for R using ArcMap?

I have created several raster layers within ArcMap that I wish to extract values from in order to analyse within R. However, I'm keen to avoid pseudo replication of my species presence data and ...
1
vote
0answers
113 views

R: Using Inverse Distance Weighting with the mapply function

I would like to find what are the optimal power parameters and number of neighbours for Inverse Distance Weighting (IDW) interpolation using the mapply command and the gstat package in R. The optimal ...
0
votes
0answers
25 views

R: Topology Exception Error

I'm trying to do the gDifference between two polygons, but I was getting an error: Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly, "rgeos_intersection") : TopologyException: ...
1
vote
1answer
101 views

Dissolve overlapping polygons in R

Is there an analogue of ArcGIS Dissolve function in R? I need to dissolve the overlapping polygons and create a single part object. I was trying to use gUnionCascaded, but it creates a multipart ...
2
votes
0answers
47 views

Raster memory usage in R

I am working with raster/brick data in R and running into memory issues. I am basically trying to use raster objects to perform some simple agent-based modeling, but the objects keep increasing in ...
5
votes
1answer
666 views

Batch geocoding in R

I need to find a package in R or source code in R that performs batch geocoding using Bing, Yahoo, OpenStreetmap. Do you have any suggestions?
3
votes
2answers
321 views

Snapping raster grids in R

I am trying to align two raster grids in R. Once aligned I would like to be able to add them together. I have tried to check whether making a stack would work: grid_snap <- stack(habi_sdw, ...
11
votes
2answers
173 views

How to anonymise a gps file?

Imagine you have a GPS trace that you want to make anonymous, in the legal sense. How would you do this? Is snapping to the nearest x distance and stripping out the time enough? Are there ...