Closed Rekyt closed 7 years ago
@Rekyt
Thanks for using the package and letting us know about this. It was indeed a bug for all one-column imports, and thankfully an easy fix (ebcdfbdc74096bbbf380aae9642dbfced7beb47f)
It's now fixed in the master branch, and in the next CRAN version (to be released soon). Install with:
devtools::install_github("mablab/rpostgis")
Woah, that was fast, thanks ;)
By the way, I was considering using the sf
package because it implements an easy API for spatial objects and spatial database. You could maybe show how rpostgis
is different from it.
sf
is indeed a really nice package, and the current functional difference for (e.g.) sf::st_read_db
and rpostgis::pgGetGeom
is that sf returns sf
(new R vector standard) and rpostgis
returns Spatial*
(old R vector standard) objects. I haven't tested extensively but sf::st_read_db
will also offer a performance benefit most notable in large read/write operations. So pgGetGeom
/pgInsert
are likely to adopt these methods in the future.
About how rpostgis
is different, we that that was a good idea too, and we're now in the process of preparing a paper/vignette(s) that will get at where we think it is most useful, and how it fits in among spatial and database R packages, so stay tuned!
Hi, First thank you for building this package which is exactly what I was looking for as most database packages don't handle spatial objects.
However, when I want to extract a geometry with a single other column, there's problem because the returned data object is not a
data.frame
and I get this error:I couldn't make a reproducible example but here is a conceptual one.
my_table
If i want to retrieve all coords it works with:
but with a single column it breaks
Is there a way to fix that ? (for the moment I query two columns and get rid of one)