Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
1answer
56 views

Count overlapping polygons in single shape file with R

I have a shapefile of species ranges for ~ 346 species. Some species have multiple polygon ranges so there are 1,078 polygons and many polygons are multi-part. It looks something like this: I ...
1
vote
1answer
42 views

How can we retrieve the values ​​of the intervals in the legend in R

I have an elevation model plotted in R Code: library(raster) data(volcano) r <- raster(volcano) plot(r, col = topo.colors(20)) Plot: how can we retrieve the values ​​of the intervals in the ...
0
votes
1answer
23 views

smoothing a set point in R

I try to smooth R with a set point as follows: myshp <- shapefile("C:/Users/zina/workspace/Proj_Meteo/interpolate/DZA_adm/DZA_adm0.shp") ...
2
votes
2answers
134 views

Wrong projection high quality shapefile for the coastline of Helsinki region (Finland)

I did some spatial interpolations in R and I need a support for those. Looking for shapefiles online the best I could find was and it looks really horrible, the same area in ggplot looks like . I ...
0
votes
2answers
105 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
0answers
25 views

Assigning widths to string fields using writeOGR() from rgdal?

I am currently working with MapInfo files in the .tab format. I am using R (3.1.0 for Windows) to read and write files in this format, however, I am encountering an issue with writeOGR() from the ...
2
votes
0answers
23 views

Converting LANDSAT-8 TIFF to matrix, data frame, or SpatialGridDataFrame formates

I need to correct the reflectance values of LANDSAT-8 data for steep terrain and find it too tedious and clunky in ArcGIS. The data I have is: LANSDAT-8 DEM (ASTER) Slope and aspect (Derived using DEM ...
1
vote
2answers
18 views

How to see whether a set of postcodes have a typical distribution to the whole postcode population of UK?

For my dissertation I have a dataset of postcodes of 9984 that I am converting to coordinates atm. I looking to find whether this dataset has a 'typical or 'atypical' spatial distribution compared ...
4
votes
2answers
153 views

join grid or polygon layers in R

I have two grids. Cells in each grid have an attribute. Size of grid cells differs between the two grids and the two grids do not overlay each other perfectly. I would like to create a new layer, ...
0
votes
1answer
28 views

scatterplot of two rasters in R

I am very very new in programming and I want to ask how can I make a scatterplot of two rasters in R and also get their correlation of determination?
1
vote
2answers
48 views

Aggregating satellite night light data in R

I am working in R and having some difficulties with extracting values from a raster layer. What I am trying to do is aggregate satellite night light data from pixel to polygons. However, when I ...
3
votes
1answer
42 views

Polygon fill colour specified by column R spplot

I am trying to plot a geological map using the spplot function in R. For every unit I already assigned a specific color in the col-column of the SpatialPolygonsDataFrame. Now I would like to plot the ...
2
votes
0answers
27 views

does the census bureau provide clipped / water-bounded files as nice as certain cities?

this question says they do but when i compare what i can find in the cartographic boundary files section of the census bureau's gis page, they don't look as good as certain shapefiles provided by the ...
0
votes
0answers
13 views

PostGIS raster write support in R

I want to push/write some generated raster layers to my postgres database directly in R. In theory this could be supported by the rgdal package, but sadly it isn't. In the latest version only copy, ...
1
vote
0answers
37 views

How to clear areas outside map in R

I succeeded thanks to the eblonde in the disscution (problem with polygon smoothing in R) to smoothing polygons in R. Code: inter1= read.table("c:/inter2.csv", header=TRUE) #add a category ...
1
vote
1answer
174 views

How to perform a true GIS clip of polygons layer using a polygon layer in R?

I would like to do a true GIS Clip in R of soils polygons using a series of single boundary polygons, but I cannot find an R function to properly do it. It should work just like the CLIP function in ...
0
votes
1answer
30 views

How to load postgis raster layers into R?

It is easy to get Vectorlayers into R from a PostgreSQL+PostGIS solution. library(rgdal) dsn="PG:dbname=plots host=localhost user=test password=test" plots = readOGR(dsn,"Plots") But how to do the ...
1
vote
1answer
31 views

Is it possible to create a scatterplot with icons (svg or png) instead of points

I'm just starting with R and I wanted to know if it's possible to create a scatterplot with custom icons (svg or png) instead of points. I started to import a shapefile, and then I have a set of ...
3
votes
1answer
70 views

problem with polygon smoothing in R

With R I am looking to smooth my Polygon: inter2.csv code: inter1 <- read.table("c:/inter2.csv", header=TRUE) # add a category (required for later rasterizing/polygonizing) inter1 <- ...
4
votes
4answers
123 views

Create a rectangular buffer from point shapefile using QGIS/GRASS/SAGA GIS/R

I have a points shapefile and I want to create a rectangular buffer (22 x 16 km) around each point. My goal is to create a 16x22 km grid where each of the points is the centroid of the grid. Seed the ...
4
votes
1answer
37 views

How to create a map colored by distance to nearest point in R

I'm new to GIS and R-- hope this question makes sense. I have a dataframe(geo07) containing two variables that record the long/lat values for about 6000 points (mat_long & mat_lat). These ...
2
votes
0answers
87 views

Place an image svg into an R plot

I have a set SVG icons (weather icons ) and I want to create a figure with svg superimposed images representation of a Shapefile. below my shapefiles and points representing the position where I ...
0
votes
2answers
46 views

Read ESRI shape file (polygon or polyline) in R Environment

How can I read ESRI polygon/polyline shapefile in R environment using rgdal or other library ? can I get a syntax for it ?
1
vote
0answers
15 views

SQLite Driver available with R's rgdal:writeOGR?

Does anybody know how I can get OGR's SQLite Driver to work with R's rgdal package? When listing the drivers in R with the ogrDrivers() command the SQLITE driver is missing..
3
votes
1answer
65 views

make a raster from dataset (csv)

I was trying to make a raster from an dataset (https://www.dropbox.com/s/jsm1x06lnzfbqty/data.csv?dl=0) code: inter1= read.table("c:/data.csv", header=TRUE) #convert to spatial points ...
0
votes
1answer
36 views

How to create an interrupted Mollweide map in R?

I am wondering if it is possible to create an interrupted Mollweide map in R. This question is similar to Discontinuous or Interrupted map projections? which does not really have a satisfactory ...
2
votes
1answer
21 views

How to change position of legend in levelplot of rasterVis in R? [closed]

By default legend is plot right side and I want to change it to bottom of plot. levelplot(CHL1, xlim=c(30,130), ylim=c(-20,30), xlab="", ylab="", margin=FALSE, col.regions=pal, ...
3
votes
2answers
99 views

Display two-dimensional color gradient for two different quantities

I have two overlapping raster layers. One contains quantity A from 0 to 100, and the other contains quantity B from 0 to 100. I'd like to create a map displaying both sets of data at once based on a ...
3
votes
2answers
61 views

Reprojection of shapefile in R and final extraction of values

I need to extract values from some raster files (stack) using a shape file. to bring both of them in the same CRS, I first transformed the shapefile using the EPSG codes. Opening it in an GIS software ...
3
votes
2answers
2k views

Converting NZMG (or NZTM) to latitude / longitude for use with R map library

I am a statistician with no background in GIS so apologies for the newbie question. We routinely use R for a range of statistical and graphic analysis and are interested in using its map library to ...
3
votes
2answers
115 views

Ripley's K function in QGIS Chugiak 2.4

I'm a noob user and I need to apply the Ripley's K-function on a point pattern in QGIS 2.4 Chugiak, but I don't know how to do. I think I need to use some plugin or extension (maybe GRASS, R or ...
1
vote
1answer
71 views

How do I convert a .bil (and associated .clr, .blw, .hdr, and .stx) files into georeferenced rasters in R? OR to geotiffs using gdal_translate?

The title says it all. I've got a bunch of .bil files, which I can open in R using the raster command pointed to the path to the .bil file. But I don't know how to efficiently incorporate the ...
4
votes
0answers
185 views

R Raster package loop over pixels

I want to perform a trend analysis for each pixel over it's time dimension. Therefore I wrote a loop over each pixel doing the calculation but this is extremely slow. I am sure there must be a faster ...
1
vote
1answer
115 views

converting coordinates from unusual DMS format to decimal

So I've been shared a dataset with what to me is an unusual format for degree min second data. In their own words: The coordinates provided are longitude and latitude in degrees minutes and ...
1
vote
1answer
485 views

Administrative level and coordinates from Yahoo GeoPlanet WOEID

The Yahoo GeoPlanet data can be freely downloaded from: http://developer.yahoo.com/geo/geoplanet/data/. If I understand it correctly, each WOEID corresponds to a unique location on earth, with ...
4
votes
1answer
211 views

Clip polygon and retain data

I have these two polygons: library(sp); library(rgeos); library(maptools) coords1 <- matrix(c(-1.841960, -1.823464, -1.838623, -1.841960, 55.663696, 55.659178, 55.650841, ...
1
vote
1answer
40 views

Extracting data, not colors, from geotiffs in R

I'm an experienced R user new to GIS, but finding my way. I've recently run into an issue that I haven't been able to find any satisfactory documentation on (but could just be searching poorly). I'm ...
3
votes
2answers
75 views

Extract values from raster based on points and pixels adjacent to the point

I have an issue. I have a set of points (n=~2000) and I would like to extract the pixel values from multiple rasters (a single-raster solution is also ok) for location of that point as well as that of ...
1
vote
1answer
314 views

r.surf.contour in QGIS 2.0

I have a problem with r.surf.contour. I create a DTM with v.to.rast.attribute and then use the r.surf.contour and it works fine in QGIS 1.9 but with QGIS 2.0 doesn't work. I have a contour shapefile ...
3
votes
2answers
143 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 ...
3
votes
1answer
48 views

How to plot a full hemispheric orthographic projection in R

I want to make a plot like that using R: All I want is the country borders as seen from outer space, no fancy colors needed. It seems I need to use the spTransform function, but it gives me a "non ...
1
vote
0answers
17 views

R package spatstat: How to use point process model covariate as factor when pixel image values are numeric

I am trying to model a point process with an image covariate using the ppm() function in the spatstat package in R. I convert my raster to an im object for use with spatstat, and I run into a problem ...
0
votes
1answer
63 views

calculate distance between points crossing the antimeridian

How can I calculate the distance between two points (lon/lat) if any of the points exceeds the antimeridian (+-180 longitude)? Im using the distVincentyEllipsoid {geosphere} to calculate the shortest ...
5
votes
1answer
372 views

Rgeos drops associated values when intersecting polygons

I am trying to intersect two SpatialPolygonsDataFrames and get a SpatialPolygonsDataFrame as the result. Unfortunately, using the gIntersection function from rgeos (which works impressively quickly ...
3
votes
1answer
74 views

Fixing orphaned holes in R

I'm trying to perform a union on a common field after merging two adjacent shapefiles. The shapefiles end up with at least one thin sliver of space between them. When I attempt a union I get the ...
2
votes
2answers
65 views

Convert shapefile with lists to data frame in R

I would like to ask some help for converting a shapefile to data frame. I downloaded data related to roads from Natural Earth. I imported the shapefile using shapefiles package like the following. ...
1
vote
1answer
39 views

How to convert raster to im object for point process model covariate in R

I am trying to convert a raster object to an .im object for use with a point process model in the spatstat package in R. I begin by creating the raster from a tiff file using the raster() package. No ...
1
vote
0answers
67 views

Using r, readShapeSpatial fails with simplified mapshaper.org shape

So I'm mapping out the postal regions of my country and it's an enormous, 5.4million row dataframe. I don't need every single little twist and turn of the boundries, so I was super excited to ...
1
vote
1answer
91 views

How to find highest kernel density point

I've been using spatstat to analyse point patterns in R. Here's an example to put this in context: library(spatstat) library(maptools) # to convert sp class to ppp Some point data: set.seed(1985) ...
0
votes
1answer
47 views

Subset netCDF based on last valid variable by level

I have a netCDF file (in this LINK) which contains monthly average values for 4 parameters at 11 different depth levels (0-200m). I would like to extract the monthly value for temperature "votemper" ...