Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
1answer
36 views

How to rasterize a shapefile in R? [duplicate]

I have several shapefiels that i have to turn into raster. Here's the coastline coastline<-readShapeSpatial("shp") r <- raster(ncols=90, nrows=45) jd<-rasterize(coastline,r) plot(jd) ...
0
votes
1answer
53 views

How to rasterize a vector dataset in R?

I would like to compare vector vs raster data. So i try to fix a problem using both ways. I made it in vector first : coastline<-readShapeSpatial("shp") wets<-readShapeSpatial("shp") ...
2
votes
0answers
31 views

Merge Spatial polygons from shapefiles

I have downloaded the shapefiles from the following website: http://download.geofabrik.de/europe/france.html Each zip contains a "landuse" shapefile and I want to merge all of them in one single ...
1
vote
0answers
13 views

Get the intersection of two dataframes of coordinates R

I have two dataframes with geocodes. The first looks something like this: spoints<- data.frame(x=c(1,2,3,4,5,6),y=c(6,5,4,3,2,1)) spoints maps a country. My second data frame looks like this: ...
1
vote
1answer
32 views

How to display the map within two longitude lines

I am new to GIS and I try to use the following code to display a pacific-centered world map. +proj=robin +lon_0=-198 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs However the map ...
1
vote
1answer
185 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
1answer
35 views

How to plot a shapefile with colors according to a column numbers in R?

