Questions tagged [rgdal]

R Bindings for the Geospatial Data Abstraction Library

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

Eurostat shapefiles plotting with errors

I am trying to plot interactive maps at the NUTS3 level. Initially I was using shapefiles that I constructed myself for the data in QGIS, however, when I tried to use them in R they rendered poorly ...
3
votes
1answer
30 views

error running readLAS() in lidR: 'new_proj_and_gdal' is not an exported object from 'namespace:rgdal'

I've just updated lidR to 3.1.1 and am now unable to load a .las file using readLAS(): las <- lidR::readLAS(paste(sfm_dir,"/","...
1
vote
0answers
16 views

Proper way to assign CRS in rgdal 1.5-23 [duplicate]

Perhaps my question has been already answered but if it did, I haven´t be able to find it. I´ve updated the rgal package to version 1.5-23 (GDAL 3.2.1 & PROJ 7.2.1) and when I run the following ...
0
votes
0answers
43 views

ogrListLayers cannot open data source

I recently updated R and all of it's packages, and my code for reading in the layers of a geodatabase no longer works. It works fine on my windows desktop, but doesn't work on my macbook (I change the ...
0
votes
0answers
13 views

Changing hasNoDataValue from TRUE to FALSE by using rgdal

I was wondering if there is a way in R to change hasNoDataValue from TRUE to FALSE. Basically I have a raster that, when using rgdal::GDALinfo('myraster.tif'), I can see that hasNoDataValue" = ...
0
votes
0answers
29 views

Running GDAL function in Rstudio to read File Geodatabase

I was able to install GDAL through Conda and run readOGR with the following steps. Programs needed: Rstudio (download available here: https://rstudio.com/products/rstudio/download/) Anaconda3 (...
0
votes
1answer
81 views

Subscript out of bounds error while mosaicking TIFFs together

I have just downloaded NDVI imagery from Google Earth Engine. The image was too big so it was divided into about 35 .tif files. Each tile has approximately 950 bands of NDVI values. I am now trying to ...
1
vote
0answers
18 views

Is it better to calculate area of a global raster using long/lat or using an equal area projection (e.g. Galls-Peters)?

I am trying to calculate the area of values in a global spanning raster with values of NA, 1, 2 or 3. I would like to know the total area of each category, however, the map is currently in lat long (...
1
vote
1answer
204 views

Unable to library “rgdal” and “gdalUtils” after upgrading to macOS big sur

I just upgraded my laptop to macOS big sur, but then I could not library "rgdal" and "gdalUtils". It threw me an error: Error: package or namespace load failed for ‘rgdal’ in dyn....
0
votes
1answer
189 views

Unable to find inherited method for function ‘crop’ for signature ‘“numeric” using R

I'm trying to iterate a crop and then a resampling process by using a for loop but I've faced some problems because I'd obtain an error message. Below is my code, then the error message #find all tifs ...
0
votes
0answers
153 views

Why does my rgdal discard datums?

I'm using rgdal to process rasters and shapefiles that contain CRS information [CH1903+ LV95 (EPSG2056) or CH1903 LV03 (EPSG:21781)]. For some reason part of the CRS information is always discarded (...
1
vote
1answer
33 views

Reading or creating empty shapefile in R

I have several polygon shapefiles that I need to merge into one using a loop in R. I want to start with an empty shapefile and merge it with the existing shapefiles. All shapefiles will be chacked ...
1
vote
2answers
185 views

How to convert MTM coordinates to WGS84 with R?

I have MTM coordinates in the following format df <- data.frame(xcentro = c(250605,250770,250871),ycentro = c(5186087,5185610,5186140)) and need them to be converted in the WGS84 format. I expect ...
0
votes
0answers
17 views

Are these sp files equal in terms of proj4string? Can I do some transformation of the proj4string?

summary(SCat_sp_E6) Object of class SpatialPolygonsDataFrame Coordinates: min max x -74.095072 -74.018988 y 4.647323 4.832934 Is projected: FALSE proj4string : [+proj=longlat +...
7
votes
3answers
390 views

sp::proj4string equivalent in the PROJ6 framework?

I am confused about the shift from PROJ4 to PROJ6 in the (relatively) recent versions of the spatial packages of R (and gdal for that matter). I used to use sp::proj4string() to get the projection ...
0
votes
0answers
130 views

How do I specify the CRS in light of the rgdal update?

My data (df) are in Africa Albers equal area projection: x_ y_ t_ id 704109. -3029239. 2015-05-12 09:28:00 A 703680. -3029412. 2015-05-12 10:00:00 A 703043. -3030028. ...
0
votes
1answer
107 views

Reprojecting GOES-16 data in R

I'm trying to plot GOES-16 data with world boundaries. Data comes from GOES-16 files such as this. Data comes with "GOES-R ABI fixed grid projection" reference system, which to my better ...
2
votes
1answer
49 views

Can not load spatial data from MSSQL on Linux

I have a table on the MS SQL server. I am trying to import the data in R using the rgdal package. I can import the table on Windows without any problems using the following code: readOGR(dsn = "...
1
vote
0answers
62 views

Installing rgdal - cannot solve dependencies

I am trying to build a docker image based on osgeo/gdal:ubuntu-XXXXX. However it keeps failing when trying to install rgdal. I've tried this on gdal-3.1.1/proj-7.1.0 and gdal-3.0.3/proj-6.3.0, as well ...
1
vote
0answers
153 views

Using rdgal on R- error- No GDAL installation found

I trying to map burnt area using hdf data. For this i have all the neccessary packages, including the rdgal pacakge. However when i type in my burnt area code, i get the response I have downloaded ...
1
vote
1answer
223 views

Error “projects.h file not found” while installing rgdal in R on Mac

I cannot install rgdal on MacBook with Catalina. I installed r using Brew and r is up to date. I have the gdal framework installed. I've tried to install rgdal from source, but I keep getting an ...
2
votes
1answer
104 views

r - Setting custom projection in PROJ >=5 paradigm

Before PROJ >=5.0, one could set a custom projection centered anywhere in the world by adjusting the +lon_0=and +lat_0= arguments in proj4string specification. For example, a projection centered on ...
1
vote
0answers
213 views

R can't work with ecw while gdal/qgis does. Ubuntu 20.04 config

I'm an Ubuntu 20.04 user with all configured to use .ecw raster format. I can read these files in QGIS (3.10) and work with them without a problem. This is what I get in console: $ gdalinfo --...
1
vote
0answers
169 views

Updating PROJ GEOS and GDAL in R

I have been having trouble linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.0. I have tried reinstalling sf, rgdal, raster, and rgeos packages. I still couldn't link to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.0. ...
0
votes
0answers
136 views

GDAL conflicts between GDAL and PostGIS versions in R

I'm trying to learn postgis and I'm using R as an interface to make queries under Linux. I'm using GEOS 3.8.0, GDAL 3.0.4 and PROJ 7.0.0. When everything is up-to-date my R ecosytem (sp, sf, rgdal) is ...
2
votes
1answer
595 views

Install latest GDAL on docker image of CentOS

I am trying to install gdal latest version on a docker image of CentOS. Below is the minimal code. # Start and connect . docker run --rm -it centos:latest bash yum -y upgrade yum -y install wget yum ...
0
votes
0answers
40 views

Get Nearest Grid Data Using Leaflet and R

I am trying to write a piece of code in R using the Leaflet, sf and rgdal libraries which will identify the closest grid cell to the user's click and retrieve the data associated with that grid cell. ...
0
votes
1answer
91 views

Erreur gdal_polygonize.py package ARfun with R

I'm a french student, in advance I'm sorry for my english. I'm installed the package APfun on R to transform Raster to Polygons with Appolygonize function. But I have a error : crownsPoly <- ...
0
votes
2answers
169 views

Using writeOGR on a list of SpatialPolygons

This question has been asked before, but I find the answer confusing since there are no reproducible examples that link the question and the answer, and the answer doesn't actually use the writeOGR ...
2
votes
1answer
448 views

R spatial: st_overlaps to subset also fully covered polygons?

I want to subset all polygons in fc1 completely or partially overlapping with fc2. But, the st_overlaps subsets only polygons that overlaps with the border of fc2, but skips the fully covered polygons....
0
votes
1answer
206 views

Mass conversion of .JP2 images to .TIF format in R

I need to convert a list of .jp2 files to .tif. I cannot do it manually since it is a large number of files. So I can't use: gdal_translate(path_vhr_imag_1, "splt1.tif") gdal_translate(...
8
votes
1answer
435 views

R spatial: Erase one polygon from another: correct use of `st_difference`?

I am trying to erase one shapefile from the other, similar to ArcGIS Erase tool: This worked pretty well with rgeos::gDifference(spdf1, spdf2), which needs as input geometry of ...
1
vote
1answer
83 views

Use geometry binary predicate list to subset simple feature object?

I am trying to create a new simple feature from two overlapping features. I want to subset all polygons that are fully or partially located within my buffer (red border). However, the st_overlaps ...
1
vote
1answer
26 views

Keep getting NAs when I run sp's over function on LatLon points on shapefile polygons

I am not sure why i am keep getting NA whenever I run the Over function with Latitude and Longitude point on the polygon from shapefile. Please note that this is first time for me doing the spatial ...
2
votes
1answer
58 views

Check if points overlap with polygon

I have data that maps lat lon of a storm for every day as follows (I have removed the day ID so it has only year and month) lat_lonDat <- structure(list(Latitude = c(9.1, 9.15755, 9.2, 9.21496, ...
7
votes
3answers
299 views

Find maximum extent out of list of shapefiles (in projected coordinate system) in R

I have a script where I crop a list of rasters by the extent of one of many shapefiles. So far all of by shapefiles have been such that I could manually select the one with the largest extent (i.e. ...
2
votes
2answers
153 views

Loading shapefiles for reprojection using sf

I'm trying to automate my workflow, but having trouble with one step. My data come as processed shapefiles saved in .RDA files; I load them to a PostGIS system, cleaning up little issues (spTransform()...
1
vote
0answers
158 views

Attributes encoding problem with rgdal::writeOGR

I performed an intersection of two SpatialPolygonsDataFrame on R (3.5.1) using raster::intersect. Here's the structure of the resulting SPDF attributes table > str(shp@data) 'data.frame': 944 ...
1
vote
1answer
426 views

Keep spatial lines intersecting spatial polygons using R?

I am trying to keep spatial Lines objects intersecting a spatial polygon in R. The intersect function from raster package is doing actually a crop. But what I need is to keep the lines intersecting a ...
0
votes
1answer
3k views

GDAL 2.4.2 from UbuntuGIS unstable broken because of missing libogdi.so.3.2? [closed]

After an unthoughtful apt-get update today, GDAL no longer works on my Ubuntu Machine (bionic) because libogdi.so.3.2 is missing: daniel@gin-nuest:~$ gdalinfo gdalinfo: error while loading shared ...
1
vote
1answer
55 views

Read Postgis geom available as string variable with R

I have a Postgis Database from which I query data. I know that I can use the rgdal::readOGR() function with the PG driver to get geoms from the database into R. However, I am also querying lots of ...
0
votes
1answer
599 views

How to get WMTS tile coordinates?

What can I do with the given information: I don't know where I am in the World having some particular tile. It's only an ocean (or sea). "https://services.arcgisonline.com/ArcGIS/rest/services/...
0
votes
1answer
745 views

Identify polygon grid in which the point belongs to?

I have a dataframe with 3 columns , which has my custom lat / long with a failure rate associated with each Lat / long head(df) Latitude Longitude Failure.rate 51.3 ...
1
vote
1answer
217 views

Trying to make calculation with gdal_calc.py?

I have a tif image that I'm trying to run gdal_calc.py. In the source file the values are between 1,118-9,704 and I want to divide all the values by 10,000 to get results between 0-1. This is the ...
0
votes
0answers
381 views

Convert DXF file to RasterLayer

I am an R user and have a .dwg file of city buildings that I wish to transform into a RasterLayer using the heights as elevation data. The metadata for the DXF file states: DXF File Metadata: ...
0
votes
0answers
49 views

GeoTools and PostGIS coordinate transformation gets different result [duplicate]

I've got a problem transforming coordinates. The result differs in PostGIS and GeoTools. I want to transform from EPSG:4326 to EPSG:3398. PostGIS: indicia=> select ST_AsText(ST_Transform(...
3
votes
1answer
307 views

gIntersection error: linearRing not created

I am trying to do something relatively simple but with large shapefiles. I have a shapefile of protected areas in the USA: and watershed boundaries: I want to calculate the percentage and ...
0
votes
1answer
41 views

Unable to plot in R some locations over a shapefile

I have a shapefile of polygons that I got from here, and a CSV file with longitude, latitude data (i.e. lon= -71.4; lat=42.5). The shapefile has the following CRS information: "+proj=lcc +lat_1=41....
1
vote
1answer
247 views

How to access GDAL utilities from command line using Rgdal installation? [closed]

I have just installed rgdal from within R install.packages("rgdal"). I can now successfully do library(rgdal) with the following message: Loading required package: sp rgdal: version: 1.3-9, (SVN ...
3
votes
1answer
2k views

Reading shapefile in R with shapefile function?

I want to read a shapefile(polyline) into R, using rgdal and raster packages. The code looks like: d<-file("/Volumes/Environment_layers/original/WaterRoad/Road.shp") o<-shapefile(d) but I got ...