[R-sig-Geo] reading geopackage gpkg with readOGR

Patrick Giraudoux p@tr|ck@g|r@udoux @end|ng |rom un|v-|comte@|r
Wed Apr 14 07:33:36 CEST 2021


Apologize to answer to myself, but this morning I had advise from a 
colleague who confirmed that *.gpkg files can be read straightfully with

st_read("trspixNarati_alt_UTM44.gpkg")

readOGR("trspixNarati_alt_UTM44.gpkg")

Trying again this morning, indeed, the file can be read as:

readOGR("trspixNarati_alt_UTM44.gpkg") # package in the working directory
readOGR("./Shapes/trspixNarati_alt_UTM44.gpkg") # package in the 
'Shapes' folder

Quite incomprehensible why it did not work yesterday...


Le 13/04/2021 à 08:35, Patrick Giraudoux a écrit :
>
> Dear listers,
>
> I did not find the way to open a geopackage using rgdal::readOGR.
>
> The package name is 'trspixNarati_alt_UTM44.gpkg' (with two companion 
> files: 'trspixNarati_alt_UTM44.gpkg-shm' and 
> 'trspixNarati_alt_UTM44.gpkg-wal') stored in a folder 'Shapes'
>
> The corresponding object should be a SpatialPointsDataFrame.
>
> I have tried several combinations (a bit blind) with
>
> readOGR("./Shapes/trspixNaratiUTM44_alt_UTM44.gpkg")
>
> readOGR("./Shapes/","trspixNaratiUTM44_alt_UTM44.gpkg")
>
> readOGR("./Shapes/","trspixNaratiUTM44_alt_UTM44")
>
> with no success...
>
> This link https://jsta.github.io/2016/07/14/geopackage-r.html gives 
> indications on the how to to it, but supposes that one knows a layer 
> name (which is not my case)
>
> Any idea about the syntax of this driver ?
>
> Best,
>
> Patrick
>


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list