Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
0answers
5 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 ...
1
vote
0answers
7 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
0answers
10 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 ...
1
vote
0answers
28 views

How to mosaic Tiff files using R?

I have 1600 images in Tiff format which need to be mosaiced using R. Each 3 or 4 images need to be mosaiced together. Using the below pattern, we can recognize which images must be mosaiced into one ...
0
votes
0answers
10 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
32 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 ...
1
vote
0answers
13 views

How to combine 3 rasters: 1 without Geoinformation, 1 with Lat-coord-values and 1 with Long-coord-values

I have multiple raster images without geoinformation. The geoinformation is stored seperately in two other rasters: one contains the Lat-coordinate of every pixel, the another the Long-coordinates. So ...
0
votes
1answer
22 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
27 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 ...
4
votes
2answers
44 views

how to create geo-referenced random data?

I'm writing a dissertation on different parameter settings in GWR . In order to perform tests I'd need the availability of geo-referenced data that show some sort of spiatial correlation (i.e. values ...
1
vote
0answers
24 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 ...
0
votes
1answer
34 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 ...
0
votes
0answers
23 views

Spatial segregation from a raster of racial distribution in the USA

I am trying to measure the degree of racial segregation at some geographic level (let's say the county level, for simplicity) in the USA. I have a shapefile with these geographic units. To do so, ...
3
votes
2answers
36 views

Add information from a cvs/text file to a raster shapefile based on latitude and longitude information

I have an empty raster shapefile that only contains the latitude and the longitude of the centroids of each grid. I now want to add an extra variable to each grid cell coming from a cvs or txt file. ...
2
votes
1answer
51 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
19 views

Unable to load Postgresql spatial data in R (with rgdal)

I'm trying to load spatial data from a postgresql database in R, using functions from the package rgdal, but I'm having trouble getting the functions to work. For example, when trying to read a ...
1
vote
0answers
4 views

Error executing GRASS function i.topo.corr from R [closed]

I am attempting to topographically rectify Landsat data using the i.topo.corr GRASS function from within R using the rgrass7 package. My code is as follows: execGRASS("i.topo.corr", flags = "i", ...
1
vote
1answer
34 views

ggmap: clip a map

I'm using ggmap to grab Washington DC and I have a shapefile that I downloaded from here: library(ggplot2) library(ggmap) library(maptools) dc = get_map(location = 'DC', zoom = 12) nhbds = ...
2
votes
2answers
37 views

Merge multiple SpatialPolygonDataFrame into 1 SPDF in R (analogue to “Merge” Tool in ArcGIS)

I have created 2 polygons in QGIS. Using them in R, polygons become automatically SpatialPolygonsDataFrame (SPDF). I would like to merge them into single SPDF (as is super easy in ArcGis using Tool ...
0
votes
0answers
20 views

Error during rasterization?

Cities are SpatialPointsDataFrame cities<-readOGR(dsn=".",layer="cities") r.raster <- raster() extent(r.raster) <- extent(cities) res(r.raster) <- 100 cit.rast<- ...
0
votes
1answer
31 views

How to do union that results to a SpatialPolygonDataFrame in R?

I have the following code coastline<-readOGR(dsn=".",layer="shp") wetlands<-readOGR(dsn=".",layer="shp") wetb<-gBuffer(wetlands,width=500,byid=T) ...
1
vote
1answer
32 views

Transforming coordinate in the Swiss reference system LV95 into LatLong/WGS84

I would like to transform coordinates expressed in the Swiss reference system LV95 into LatLong/WGS84. On the website of the Swiss topography centre, there is an application to do so, however ...
1
vote
1answer
36 views

Find intersections between spatial lines and points using R

This question assumes that I'm using R with the sp and rgdal packages installed. Now that I have a set of spatial segments of class SpatialLinesDataFrame (called 'segmentData') and a set of spatial ...
0
votes
1answer
30 views

Extracting Data from Raster based on Aspect Raster file

I have 2 rasters, ones shows aspect and another shows date of snow thaw. I want to extract the date of snow melt based on values from the aspect raster. For example I want all the snow thaw dates from ...
3
votes
1answer
84 views

Difference between gdalwarp and projectRaster

I am trying to project a Raster. In R there is the projectRaster() function to to this (below a fully reproducibly example) : # example Raster require(raster) r <- raster(xmn=-110, xmx=-90, ...
1
vote
1answer
72 views

Big performance difference reading shapefiles between QGIS and R

I'm trying to read the belgian landuse ESRI shapefile from geofabrik.de: http://download.geofabrik.de/europe/belgium.html In QGIS it's just a matter of seconds, but in R using the readOGR function ...
1
vote
1answer
27 views

Merge a table with a shapefile (not the same dimension)

I am trying to merge a table with a shape file using R. The shapefile's database is bigger than the table and I need to have null or zero values where the two data sets don't match. Table data no. ...
2
votes
1answer
62 views

How is R used with ArcGIS for Desktop?

How is R used with ArcGIS for Desktop? I have seen posts talking about combining rasters while using R. I have not had much experience with R so not 100% certain of its capabilities. I had ...
0
votes
0answers
45 views

How should i combine these rasters?

I have two buffers that i want to combine. I tried overlay with fun=function(x,y){return(x*y)} but 0*5 = 0 so it produces NA's.I don't know how to combine them the one buffer should be 500 and the ...
0
votes
1answer
26 views

iterate over spatial polygon data frame in R

I am trying to iterate over the rows of a spatial polygon data frame in R, but cannot figure out the right indexing. I don't want to select by attributes, but rather just iterate over the spatial ...
2
votes
1answer
16 views

How to find the coordinates of the intersection points between two SpatialLines objects (or SpatialLines and SpatialPolygon edges)

I am try to find the co-ordinates of points where SpatialLines cross the edge of a SpatialPolygon. I have searched and searched, but can only find results such as over which tell me which lines cross ...
4
votes
1answer
55 views

Grid vs. Polygon Overlay in R gives different results than in QGIS

I have a shapefile of range polygons. Each colored set of polygons represents a different group of species/genera/whatever. I next overlay a 5x5 grid onto this map. And then use join attributes by ...
4
votes
1answer
50 views

Generate grid shapefile in R

I have the following shapefile of a 10x10 degree latitude/longitude grid that I created in QGIS. I can read it into R using the rgdal package. Grid<-readOGR(".","GridShapeFile") It has the ...
-1
votes
1answer
62 views

How to reclassify a raster in R?

wet<-readOGR(dsn=".",layer="shp") #wetlands r.raster <- raster() extent(r.raster) <- extent(wet) res(r.raster) <- 100 wet.r <- rasterize(wet,r.raster) #rasterize plot(wet.r) ...
2
votes
1answer
45 views

Changing the extent of a Shape file in ArcMap for distrubution modelling in R

I am currently trying to create a species distribution model in R using maxent. The shape file I have is a map of an island. When viewed in ArcMap it has a set extent--in Lat and Long. I can ...
4
votes
1answer
50 views

How to find the distance from a point to a polygon, via another point, in R

I am trying to calculate the distances between a central point, and the edge of a polygon, along straight lines drawn between the central point and another set of points (where necessary extended ...
0
votes
2answers
55 views

Extracting a number of rows from a column in R

It's a shapefile that has a column with population. a$POP2001 It has 200 rows.I want to extract the settlements that contain less than 1000 residents, so i did this: s<-a[a$POP2001<1000,] ...
1
vote
1answer
83 views

How to reproject a raster from lat/lon to UTM in R?

i have to turn it into a UTM in order to make the buffer functional. wets<-readOGR(dsn=".",layer="shapefile") r.raster <- raster() extent(r.raster) <- extent(wets) res(r.raster) <- 100 ...
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) ...
2
votes
0answers
30 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
12 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
31 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 ...
0
votes
1answer
32 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
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") ...
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
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 ...
1
vote
1answer
21 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 ...
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 ...
5
votes
1answer
186 views

Create raster with grid cells values based on area covered by polygons

I have a polygon data with area covered by the forests (data is here - https://www.dropbox.com/s/zgckliydalljw6a/sp_data.zip?dl=0). I want to convert polygons to raster. The value of each grid cell ...
4
votes
2answers
91 views

Dissolving/Unifying Ill Behaved/Irregular Polygons in R

I'm working on a project involving bringing together multiple subjects circling difficult to find parts of an image. The output from users is pretty awesome. Cool, right? However, what I want is ...