Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
2answers
34 views

Failure of the function “rasterize” in R: NAs or no slots

I have some problems to convert a shapefile into a raster. I used the function rasterize (package raster) but all raster values are equal to NA. Following the answers to this question rasterize ...
0
votes
1answer
24 views

Creating spatial population heat map

I have some data that contains crab males population based on latitude and longitude. I am trying to plot the population distribution on map (not point density). For example I like to show which areas ...
0
votes
0answers
19 views

Spatial index in R - Performance enhancement on geospatial processing [on hold]

In my Geoinformatics studies, I often stumbled over the usage of spatial indices in spatial databases like here. However, I wondered if there is any possibility to use such indices in R in order to ...
42
votes
9answers
15k views

Tutorials to handle spatial data in R?

Does anyone know some good tutorials to handle spatial data in R? I know that there are some packages like rgdal and maptools but I haven't actually found usefull tutorials to get in touch with the ...
0
votes
0answers
10 views

paste based in the number of elements in the row [migrated]

This is my dataframe s <- data.frame( x = c("a","b","c"), y = c("d","e", NA), z = c(NA,"j",NA) ) And I want to concatenate(paste) the values based a condition, I want to paste with comma ...
0
votes
1answer
34 views

Increase speed of reverse clip (erase) for large shapefiles in R

I would like to do a reverse clip (or erase in ArcMap) from shapefiles (polygons) then to merge the two shapefiles into a single shapefile. From this post How to 'reverse clip' (erase) in R, ...
3
votes
1answer
541 views

Spatial Interpolation Methods like PRISM

I am looking for some kind of software (free software) that allows me to make an interpolation like PRISM software. The interpolation used in PRISM is a local regression and accounts for ...
1
vote
1answer
22 views

Correct Projection for calculating centroids of a group of points?

I have a long list of points covering all of North America for which I would like to calculate the centroid (by grouping points based on the "Name" column). My approach is to take the WGS84 ...
0
votes
0answers
50 views

R raster() function failed to read tif file

I wrote a few lines to load data in TIFF to R. The function I used was: library(raster) test <- raster("file name.tif",package="raster") and it worked perfectly last week. However, now I am ...
-1
votes
0answers
25 views

create a grid and extract species and climate data [on hold]

I am looking for R support to arrange my dataset which I tried and failed in Arc GIS. If you have an idea please let me know. I have 6 bioclimatic variables and 14 species. I want to create a ...
1
vote
1answer
33 views

Spearman correlation between two rasters in R

I have two rasters of the same area. The only difference is that they were created using two different methods. I would like to compare them and see how correlated they are pixel by pixel. Any ideas ...
1
vote
1answer
20 views

How to manually assign new names to attributes in a spatial data frame column with NA values

Data can be found here (Admin 1- States and Provinces, first download button): http://www.naturalearthdata.com/downloads/10m-cultural-vectors/ I have a shapefile of the world that I'll be pulling ...
6
votes
4answers
250 views

Estimating river Channel Width using Python/ArcGIS/MATLAB/R?

I am trying to estimate the river channel width from digitized polygon or poly-lines shapefiles. To do so, I converted poly-line shape files to points.shp at regular intervals (at 1 cm). Later, I ...
0
votes
0answers
34 views

What geospatial analysis can be done easily in R but not in Python? [on hold]

I'd like to present on the capabilities of R in spatial processing to a crowd more familiar with Python. I'm very familiar with R but no so much with Python. I want to wow them with some processes ...
2
votes
1answer
44 views

Tearing of polygons using ggmap and readOGR

I'm trying to incorporate a shape file of US states with ggmap and keep getting "tearing" of my polygons. I tried changing group=id to group=group which helped, but didn't seem to resolve the ...
2
votes
1answer
27 views

problem when doing algebra with raster layers in R

I'm trying to combine bioclim raster layers to create the following layer. (Q) = AnnPrec/[(Tmax+Tmin)*(Tmax-Tmin)]*1000 For that, I import a bioclim stack: envirc = ...
2
votes
0answers
14 views

Adding a custom color scale for a sp.points layer to levelplot() legend

I'm wondering how I can add a customized color palette that I used to display a sp.points layer in a call to levelplot (lattice plotting) in the rasterVis package in R. I used a function that Dave X ...
1
vote
0answers
37 views

