Closed lucas-johnson closed 4 years ago
This error message is printed, but the raster is returned correctly. Should the message be a warning instead?
Hi @lucas-johnson . To answer your questions directly:
pgWriteRast
with constraints = TRUE
and reloaded without seeing that error?Since you used pgWriteRast
to write to PostGIS, and it looks like SRID was correctly(?) applied as 5070, it's not obvious to me why that error is showing. Could you check the SRID(s) returned from both the original raster, and the pgGetRast
-loaded raster?
r1 <- raster("original_raster_file")
pgSRID(conn, r1@crs) # Does this return `5070` ?
rgdal::showEPSG(as.character(r1@crs)) # what does this return?
r2 <- pgGetRast(conn, 'my_rasters')
pgSRID(conn, r2@crs) # This should produce the error you were seeing...
Error printing fix applied in 74a6ac7 , closing...
Context
pgWriteRast(..., constraints = FALSE)
. After all my rasters have been added to the db, I then manually run:I add constraints after loading all rasters because it takes too much time to add constraints while loading each individual raster.
Everything is added successfully:![image](https://user-images.githubusercontent.com/10555272/86012000-6fa8ad80-b9eb-11ea-8281-419356be869c.png)
Retrieving any of the rasters using
pgGetRast
does not work...Error
Question
create.srid = TRUE
? Or is this a bug?AddRasterConstraints
manually be enough?