Questions tagged [rgdal]

The rgdal package for R provides bindings to the Geospatial Data Abstraction Library (GDAL) and access to projection/transformation operations from the PROJ.4 library.

rgdal is an package providing bindings to the Geospatial Data Abstraction Library () and access to projection/transformation operations from the library.

Repositories

Vignettes

Other resources

Related tags

509 questions
31
votes
7 answers

readOGR() cannot open file

wmap <- readOGR(dsn="~/R/funwithR/data/ne_110m_land", layer="ne_110m_land") This code is not loading the shape file and error is generated as Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : Cannot open…
Ritesh Jung Thapa
  • 967
  • 2
  • 11
  • 18
25
votes
4 answers

Trouble installing rgdal

I want to install rgdal for "R version 3.2.3 (2015-12-10)". I downloaded and installed GDAL 1.11 Complete PROJ framework v4.9.2-2 GEOS framework v3.5.0-1 from KyngChaos Then in RStudio I typed install.packages("rgdal") which gave me this: > ....…
Stophface
  • 6,919
  • 16
  • 71
  • 152
19
votes
4 answers

How keep information from shapefile after fortify()

How can I keep polygons's information after shapefile? Let me try to explain: I have a shapefile with this data: > head(mapa@data) ID CD_GEOCODI TIPO CD_GEOCODB NM_BAIRRO CD_GEOCODS NM_SUBDIST CD_GEOCODD NM_DISTRIT CD_GEOCODM…
Rcoster
  • 3,040
  • 2
  • 14
  • 32
15
votes
1 answer

SpatialPolygons - Creating a set of polygons in R from coordinates

I am trying to take create a set of polygons from vertex locations, saved in X,Y format. Here is an example of my data - each row represents the vertices for one polygon. the polygons are squares square <- rbind(c(255842.4, 4111578, 255862.4,…
Leah Wasser
  • 673
  • 1
  • 6
  • 20
15
votes
5 answers

Converting latitude and longitude points to UTM

I found a fairly simple example of how to do this but I cant get it to work for me. I'm pretty new to R library(rgdal) xy <- cbind(c(118, 119), c(10, 50)) project(xy, "+proj=utm +zone=51 ellps=WGS84") [,1] [,2] [1,] -48636.65…
Colin
  • 161
  • 1
  • 1
  • 7
14
votes
4 answers

Read shape file with readOGR verses readShapePoly

I have read a shapefile using readShapePoly in the maptools package, but cannot read that same file with readOGR. I am hoping someone may be able to help me read the shapefile with readOGR. I downloaded the file orcounty.shp from here:…
Mark Miller
  • 11,294
  • 21
  • 69
  • 119
12
votes
1 answer

Plotting a raster behind a shapefile

How can I plot a "raster" object behind a shapefile object? Both plot fine on their own but the points don't plot over the raster: require(rgdal) require(maptools) require(raster) myproj = "+proj=utm +zone=12 +north +ellps=WGS84 +units=m" shp =…
Benjamin
  • 10,449
  • 13
  • 64
  • 112
11
votes
3 answers

PROJ4 to PROJ6 upgrade and "Discarded datum" warnings

Context My questions are related to the changes induced by the upgrade from PROJ4 to PROJ6 and the consequences in various R spatial packages (sp, sf, raster). We receive now a lot of warnings about “Discarded datum” that looks a bit worrying and…
Gilles
  • 3,668
  • 13
  • 27
11
votes
1 answer

rgeos package installation error on linux [R]

I'm trying to install the package rgeos on linux. I get the following error: system("sudo apt-get update") system("sudo apt install libgdal-dev -y") install.packages("rgeos") collect2: error: ld returned 1 exit status configure: Install failure:…
Neal Barsch
  • 1,781
  • 7
  • 29
11
votes
1 answer

RGDAL won't install

I can't get RGDAL to install in R. I'm using Ubuntu 12.04. configure: error: gdal-config not found or not executable. ERROR: configuration failed for package ‘rgdal’ * removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.2/rgdal’ Warning in…
TheRealJimShady
  • 455
  • 1
  • 7
  • 18
11
votes
2 answers

Unable to install rgdal and rgeos R libraries on Red hat linux

I have error while compiling rgdal adn rgoes package on our redhat linux machine. I tried to do some research but couldn't find a possible solution. Could you please help me with this as this is very important for me to solve. **ERROR WHILE…
user2448881
  • 291
  • 1
  • 3
  • 7
10
votes
3 answers

Encoding of German umlauts when using readOGR

I'm trying to read an OGR vector map using the readOGR function provided by the rgdal package, but I'm having a little trouble with the German umlauts. I've provided a little example of what the data looks like, umlauts like ö are replaced with…
user2275786
10
votes
1 answer

rgdal / readOGR - unable to read shapefile from .zip

I'm trying to load a zip level shapefile to do some plotting, per: https://github.com/hadley/ggplot2/wiki/plotting-polygon-shapefiles http://www.nceas.ucsb.edu/scicomp/usecases/ReadWriteESRIShapeFiles etc My…
Alex W
  • 4,489
  • 4
  • 26
  • 52
9
votes
2 answers

updating Rgdal in R.3.5.1 C++11 dependency... although C++11 is available

When I am updating (or at least trying to) the rgdal package by compiling from source after updating R from 3.4.4 to 3.5.1, I run into the odd issue that all goes well, but the namespace load fails due to an "undefined symbol" error: ** installing…
FM Kerckhof
  • 1,130
  • 1
  • 11
  • 28
9
votes
2 answers

Merging Polygons in Shape Files with Common Tag IDs: unionSpatialPolygons

I am trying to read from a shape file and merge the polygons with a common tag ID. library(rgdal) library(maptools) if (!require(gpclib)) install.packages("gpclib", type="source") gpclibPermit() usa <- readOGR(dsn = "./path_to_data/",…
Rotail
  • 854
  • 12
  • 31
1
2 3
33 34