Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
1answer
40 views

How to update selected rows of spatial data frame in R

I have a SpatialPointsDataFrame read via rgdal::readOGR require(rgdal) my_sp_layer <- readOGR(dsn="my_dsn", layer="my_layer_file") # select rows using col_attrib column my_sp_layer@data[...
3
votes
0answers
112 views

MODIS R Package: GDAL Not Available

I am trying to analyze the MODIS EVI 250m, 16day dataset. I found the R MODIS package and am following the instructions here: https://conservationecology.wordpress.com/2014/08/11/bulk-downloading-and-...
3
votes
1answer
88 views

Rotating ~90° using Two-Point Equidistant projection with Proj4

I'm trying to rotate a tif raster in R using Proj4's Two-Point Equidistant projection - I think the only way to rotate spatial geometries to custom angles. But I'm finding the operation gets very ...
0
votes
0answers
12 views

TimeDimension in R, leaflet [duplicate]

it's possible to do this this with R,leaflet ? any suggestion please?
2
votes
2answers
58 views

Create a new GRASS database in R with CRS projection

How to create a new GRASS database in R with CRS projection? I am able to create a new one using the following code but it is not projected require(raster) require(spgrass6) initGRASS("/Applications/...
4
votes
1answer
36 views

Remove certain polygon from SpatialPolygonDataFrame

I am using R maptools library to parse the shapefile into a list of polygons. The function readShapeSpatial shp <- readShapeSpatial("<path to my shapefile>") gives me a ...
1
vote
0answers
152 views

Convert PLSS (Section, Township, Range, Meridian) to Latitude and Longitude using R package or Python

I have data in the form of Section, Township, Range and meridian. I have 300,000 data points from all over the USA. Is there any way i can write R or python scripts to batch convert all the points to ...
0
votes
1answer
94 views

Adding shapes and/or icons to legend using Leaflet within R?

Is it possible, using Leaflet within R, to make a legend in such way that includes a set of icons or shapes and their corresponding value?
0
votes
0answers
66 views

Reprojecting a raster file in R

Help! I have a number of rasters from different sources with different projections. I want to reproject the rasters into a common projection (Eckert IV), somehow line the grids up, and then overlay ...
2
votes
0answers
65 views

Extract values from Rasters in R based on spatial points and spatial polygons

I am trying to extract values from a raster file using the extract command in R mentioned here: http://www.inside-r.org/packages/cran/raster/docs/extract My raster file is unprojected (WGS84 ...
1
vote
0answers
21 views

Subdistrics border change over time

I have 4 shapefiles of India state from 4 decades, and I trying to identify changes within the sub-district level such as splits or merge of sub-dist, border changes etc. I am using R but I can use ...
0
votes
0answers
70 views

Elevation profile of river in R

I would like to plot the elevation profile of a river (shapefile, single line) in R. How do I extract the elevation values (from a DEM .tif, for example) for the river line. I tried clipping but that ...
1
vote
1answer
453 views

Is it possible to use Leaflet.draw on a map in R?

I want to develop an application where a user can draw a line, polygon etc... I currently develop with R and leaflet package and I found that it is possible to work with Leaflet.draw under JavaScript....
0
votes
2answers
56 views

SpatialPointsDataFrame too slow FOR LOOP

I've run into a small problem where my for loop has been running for 3.5 hrs+. I have a Geodataset in SQL Server with a field called Shape that stores co-ordinates in geometry data type. Firstly, I ...
0
votes
1answer
96 views

Read SQL Server Geometry datatype in R

I have two datasets that come from ArcGis, stored in SQL Server. I have a column called - Shape which is a geometry data type and the value looks like this: ...
1
vote
2answers
190 views

What is the proj4string of the Lambert azimuthal equal-area projection?

Shapefiles of European data are available on the Eurostat website. I have loaded the NUTS_2013_60M_SH Shapefile in R with the command; europeRG <- readOGR(dsn = patheurope, layer = "...
3
votes
2answers
63 views

What is the epsg code of eurostat maps?

Shape files of Europe maps are available on the Eurostat website. I downloaded NUTS_2013_60M_SH. The tool (readOGR from the R package Rgdal) I use to load the map shows the following proj4string: "+...
0
votes
1answer
36 views

Grass r.gwr addon difficulties Ubuntu

I am using Grass7 and Ubuntu14.4 I am attempting to carry out a geographically weighted regression between two .tif files but am having issues with the call to r.gwr Code and output is as follows. ...
1
vote
1answer
39 views

Matching Decedal Average NDVI and Worldclim Data

Ive never used NDVI (or EVI) datasets in R. Does anyone have any resource I could use to access a decadal average NDVI dataset for the globe. It would be preferable if this dataset was also comparable ...
1
vote
1answer
32 views

transformations from a sphere using R for raster and polygon data [duplicate]

I am planning on using the MODIS burned area products which were produced by Maryland University. These come as either polygons or rasters. In the user guide it says A shapefile version of the MCD45 ...
2
votes
0answers
32 views

Converting u and v from WGS84 to NZTM2000 - Do I need to do vector conversion?

I have u and v wind component values in latitude and longitude in WGS84. I want to convert this to NZTM2000. I've converted the lat/lon in ArcView - (and will try in R) - but do I need to also do some ...
0
votes
1answer
49 views

Map editor R & leaflet?

That is possible on a web map designed by R & leaflet give the opportunity to the user to draw lines, polygons, choose the colors (like a map editor)? if yes what's the package that allows me to ...
3
votes
3answers
159 views

Get rivers from a DEM raster

I am new to spatial analysis and even newer to hydrology. I have a 30arc DEM elevation raster and I was wondering if I can use it as an input to get the approximate presence of rivers in a ...
1
vote
1answer
56 views

Is it possible to map a leaflet provider (precipitation) on top of a polygon in an interactive map?

I've just started using the leaflet package in R to create interactive maps and I'm wondering if it's possible to plot one of the leaflet providers on top of a plotted polygon rather than under it as ...
1
vote
1answer
72 views

Wanting extract to produce sensible answers for NAs in R

So, I'm working on extracting values from multiple different rasters in R. However, some of our data is marine, some terrestrial. Some rasters cover both, but a few are ocean only or land only. At ...
1
vote
0answers
34 views

Problem in Variogram Plot [closed]

I tried to plot Variogram by this code from gstat packages: v <- variogram(log(zinc) ~ 1, meuse) plot(v) and here is the output: But I want to add line to point (draw variogram line). How I ...
1
vote
2answers
61 views

Automatically convert from latlon to planar

I work with library(sp) and points in latitude longitude, with this projection: proj4string(pts) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84") But some functions (such as sp::spample) ...
6
votes
1answer
91 views

Categorising Point Clusters

I have a point dataset of solar farm locations. The points are grouped according to which substation they feed into (see below). I would like to test the hypothesis that electrical output ...
1
vote
0answers
68 views

R code to find the smallest bounding box with arbitrary orientation

How can I devise an R-code that can derive a rectangular bounding box (with 90-degree angle on each corner) for a set of points with arbitrary orientation? e.g. if the 2 longer edges have a 45-degree ...
0
votes
0answers
21 views

Extracting coordinates and climatic conditions of grids where species polygon overlaps with the climatic layer in R?

I have species’ shapefiles and climatic raster files. The climatic file is in 50 * 50 km equal area grid. Now, I want to calculate the climatic conditions in each grid cell where species polygon ...
0
votes
1answer
175 views

Convert xy spatial points into spatial lines

I have produced a SpatialPoints object (named v3) in R from the function gIntersection (package rgeos). The SpatialPoints object v3 has the following structure and is represented by red points on the ...
0
votes
0answers
77 views

Downloading NOAA AVHRR NDVI using R

I am using the gimms package to automatically download NDVI data from 1981-2013. The code is provided here. The data is available here. However, after running it shows that data has been downloaded ...
1
vote
0answers
41 views

Correcting for offset

I have a shape file with RTK measurements as a line feature, which more or less corresponds with visible features in a raster layer (shaped as lines). These measurements however are not accurate ...
0
votes
1answer
37 views

How to create SpatialPixelsDataFrame from Latitude and Longitude data?

I have a data frame that contains latitude and longitude data with density point. I want to do kriging but my main problem is that I can not create SpatialPixelsDataFrame from my data. My data is ...
3
votes
2answers
80 views

How to remove points which are out of shapefile (or raster) extent

My problem is quite simple. I have thousands of points (coordinates) to analyse, however some of them are so inaccurate that they "hit" the sea. I need to get rid of them. I was trying to find some R ...
1
vote
2answers
64 views

Attaching data to SpatialPolygonsDataFrame

As this is a more GIS related question (and maybe solvable with ogr/gdal functions I'm not aware of), I try it here first, although working with R. What I want to achieve: I have some data, based on ...
1
vote
0answers
34 views

rasterize (R package raster) fail to rasterize island polygons?

I am having problem in rasterezing a polygon shapefile: "island" polygons (I mean polygons which are totally included into a larger one) are ignored and do not appear in the raster. My code is: seg &...
3
votes
1answer
57 views

Spatio-temporal kriging - useful if not interpolating to new time points?

I have data measuring a variable Z say at several locations on a fixed network (each location at a fixed longitude and latitude). values of Z are measured daily at the same time. At the moment I am ...
2
votes
1answer
111 views

buffer in spsample for distance between randomly selected points

I wanted to know if there is a way to add a buffer in the function spsample in the sp package. I am randomly selecting points within 28 polygons and would like to specific a minimum distance the ...
0
votes
1answer
39 views

Transforming a .txt file into a raster in R

I have a .txt file which consists of 160 rows and 320 columns. It covers the geographic region from 34 to 41.95 in latitude and 19 to 34.95 in longitude. Its spatial resolution is 0.05 x 0.05. I use ...
1
vote
1answer
46 views

Using Leave one out method on kriged data

I am looking for a function to do the following. Given a boundary file, and soil sample points within the boundary I am wanting to use the Leave one out validation technique. What I mean is create a ...
1
vote
2answers
146 views

Extract raster layer data by attributes in RasterStacks R

I have a RasterStack with 2 raster layers of the same area, one from a SpatialPolygonsDataFrame (layer1) and another NDVI satellite image (NDVI). layer1 has a series of polygons, each with various ...
1
vote
2answers
84 views

How to extract values from a raster using R?

I'm a beginner at using R software, and I'm attempting to perform a percent linear stretch on the following raster data: > KBnew #class: RasterLayer #dimensions : 27018, 26389, 712978002 (nrow,...
1
vote
1answer
42 views

How to assign the attributes of the largest overlapping polygon area to each overlapping gridcell?

I am new to R, and I am trying to use it to calculate the areas of polygons that overlap with each gridcell, in order to assign the attributes of the largest overlapping polygon area to the ...
2
votes
1answer
148 views

Fill the gaps using nearest neighbors

I want to fill the NA values using the average values of the nearest neighbors: r <- raster(matrix(1:16, nrow=8, ncol=8)) r[r==12] <- NA
1
vote
0answers
11 views

Georeference .txt file to SpatialGridDataFrame

I have a matrix file in a .txt format and I want to georeference this matrix using latitude and longitude. How could I do this in R, so that I can transform my .txt file into a SpatialGridDataFrame ...
0
votes
0answers
31 views

Incomplete/incorrect extraction of raster values from shapefile in R

I am having trouble correctly extracting raster data from all the polygons from a given shapefile in R. The raster and shapefile have identical CRS in QGIS (EPSG:32654, WGS84 / UTM zone 54N). After ...
3
votes
1answer
65 views

Export Shapefile from Arc for use in R

I am trying to export a shapefile from the ArcMap (Made in both 10.2 and 10.3; same problem) environment to be used in R. Unfortunately, it seems that the projection information is somehow not ...
4
votes
0answers
76 views

Crop raster based on another raster R

library(raster) How can one clip one raster based on another raster? RasA: class : RasterLayer dimensions : 459, 533, 244647 (nrow, ncol, ncell) resolution : 10000, 10000 (x, y) extent ...
2
votes
1answer
50 views

R gdalUtils::ogrinfo error or very slow

I am pulling WFS data into R and using gdalUtils::ogrinfo to look at the available layer names on a WFS server. Using the same url in QGIS, this is very fast and gives complete information. With ...