reclass = function(x){ ifelse(x == 0, 10, ifelse(x > 0 & x <= 20, 0, NA)) } arch$ranks<-as.factor(unlist(lapply(arch$ranks,reclass)) arch.col = topo.colors(nlevels(arch$ranks)) ...
0
votes
0answers
20 views

Problem with passing ranks to different buffers

This issue is really troublesome.i have a SpatialPointsDataFrame which refers to a city.I needed to perform a join with a dbf in order to attach the population column which i did thanks to a couple of ...
1
vote
1answer
22 views

Getting range value from exponential variogram model

I am using vgm() from the gstat library in R: variogr <-vgm(sill,"Exp",range=range,nugget=0) output <-krige(...,model=variogr) As you can see I'm using fixed psill and range values. Before ...
0
votes
1answer
45 views

How to rank according to a distance in a shapefile using R?

I would like some help on the theory behind this. I have done this in GRASS easily but doing it in R is not the same. Here's the table with the info, there are more tables similar to that but refer ...
1
vote
1answer
23 views

Is it possible to zoom out a plot of a map in R?

Sometimes a plot looks zoomed in how to arrange that? i use the rgeos package mainly. When i do a buffer for example somewhere the plot tends to zoom in some part of the map which is not good since it ...
2
votes
1answer
55 views

How to join a dataframe with a dbf via a common column in R?

I have a SpatialPointsDataFrame with the data of a city and i want to join it with a dbf that contains the population via a common column that they have. How do i do that so the first one has the ...
3
votes
1answer
35 views

Association shape files to custom data in r

This is probably an obvious question. I have an Australia Shapefile (can be found here http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1259.0.30.001July%202011?OpenDocument) and some custom data ...
0
votes
0answers
18 views

NetCDF4 Files: Missing Projection & Varying Dimensions (Multiple Files)

All, I hope you can shed some light on issues I've been having regarding NCEP Reanalysis-I netCDF-4 file format: First issue, Projection information is not stored on the downloads I obtained from ...
0
votes
1answer
40 views

R-Leaflet: Plotted points on wrong country

I am learning the leaflet package and am running into a snag. To learn the package I am using the Snow deaths dataset from the package HistData which contains historic Cholera deaths from an epidemic. ...
1
vote
0answers
34 views

way in R or Python to add image/video in map plot marker click popup/infowindow

I have many different (lat,long data) points of world associated with unique place names and corresponding each point specific image or video data. Now I want to create an html file where if user ...
2
votes
0answers
28 views

From track+waypoints to elevation profile with waypoints

I have a track and waypoints (1) imported in QGIS. I want to calculate the closest point from every waypoint to the track (2). Then, I want a table with data that allows me to draw an elevation ...
0
votes
0answers
18 views

Calculating maximum mean temperature of the coldest month with a lists of rasters

I need calculate the maximum mean temperature of the coldest month. I need first select the coldest month in a list and then in this month determine the maximum temperature. I do this: Create the ...
13
votes
1answer
8k 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 projectly (likely Albers Equal Area Conic, but I may ask for help on choosing in another ...
1
vote
0answers
29 views

how to calculate distance in sub pixel mapping from Atkinson's paper?

Condition from atkindon's paper http://info.asprs.org/publications/pers/2005journal/july/2005_july_839-846.pdf for every sub-pixel the attractiveness Ai of a pixel i is predicted as a ...
6
votes
3answers
122 views

Waypoints with coordinates in R

I have a SpatialLineDataFrame with 20 observations of 4 variables (in WGS84). I want to create waypoints every 10 meters. Every waypoint will has the x y coordinates. I tried to do it manually like: ...
1
vote
0answers
51 views

Download Google maps data points

Is it possible to download google map data points? it would be usefull in order to gather in datasets all the restaurants in a dataset for example. I am using R but suggestions is other programs are ...
4
votes
3answers
63 views

Save and load maps for ggmap to use without internet access

I would like to use the ggmap package to download and display maps. Unfortunately I have some firewall restrictions preventing R from accessing the internet directly. The error I get from get_map is ...
5
votes
1answer
547 views

Convert coordinates from readShapePoly in R to long-lat coordinates

I'm trying to find some centroids of a shapefile for Danish municipalities and afterwards find the driving time between them. I use R's readShapePoly function from maptools combined with the ...
1
vote
0answers
25 views

Modelling zero-inflated spatially autocorrelated data with extreme values

I have spatially explicit data (above; Longitude, Latitude) with measurements on a random variable (z). This data was not collected in a random or systematic fashion, but instead was recorded ...
0
votes
1answer
100 views

R using fortify to project shapefile on google map gives wrong results

I have a shapefile that looks like this > str(FieldsMap) Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 3 obs. of 2 variables: .. ..$ id : ...
1
vote
1answer
55 views

Convert shapefile to WGS84 [duplicate]

I have a shapefile with shapelength and shapearea, and would like to convert to WGS84 to use with ggmap. Eventually, I would like to get plot google map of individual regions of the shapefile, and ...
1
vote
0answers
10 views

weighting scheme of gstat for fitting models to variograms

I use R and the gstat package to construct variograms of temperature, and I would like to ask If anyone knows what weighting scheme does the gstat package use to fit a model to the sample variogram?
0
votes
0answers
18 views

Why does R(gdal) mangle data when converting to geojson?

I've encountered issues with projections in .geojson files created by rgdal, but I never thought it would destroy my data, until I tried this (reproducible example): ...
0
votes
1answer
42 views

Add Points shp attributes to Polygon shp by Point location (as Spatial Join in ArcGIS)

I have a set of points in .shp (ESRI, available here: http://ulozto.cz/xGqRVFrR/voronoi-zip). I would like to calculate Voronoi tesselation from the points, thus create polygons. So far, so good. ...
1
vote
0answers
28 views

rgdal with multiple Feature Datasets in R

I am trying to read shapefiles contained within a geodatabase file (.gdb) into R. The .gdb contains two Feature Datasets with multiple Feature Classes within each. The problem is only one of the two ...
9
votes
2answers
2k views

How to get the second nearest neighbor between two point patterns in R?

Is there a way to get the distances for the second nearest neighbor between two point patterns in R? The spatstat package has a function called nncross but it only applies to the nearest neighbors ...
14
votes
2answers
3k views

Using R with ArcGIS Desktop

In response to comments below, a re-phrasing of the question. I've used the integration of R with QGIS, and found it a very uesful tool. Having taken a look at the R toolbox extension for 9 and the ...
14
votes
3answers
654 views

How to determine if trees within forest gaps are clustered?

The attached dataset shows approximately 6000 saplings in approximately 50 variable sized forest gaps. I am interested in learning how these saplings are growing within their respective gaps (i.e. ...
3
votes
1answer
100 views

R - How to “smooth” a raster map

I am trying to create a map from raster data. The file came from a crop model, with resolution of 0.5 degree. Even when I disaggregate it (i.e. increase spatial resolution), the map looks really ...
1
vote
1answer
109 views

unsupervised random forest classification in R

I want to compute an unsupervised random forest classification out of a raster stack in R. The raster stack represents the same extent in different spectral bands and as a result I want to obtain an ...
14
votes
1answer
3k 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 ...
1
vote
1answer
204 views

How to do supervised image classification in saga with the help of R script or Python script

I am using Ubuntu 12.04 and want to do image classification in SAGA. SAGA has numerous classification algorithms which is not present in GRASS and QGIS. I am new to SAGA, but more accustomed to work ...
1
vote
3answers
42 views

Creating a new raster layer based on mean of other raster layers, ignoring NA values in R

I am trying to create a new raster layer that is made up of the mean values from 7 other raster layers. I get results using overlay function mean: mean <- overlay(2000, 2001, 2002, 2003, 2004, ...
0
votes
0answers
21 views

plot rasters with the same line diagram

I have 6 raster files with continuous values for an area with the same extent. I have created a raster stack and I want to plot one line for each cell in the raster stack of my six rasters (like the ...
0
votes
1answer
46 views

Cross validation in thiessen polygons interpolation

I apply Thiessen Polygons interpolation using the krige command in the gstat R package. Using krige without a variogram model sets automatically krige function to perform IDW, and when nmax parameter ...
11
votes
2answers
176 views

How does spatial polygon %over% polygon work to when aggregating values in r?

I'm working on an environmental epidemiology project where I have point exposures (~ 2,000 industrial hog operations - IHOs). These IHOs spray on nearby fields, but the feces water droplets and smell ...
0
votes
0answers
34 views

Using R to find attributes of spatial neighbors, especially with big spatial polygon data frames

If it's not too much, I have a specific question that leads to a more general one: I'd love thoughts on both if it's possible. First, the specific: I have an analysis involving census blocks and ...
0
votes
1answer
55 views

in R : get a SpatialPolygonDataFrame from gIntersection{rgeos] with sub-area as attribute?

I am using gIntersection (package rgeos) to intersect a polygon shapefile containing 20 buffers zones, with another polygon shapefile containing "ground occupation mode (GOM)" (an area divided in ...
6
votes
5answers
2k views

Create a ground overlay kml from georeferenced raster

I have a world georeferenced raster (5m resolution, ~4000 x 4000 pixels) that I would like to display in google earth. I am looking for a simple and effective way to generate this kml file. Using ...
5
votes
2answers
215 views

Calculating Shannon's diversity using moving window in R

I have a raster where each pixel is a particular vegetation type. I'm interested in the diversity of vegetation types around each pixel. I'd like to assign a Shannon's diversity index value (see ...
6
votes
3answers
4k views

Converting osm file to shapefile (or data frame) in R

I was looking for a road shapefile for Australia today. I ended up going to Geofabrik. Open Street Map has data in .osm format. But they do not have one in .shp for Australia. If possible, I want to ...
4
votes
2answers
57 views

writeOGR with a spatialpolygon simplified by gSimplify

I'm using gSimplify (rgeos package) to simplify the geometries of a shapefile. The funcion works good, but now I can't write the output in a new shapefile. I tried some ways: writeOGR(simplyshape, ...
0
votes
2answers
31 views

How to produce a finer resolution spatial grid from coarser grid in R?

I have a spatial grid of an image. Now I want to use this grid and make a finer resolution grid out of it. For example an image structure in R is given below: str(c) Formal class ...
0
votes
1answer
169 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); ...