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

572 questions
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
  • 1,025
  • 4
  • 19
  • 40
9
votes
1 answer

how to export tm object without chart borders

I am trying to plot a map without the 'box border' around it. Does anybody know how to work around the tmap package to not print the 'outer box border'? - not to be confused with tm_borders as it is a segment plotting the border of the polygons in…
gemkeeper
  • 125
  • 2
  • 6
9
votes
4 answers

Convert latitude/longitude to state plane coordinates

I've got a dataset with latitude and longitude which I'd like to convert to the state plane coordinates for Illinois East, using EPSG 2790 (http://spatialreference.org/ref/epsg/2790/) or maybe ESRI 102672…
stackoverflax
  • 1,077
  • 3
  • 11
  • 25
9
votes
2 answers

Read only data slot from shapefile (R)?

I have some very large shapefiles. I can read them into SpatialPolygonsDataFrame's using the rgdal function readOGR, but it takes a very long time for each file. I am actually only interested in the data.frame that shows up in the @data slot. Is…
attitude_stool
  • 1,023
  • 1
  • 13
  • 18
8
votes
2 answers

R: SpatialPointsDataFrame code no longer working. Error in !res[[1]] : invalid argument type

I have been following this workflow to convert coordinates from Eastings / Northings to Latitude / Longitude in R. Up until today it has been working fine. Here is a reproducible example: require(rgdal) # create test coordinates x <- 259269 y <-…
RWard
  • 93
  • 1
  • 5
8
votes
0 answers

Error when installing SF in R double free or corruption

The problem I was trying to install SF again in my Ubuntu 18.04 machine, because it was giving me some problems. Since I wanted to start everything clean I tried the following: remove.packages("sf") install.packages("sf") This however resulted in…
Derek Corcoran
  • 3,930
  • 2
  • 25
  • 54
8
votes
1 answer

Unzipping and reading shape file in R without rgdal installed

I would like to unzip and read in a shape file from the web in R without relying on rgdal. I found the read.shp function of the fastshp package that can apparently accomplish this without rgdal installed in the environment, however, I'm having…
Cyrus Mohammadian
  • 4,982
  • 6
  • 33
  • 62
8
votes
5 answers

Configure error in rgdal "gdal-config"

I am currently running some species distribution modelling and richness mapping in R on a linux cluster. In order to run my analyses I need to install rgdal so that the raster function in my modelling package works correctly. I have installed proj4…
8
votes
1 answer

R: how to write a raster to disk without auxiliary file?

I'm writing a dataset to file in ERMapper format (.ers) using the Raster package in R, but I'm having issues with the resulting .aux.xml auxiliary file (which I'm actually not interested in). Simple example: rst <-…
dsp542
  • 83
  • 3
8
votes
2 answers

Leaflet R derivePolygons missing lat missing long

I am trying to plot the site of some disease-events data on a map. I use this to import the data: ByTown<-readOGR(dsn="C:/temp/lyme/Towns", layer="Towns", encoding = "UTF-8", verbose= FALSE) check the class: class(ByTown) #getting this result [1]…
sconfluentus
  • 4,693
  • 1
  • 21
  • 40
8
votes
2 answers

Projecting my shapefile data on leaflet map using R

I (on Win7) was trying to get my shapefile data (Here are the data files.) to be displayed using leaflet package. But without any success. I only get the background map tile but not my data. I am able to see my data in QGIS though. I got the…
Stat-R
  • 5,040
  • 8
  • 42
  • 68
8
votes
1 answer

How to convert NAD 83 coordinates to latitude and longitude with rgdal package?

I have coordinates, all of which should be located in DC, but I cannot figure out how to convert them from NAD 83 to latitude and longitude in R. I'm using the spTransform() function in the rgdal package and get an error about non-conformant…
Erik Shilts
  • 4,389
  • 2
  • 26
  • 51
7
votes
0 answers

What do these warning messages mean when reading shapefiles in R?

When I read in a shapefile with readOGR, the following warnings are raised. Warning messages: 1: In OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, ... : Discarded ellps WGS 84 in CRS definition: +proj=merc +a=6378137 +b=6378137…
Beau
  • 91
  • 1
  • 5
7
votes
1 answer

R: reading geotiff data straight from web url (httr::GET raw content)

I would like to create a RasterLayer from GeoTIFF data provided by a server. I'll query the server for this data using a httr::GET call (the data is provided on-demand, so in the application there won't be a url ending in .tif but a query…
7
votes
2 answers

Loading SpatialPolygonsDataFrame with Leaflet (for R) doesn't work

first of all I'm new to R so please bear with me. What I'm eventually trying to accomplish is to show an interactive map of Amsterdam with Leaflet. For that I'm using RGDAL to read shapefiles. This link contains the shapefiles of amsterdam. I'm…
JDH
  • 165
  • 2
  • 8
1
2
3
38 39