Closed crabel99 closed 4 years ago
Hi @crabel99 , see the dev branch, which already has this functionality - install with devtools
:
devtools::install_github("mablab/rpostgis", ref = "dev")
This update should get pushed to CRAN, hopefully in the next month or so. I'll leave this issue open until then.
Thank you. I will play around with it. As it stands I have a viable workaround (clunky but effective), so will likely wait for the CRAN release. It is nice to know that it is done and waiting on distribution.
As a random and unrelated question, is rpostgis
thread safe?
Thank you. I will play around with it. As it stands I have a viable workaround (clunky but effective), so will likely wait for the CRAN release. It is nice to know that it is done and waiting on distribution.
Now the new problem that I have is that pgWriteRast
won't append the rasters that I create to the temporary table. I have a large number of raster files I'm processing, on the order of tens of thousands. I can execute a db query to move the file from the one created by rpostgis
into a temporary table and recycle the names, but this increases the overhead on my database as each raster is written twice and read one extra time. An append
option would sure be helpful!
As a random and unrelated question, is rpostgis
thread safe?
I should have mentioned- append
for pgWriteRast
was also added to dev
at the same time as clauses
for pgGetRast
. If you are able to test, any usage at this point would be helpful to identify bugs prior to release.
I haven't tested multi-threading, and I would not assume rpostgis is thread-safe. It's possible that multi-threading pgInsert
or pgWriteRast
with append=TRUE
calls on a single table could cause issues.
eae1f09 Features have been added, now on CRAN (v1.4.3).
Thank you! I’ve been using the pre release version with no issue since your original response. Thank you for your work on this project!
pgGetRast
only allows the option of specifying a bounding box with theboundary
option. This limits program functionality. Adding aclauses
option would allow returning data based on a where clause, e.g.clauses="WHERE rid = 2"
similar to the approach taken inpgGetBoundary
. This would greatly simplify the workflow for dealing with tiled rasters, when raster aggregation causes problems due to memory constraints.As a note when I use
pgGetBoundary
to supplypgGetRast
,pgGetRast
behaves like it should but it complains about something that makes no sense...I get a return that looks like:
Adding
clauses
topgGetRast
would be super convenient!