Statistical computing language and software environment.

learn more… | top users | synonyms

15
votes
1answer
14k views

Projecting sp objects in R

I have a number of shapefiles in different CRSs (mostly WGS84 lat/lon) that I'd like to transform into a common projection (likely Albers Equal Area Conic, but I may ask for help on choosing in ...
11
votes
2answers
179 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 ...
0
votes
0answers
40 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 ...
0
votes
2answers
412 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
83 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
74 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 ...
5
votes
1answer
835 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
131 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
416 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
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 ...
1
vote
1answer
539 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
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 ...
0
votes
0answers
74 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
221 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 ...
1
vote
0answers
93 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
80 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
109 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
48 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
61 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
83 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
1answer
173 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
374 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, ...
1
vote
1answer
113 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 ...
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: ...
2
votes
0answers
51 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 ...
3
votes
2answers
2k 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 ...
1
vote
0answers
83 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
177 views

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

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?
1
vote
1answer
80 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
136 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
261 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
207 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 ...
4
votes
1answer
196 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 ...
2
votes
1answer
199 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
38 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 ...
3
votes
1answer
80 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 ...
1
vote
1answer
81 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 ...
2
votes
1answer
283 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 ...
2
votes
1answer
186 views

Retrieving proportion of pixels in R

I'm trying to retrieve the following pixel statistics: Proportion of zero value pixels: [nº of zero value pixels / (total nº of pixels - nº of NA pixels)] Proportion of pixels smaller than 3rd ...
3
votes
1answer
175 views

Loop to check multiple polygons overlap in r

I have a set of polygons (available here: http://ulozto.cz/x39ELbFt/polygons-zip) created in QGis and processed in R. I would like to know if they are overlapping or not, and if yes, where is the ...
2
votes
0answers
83 views

Efficiently calculate distance between raster patch edges

I have a binary raster which I've classified into patches using raster::clump. I now want to efficiently calculate the edge-to-edge, i.e. minimum, pairwise distance between patches. I am currently ...
1
vote
1answer
237 views

Overlaying grids with a polygon to determine the average value of the overlapping grids for that polygon

I would like to add the average, minimum and maximum value of, let’s say soil moisture (variable "value" in my case), to each NUTS3 region (= a NUTS3 region is a polygon of a certain small area in ...
2
votes
1answer
127 views

How can I conduct dimension reduction using Geographically Weighted Principal Component Analysis?

I want to know how to compute the importance of components for geographically-weighted-principal-component-analysis(gwpca)? That is, I want to reduce dimension according to cumulative proportion of ...
1
vote
0answers
133 views

unsupervised classification in qgis (Orfeo toolbox)

I want to run an unsupervised classification of two landsat images in qgis. Therefor I want to compute a kMeans and a SOM (self organizing maps classification). Unfortunately it doesnt work. I tried ...
0
votes
0answers
59 views

how to define threshold value in r.stream.extract

I want to generate streams using r.stream.extract. on what basis we have to define the threshold value. I am using aster dem with 30m posting.Also i want to know the minimum stream length to be ...
1
vote
1answer
362 views

How do I convert WGS84 to Lat, Long to Google Maps in R?

I have this coordinate which I believe it's in WGS84 format x=1005740.867110, y=243957.356623 I want to plot that in Google Maps which I need to convert that to Lon, Lat. I've found this script ...
2
votes
2answers
2k views

Calculate area covered by a particular raster layer within polygons in QGIS

I am trying to extract information on vegetation cover within a set radius of point locations (my sites). I have succeeded in creating a new vector layer of circles with a 5 km radius around my sites. ...
1
vote
1answer
246 views

R filter shapefiles with dplyr

How to filter shapefiles data in R with dplyr and then put it in a leaflet map? not reproducible example sorry: library(dplyr) library(leaflet) library(sp) library(maptools) library(rgdal) ...
1
vote
1answer
44 views

Spatial representation of Data

I'm a new users of spatial analyses packages in R. I have created a SpatialPolygonsDataFrame which contains a number of rectangular polygons that i named "Square1" to "Square64". Until now there is no ...
1
vote
0answers
172 views

Performing Theil-Sen regression on raster data by R software

I have seven NDVI raster layers (in ERDAS img format) of an area. Each NDVI layer is the peak growing time of that year. I want to do trend analysis of NDVI values change over the years pixel by ...