Spplot SpatialPolygonDataFrame and SpatialGridDataFrame

I have to plot in the same graph something like this: Then, I have elements from SpatialPolygonDataFrame class and others elements from SpatialGridDataFrame class. When I try to plot them in the ...
2
votes
0answers
27 views

R: Setting pop-ups dependent on zoom level using leaflet

I have data that I would like to group differently, depending on the zoom scale in an interactive map made using leaflet. I have expenditure data and I would like to show expenditure by lake at ...
9
votes
0answers
144 views

Identifying overlapping time intervals with two more criteria in R?

I have to check birds observations made over a longer period for duplicate/overlapping entries. Observers from different points (A,B,C) made observations and marked them on paper maps. Those lines ...
3
votes
1answer
76 views

Error while comparing two raster layer in R

I have got a geographic point distribution with N prehistoric settlements with a size of x and want to compare the distribution with an economic simulation, which produces M settlements (Usally N > ...
0
votes
1answer
25 views

How to create a continuous scale with distinct/custom color and value breaks with ggplot2 map

As stated in the title, I'm trying to create a continuous scale with distinct color and value breaks within the ggplot2 package in R. I'm using some dummy code to illustrate my problem: ...
0
votes
0answers
46 views

Difference between Data Scientist and Spatial Analyst? [closed]

I'm learning Geography and want to be a GIS Analyst and find the job adverts of Data Scientist very similar just with R instead of Python. And get better paid. What are the differences between the ...
9
votes
2answers
358 views

Create area buffers that are limited by a coastline

I'm trying to use ArcGIS 10.2 to create a buffer of points based on a pre-defined area (e.g 400 sq km). Further to that, the buffers of some of the points are close to the coastline that requires the ...
2
votes
2answers
36 views

Use function spplot

Does anybody know how to plot with "spplot" fuction two elements of diferents classes?. One element from "SpatialPolygonDataFrame" class and other from "raster" class.
1
vote
0answers
29 views

How to do a Kernel Density map from weighted point observations using a Cauchy kernel?

I need to produce a kernel density map, but instead of using a common kernel function such as Gaussian, I need to use the Cauchy kernel function. I have tried the Kernel Density tool in ArcGIS and ...
1
vote
0answers
33 views

how to extract line features from a raster

I have a raster of land cover types where roads are represented by pixels (1 pixel = 25m x 25m = 625 m²). Is there a way to extract line features (here roads) from a raster ? ## Create raster as an ...
0
votes
0answers
29 views

Trying to run an ANOVA for fields in a dataframe [R] [migrated]

So far my code looks like this: Points = readOGR(dsn = "./Data/filename.shp",layer = "layername",stringsAsFactors = FALSE) Points$LDI = extract(LDI, Points) LDI = ...
0
votes
1answer
26 views

R: raster stack (time series) loop pixelwise and write layer number of value occurence into a single output layer

I have a raster stack of gridded RFE 2.0 rainfall data (time series of one year = 365 layers). Now I wanted to identifiy on which date during the year the first rainfall occurs for each Pixel. The ...
1
vote
1answer
31 views

Error when trying to plot legend for geom_point with ggplot2

Here's some mock code to go along with my problem: #read in libraries library(ggmap) library(sp) library(raster) library(ggplot2) #read in country shapefile, project, fortify for mapping with ...
0
votes
1answer
116 views

Calculate line density within a buffer in R [closed]

How can I calculate road density within a buffer (km/km²)? The roads are represented by pixels (1 pixel = 625 m²) in a raster map. So I began to convert the road pixels into polylines by using the ...
1
vote
1answer
302 views

How to extract percentage of land cover from a raster according to multiple shapefiles?

I have a raster map that represents land cover of a region, and different shapefiles (total 120) in the same region. I want to know the percentage of every land cover for each shapefile. For example, ...
0
votes
3answers
34 views

How to add two dataframe columns of city and state names to form single city-state column for geocoding in R? [closed]

I tried to search for an answer to this, but I couldn't seem to find the right search terms, so I decided to spell it out quite explicitly. I have a data frame with separate columns for cities, ...
0
votes
2answers
69 views

How can I convert a large csv of irregular lat/lons to regular raster GRID?

I have a large csv containing ~5 million rows containing Lat, Lon, and Depth bathymetry values. I want to generate a raster GRID (for use in Arc) from this, but the trouble is the lat/lons are ...
9
votes
1answer
1k views

Fixing orphaned holes in R

I'm trying to perform a union on a common field after merging two adjacent shapefiles. The shapefiles end up with at least one thin sliver of space between them. When I attempt a union I get the ...
3
votes
3answers
1k views

Relationship between sp package in R; MapWindow; ArcGIS/QGIS?

I am using ArcGIS at office for some visualization work, but I feel it kinda dump to performing the same tasks several times for visualizing some data on different maps. I am think of automating it ...
2
votes
0answers
34 views

R Efficient Way to Resample, Crop, and Mask a Raster Image

Does anyone know an efficient way to resample an image? I am currently trying to crop a large image and clip 2 regions from a shape file. From this clipped image, I would like to increase the pixel ...
2
votes
1answer
43 views

gBuffer(rGEOS) causing R to crash

I have downloaded a US federal lands data layer (fedlanp010g.shp.tar.gz) from http://nationalmap.gov/small_scale/atlasftp.html?openChapters=chpbound#chpbound In R, I am trying to create a buffer ...
1
vote
0answers
31 views

Get distances between boundaries from an SpatialPolygon and raster pixels

I am trying to calculate the distance from several pixels of a raster to a boundary of some polygons in R as it is showed in the image. I have two problems: How to correctly define a boundary from ...
1
vote
2answers
37 views

R calculate raster cell size in map units

I have a RasterLayer and would like to know the cell size. I haven't find any function in the packages :-S . Does someone have an idea ? info about the RasterLayer class : RasterLayer ...
3
votes
1answer
321 views

Generic comparison for kriging in geoR and ArcGIS

I am going to do a project based on kriging. The targeted area would be as big as United States and my grid would be 10km*10km. I am wondering the differences of efficiencies for the methods ...
0
votes
1answer
26 views

Defining the correct AEA proj4string for FEWSnet Rainfall Data (Southern Africa) in R [closed]

I have some general questions about how to go about solving this problem: I am trying to incorporate FEWSnet's monthly Rainfall Estimate data from 2014-2015 for Southern Africa into an analysis where ...
1
vote
2answers
40 views

R: aggregate raster with 'mode' function - how does it work?

I want to aggregate a very fine resolution raster at various coarser resolutions (that represents many 1000s of categorical polygons). The aggregate{raster} function is what i've traditionally used, ...
7
votes
4answers
164 views

How to compute max and min coordinates for multiple polygons?

I would like to calculate the maximum, median and minimum latidudinal coordinates for a large set of polygons, using QGIS or R. So the highest and lowest points reached by each polygon across a ...
0
votes
1answer
40 views

Map with ggplot2 and bubbles

I've tried to plot a map of magnitude earthquakes in Colombia with ggplot. After many efforts, I got it. But, I need to focus in specially area where the data of magnitudes is (4, 4.1, 4.2, 4.3, ...
1
vote
2answers
63 views

Improves performance on R working with raster files

I´m trying this code to look for NA and negative pixel values and replace it for 0. But it´s too slow. Any tip for improve the performance of it? "all.files" is a list of address of the images. "r1" ...
2
votes
0answers
25 views

Keys for merging US state/county ANSI's with GADM Unique identifiers?

I've got county-level data from USDA NASS, and I want to merge it with gridded climate data. A preliminary step is the associate the counties with the coordinates of their centroids. If I merge by ...
0
votes
1answer
24 views

Masking low quality raster with polygons in R gives weird overhang?

I am pretty new to R, and have been attempting to use the mask function on a raster image of 250mx250m resolution. My problem is that for some reason I am getting overhang, as there are pixels which ...
0
votes
1answer
183 views

How to convert list of stack images to time series files in R

I am using bfast package for time series analysis. But it requires the files to be read as time series. How to convert list of stacked images from 2000 to 2013 into a time series and given as input ...
5
votes
2answers
86 views

How to join a table to a shapefile with non-matching IDs and names (similar strings)?

I'm having an annoying problem that I'm trying to find an automated solution for. The shorthand version is that I have a shapefile and a table of created data for regions within countries. The created ...