-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
st_write: unable to append to a GeoPackage table #1126
Comments
What makes you think the GDAL GPKG driver has this capability? |
It works just fine with ogr2ogr duplicated.gpkg geom1.gpkg -append -update
ogr2ogr duplicated.gpkg geom1.gpkg -append -update
ogr2ogr duplicated.gpkg geom1.gpkg -append -update And back in print(st_read("duplicated.gpkg"))
#> Reading layer `foo' from data source `/home/greatemerald-local/shared/duplicated.gpkg' using #> driver `GPKG'
#> Simple feature collection with 6 features and 0 fields
#> geometry type: MULTIPOINT
#> dimension: XY
#> bbox: xmin: 0 ymin: 1 xmax: 2 ymax: 4
#> epsg (SRID): NA
#> proj4string: NA
#> Simple feature collection with 6 features and 0 fields
#> geometry type: MULTIPOINT
#> dimension: XY
#> bbox: xmin: 0 ymin: 1 xmax: 2 ymax: 4
#> epsg (SRID): NA
#> proj4string: NA
#> geom
#> 1 MULTIPOINT (0 1)
#> 2 MULTIPOINT (1 3, 2 4)
#> 3 MULTIPOINT (0 1)
#> 4 MULTIPOINT (1 3, 2 4)
#> 5 MULTIPOINT (0 1)
#> 6 MULTIPOINT (1 3, 2 4) |
Thanks - should work now! |
Yeap, seems to work well, thanks a lot! The printed output for Similarly, people may not expect that writing to a GPKG that exists would append data rather than overwrite or error, but in this case the printed output is pretty clear about what is happening, so that may be fine. |
I just ran into an edge-case bug in error reporting: if the file is read-only (e.g.
This is now a very confusing message as |
Thanks for including this very useful feature. Updating GPKG layers seems to work with Reading in test data
Using
Total of 3 features. Success! Now with
Only 2 features. The layer was overwritten instead of appended. |
Currently you have to specify |
I'm trying to figure out how to append rows to a GeoPackage (I am treating it as a database in this case). Following #624 and taking inspiration from one of the tests included in
sf
:Created on 2019-08-12 by the reprex package (v0.3.0)
For GPKG,
update
is already TRUE, so setting it doesn't really change anything. I don't want to overwrite the whole table, I want to append, so I don't think I should setOVERWRITE=YES
. And then usingappend=TRUE
, as it was mentioned in #624, results in a rather confusing errorunrecognized argument(s) TRUE
; this is actually another bug insf/R/read.R
Line 374 in 52a8351
names(list(...))
, notunlist(list(...))
, since the parameter name is what is relevant, not the value.So what should I do if I indeed just want to append to a table in a GPKG? I can't read the whole table, do an
rbind
, and write it, because it's a pretty huge GPKG (points throughout the globe) and the whole table doesn't easily fit into memory.The text was updated successfully, but these errors were encountered: