I have a polygon layer (>600000 features) in a Spatialite database and I want to overcome to run out of RAM by selecting only the features I need for subsequent workflow.
I can connect to my Spatialite database using
RSQLite with the following code:
dbfile="Path/To/field.sqlite" sqlite=dbDriver("SQLite") con=dbConnect(sqlite,dbfile, loadable.extensions=TRUE )
I can also query my table and get an tabular output:
above1600<-dbGetQuery(con,"SELECT * from height_aspect where height >= 1600")
But I do not understand how to get a SpatialPolygon layer.
Do I have to convert the output or do I need to initialise the database as a spatial one?
I researched the web for a while but could not find anything that helps me.