Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
2answers
268 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 ...
1
vote
1answer
40 views

Simple way to plot netCDF variables on Mollweide projection in R

After spending hours Googling I'm still no closer. I'm very keen to find out if there is a very simple way to plot up variables from a netCDF file that are stored in a regular lat-lon grid (-90to90˚N, ...
0
votes
0answers
24 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
44 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 ...
0
votes
0answers
14 views

Zooming into State using R Leaflet

I am using R LeaftLet package to create a interactive choropleth of the US Map. There are several tutorials online and I am able to create interactive state level map with pop up and zoom. Also I ...
5
votes
1answer
519 views

ggmap, ggimage… - Saving and loading maps in R

In my current R project I'm using the ggmap package to download and display maps. What bothers me is that you need internet access to load maps from google etc. I'd like to load a map from the ...
2
votes
1answer
38 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 ...
11
votes
2answers
218 views

Point overplotting on maps in R (e.g. with ggplot2) - how to push points to the side, mark original positions, combine close-by points …?

I've got a database containing languages, their longitudes and latitudes and a feature value (either category 1, category 2 or both - in the plot these are marked red, blue and green respectively). ...
1
vote
0answers
10 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 ...
1
vote
1answer
308 views

Connecting Grass with R

I need help to connect R with Grass. In RStudio when I send the line: loc <- initGRASS("C:/Program Files/R/R-3.1.0/bin/i386", home=tempdir(), override=TRUE) It says: Error in ...
0
votes
0answers
15 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 ...
0
votes
0answers
6 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?
3
votes
2answers
70 views

What percentage of polygon x is in raster pixel y, efficiently

I feel this is a competition worthy problem, due to its size. I would like to weight a set of raster pixels to the attributes of a set of polygons. To do this I need to know the proportion of each ...
0
votes
0answers
19 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 ...
2
votes
1answer
35 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
50 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
28 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). ...
0
votes
0answers
23 views

Gstat: Modelled semivariogram values not matching plotted model using the variogramLine function

I am trying to extract the semivariance values associated with a given semivariogram model developed in gstat, the end goal being to compare modelled semivariance with observed semivariance at defined ...
1
vote
2answers
40 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
23 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 ...
0
votes
1answer
30 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
1answer
31 views

Save raster to file when using stack() in R

I'm working on a function for raster package. In the end of the function I have to use stack() to create a RasterStack. When I do this the data source is in memory. I want to have the data source on ...
3
votes
2answers
43 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, ...
13
votes
3answers
5k views

How to find and merge duplicate points?

I have two point shapefiles: Red and Blue. Each point shapefile has a z value which represents a radius (i.e. represented as buffers in the example). A duplicate point is defined as a point that ...
1
vote
1answer
46 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?
0
votes
0answers
8 views

mapply in the idw command

I would like to find what are the optimal power parameters and number of neighbors for idw interpolation using the mapply command and the gstat package in R. The optimal parameters are determined ...
1
vote
1answer
32 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 ...
1
vote
1answer
201 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 ...
0
votes
0answers
11 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: ...
2
votes
0answers
21 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 ...
2
votes
2answers
1k views

Merging many rasters using Python

I have a list of many many rasters. I want to have a simple and easy to understand script that takes this and merges it into one big mosaic. I found a similar question but the accepted answer adivices ...
6
votes
0answers
71 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 ...
1
vote
0answers
36 views

Plotting a weighted map like a heatmap in R

I want to plot a map weighted by prices. I got a data frame of latitudes, longitudes and prices: > str(data) 'data.frame': 1253 obs. of 3 variables: $ lon : num 11.2 11.1 11 11 11.3 ... $ ...
1
vote
0answers
12 views

Matching vertices in igraph (R)

This is my first question so apologies if it's poorly explained... I'm currently using a combination of ArcMap 10.2 and igraph in R to analyse a network with associated data. I have an igraph ...
0
votes
1answer
45 views

Is there any packages to download landsat image by shapefile boundary in R or python?

I want to find a package which can automatically download images within a predefined administration boundary (shapefile format). Does anyone know a package can conduct or simplify the process?
0
votes
0answers
5 views

Problem with automated data storing during raster::crop (‘legend’ is not a slot in class “RasterStack”)

I am working with a set of raster layers containing CHIRPS monthly rainfall amounts over Africa. For purposes of reproducing the below code, I staged the decompressed tif files on Dropbox. Now, ...
1
vote
1answer
14 views

How to get geodetic area? rgeos::gArea doesn't seem to work. Or area-preserving projection

I need to get an area of different polygons at continental scale (like third of Africa etc.). Usual functions like rgeos::gArea work only in the projection units. Is there any function which works ...
0
votes
2answers
64 views

Exporting Matrix from ArcGIS (so readable in R)

I would like to eventually create a shape file in ArcGIS and then extract it as a matrix to be read by a spatial package I use in R. By matrix I actually mean a Raster file. My first step is to ...
0
votes
1answer
31 views

How to remove zonal anisotropy from directional variogram using gstat in R?

I have a dataframe named seoul315 contains the 107 data of PM10 concentration at 1 march,2012,5.00 am. please, download. I have tried to plot semi-variogram for kriging bt the following code: ...
2
votes
2answers
57 views

Is there a way to get undistorted maps in R (when using the OpenStreetMap package)?

When I download a large map within R (using the OpenStreetMap package) and I reproject the map (ideally to +proj=longlat), the map will always turn out distorted, making country labels etc. near the ...
3
votes
1answer
64 views

Clip raster by raster with data extraction and resolution change

I need to stack multiple maps (tif) together and clip them all according to extent of one small raster map (second raster at the top of picture below). However, the size of pixels in each map is ...
1
vote
1answer
35 views

Difference between intersect {raster} and gIntersection {rgeos} in polygons - R?

I am interested in knowing the difference between tools: intersect {raster} and gIntersection {rgeos}** tools in R. I have several overlapping polygons and I am interested in their overlap, but mostly ...
1
vote
0answers
28 views

Can't properly map Lat/Long data on a googlemap

At the very beginning I should mention that I am a novice in spatial data handling. I am in it because I am recently doing a project where certain mining information needed to be embedded on a global ...
0
votes
2answers
48 views

Really slow extraction from raster even after using crop?

I have a large raster file (245295396) cells and stacks of rasters having 4 layers each which lie in the extent of this large raster. To start with I am trying to get value from one stack (3 channels) ...
2
votes
3answers
198 views

Unable to read raster into R: 'TIFFReadDirectory:Failed to read directory at offset'

I'm getting a weird error when trying to read a raster into R. >r <- raster('myraster.tif') Error in .local(.Object, ...) : TIFFReadDirectory:Failed to read directory at offset 2606110 ...
3
votes
1answer
26 views

Saving results in automap R package for time series data

I'm planning to interpolate monthly rainfall data from 1980 and 2010. I'm using following code: require(gstat) require(sp) require(automap) require(rgdal) require(raster) for(i in ...
0
votes
1answer
184 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); ...
1
vote
1answer
24 views

Phantom artifacts after converting to Robinson projection

I'm using ggplot to create a map using the Robinson projection. Ultimately, I'll be plotting individual countries, but I need to provide continent boundaries as a background layer (since some ...
0
votes
0answers
18 views

unionSpatialPolygons Hardware recommendations

I am following the unionSpatialPolygons code outlined here to combine the zipcodes of the US into states with two states combined. I have successfully done this on a smaller scale, but to do this for ...
2
votes
1answer
150 views

How to create header files for multiple rasters in R

I have nearly 1000 generic binary images, i.e., headerless, band sequential and binary (16-bit signed integer). I have been succesfully able to load these with package 'raster' only when I create an ...