Comments (12)
This works:
test <- data.frame(x=0, y=0, a=1)
pgInsert(conn, name=c("public", "test_table1"), data.obj=test)
pgMakePts(conn, name = c("public", "test_table1"), srid = 4326)
from rpostgis.
Hi Malcolm,
I'm not able to replicate the issue. Do you see any messages printed in the R console prior to the hang/crash?
from rpostgis.
Running using Rscript in a terminal gives the following:
Creating new table...
Using writeWKT from rgeos package...
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: rgeos::writeWKT(data.obj, byid = TRUE)
2: pgInsertizeGeom(data.obj, geom, create.table, force.match, conn, new.id, row.names, alter.names, partial.match, df.mode, geog)
3: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call)[1L] prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
7: try(pgi <- pgInsertizeGeom(data.obj, geom, create.table, force.match, conn, new.id, row.names, alter.names, partial.match, df.mode, geog))
8: pgInsert(conn, name = c("public", "test_table2"), data.obj = test)
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault (core dumped)
from rpostgis.
Same crash when writing spatial polygons when running:
e <- extent(c(0, 100, 0, 100))
e <- as(e, 'SpatialPolygons')
e <- SpatialPolygonsDataFrame(e, data=data.frame(a=1, b=2))
pgInsert(conn, name=c("public", "test_table3"), data.obj=e)
from rpostgis.
For points I can use the pgMakePts workaround, but for polygons I can't see a way to add a polygons column after writing a non-geometric data frame.
from rpostgis.
Could it be an issue with your rgeos
package? Try:
library(rgeos)
test <- data.frame(x=0, y=0, a=1)
coordinates(test) <- ~x + y
writeWKT(test)
[1] "POINT (0.0000000000000000 0.0000000000000000)"
If so you may need to check/re-install your system GEOS package.
from rpostgis.
Thanks. It looks like regos is the problem, but reinstalling did not fix it.
So not a problem with rpostgis.
Thanks for your help.
from rpostgis.
If you install the package wkb
, that would allow for limited use of pgInsert
(e.g. for single-part points and polygons). But for all other geometry types, it needs the rgeos
package and you'd still get the error. Good luck!
from rpostgis.
Working after building the latest system geos from source. Thanks for the package.
from rpostgis.
Good to see that the problem is solved! @imprompt, for the record, could your give your previous and current versions of geos
here (I understand the problem was not rgeos
but the geos
library directly)? Thanks!
from rpostgis.
yum install geos: installed v3.4.1, which caused problem
installed v3.7.0 from source to fix.
from rpostgis.
Thanks!
from rpostgis.
Related Issues (20)
- Error in pgCheckGeom(conn, name, geom) HOT 4
- ERROR: Geometry type (Polygon) does not match column type (MultiPolygon) HOT 3
- pgWriteRast SnapToGrid causes Raster resizing and mismatch HOT 2
- SSL mode with RPostgreSQL driver HOT 5
- pgInsert: No column name matches found in database table. HOT 2
- Support for RPostgres connection HOT 3
- Lines in raster after importing from Database HOT 7
- Feature Request: add clauses functionality to pgGetRast HOT 6
- terra support HOT 4
- pgGetRast() error HOT 3
- Error: PostGIS extension not available. (PostGIS is installed) HOT 1
- pgGetGeom() other.cols = TRUE by default restarts session HOT 1
- pgInsert using `sf` objects HOT 3
- Using "out db" cloud rasters for Cloud Optimize GeoTiff HOT 4
- Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 14
- About the future of `rpostgis` HOT 10
- dbSchema() returns NULL instead of FALSE when schema does not exist in database HOT 1
- pgWriteGeom() fails when writing a data frame with a timestamp column HOT 2
- Problem to install version 1.4.3 rpostgis in docker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpostgis.