rpostgis 1.6.0
OVERALL CHANGES
pgGetGeom(),pgGetBoundary()now use the SRID for defining the CRS instead of the proj4 code.pgWriteRast(): argumentprogresshave been removed.pgWriteGeom()now throws an error when CRS is undefined.Functions that return a
TRUEvalue, now return it invisibly (pgMakePts(), )Use of
clifor better user feedbackrasterandspare now suggested and not imported byrpostgisUse
lifecyclewarnings to encourage users to usesfandterra, and don’t usesporrasteranymore inrpostgis.pgSRID(): now throws an error when CRS is undefined
BUG FIXES
- Fix an error in
dbWriteDataFrame()that was causing data frames withdttmcolumns to be unable to be written to the database.
OTHER CHANGES
- Update website
rpostgis 1.5.1
CRAN release: 2023-11-20
BUG FIXES
Fix an error in
pgGetRastthat was provoking an error when the raster was not imported usingrpostgis.Now its required
terraversion >= 1.6.7.
OTHER CHANGES
The repository of
rpostgishas been transferred to a new location: https://github.com/Cidree/rpostgisThe website of the package is now located at http://cidree.github.io/rpostgis/
rpostgis 1.5.0
CRAN release: 2023-10-12
Remove startup message about upcoming retirement. New startup message informs about the sf/terra transition, and the new maintenance of the package which will be switched in the next update of the package.
OVERALL CHANGES
Transition of
rpostgisto thesf/terraecosystem.The functions
pgGet*have a new argumentreturnclass, and a function message to inform about the output class.The function
pgInserthas been deprecated in favour ofpgWriteGeom. The reason of this change is to keep naming consistency with other functions of the package. We added a function message to inform about the deprecation.pgGetBoundary: now returns asfcobject (i.e. a list-column with geometries) by default, and the new argumentreturnclassallows to choose alsoterraforSpatVectorobjects, orspforSpatial*objects.pgGetGeom: the argumentboundarynow accepts alsosfandSpatVectorobjects. The object returned by this function has changed to asfobject by default, and the new argumentreturnclassallows to choose alsoterraforSpatVectorobjects, orspforSpatial*objects.pgGetRast: added details about the functioning of the argumentbands; allowsfandSpatVectorobjects in the argumentboundary; the output of this function is now aterra SpatRasterby default, butrasterobjects can be specified by the new argumentreturnclass. Add an optional progress bar to measure the progress of the import.pgInsert: now it is possible to insertsfandSpatVectorobjects in the argumentdata.obj. It is also possible to insert any geometry type existing forsfobjects (i.e. simple and multi point, linestring, polygon, curve, surface; and other complex geometries such as compound curve, curve polygon and geometrycollection).pgWriteRast: the argumentrasternow acceptsSpatRasterobjects. The default value of theblocksargument works slightly different now. It uses the functionblocksof theterrapackage, which uses the number of copies of the data that may be in memory at any time. Since big rasters can take some time to write, an optional progress bar was added to this function.pgPostGIS: added a new argumentrasterto install the postgis_raster extension.
rpostgis 1.4.4
CRAN release: 2023-05-06
Added startup message to display message about upcoming package retirement in September 2023.
rpostgis 1.4.3
CRAN release: 2019-11-20
OVERALL CHANGES
- The
RPostgres::Postgres()driver can now be used as a connection. Whilerpostgisis functional with the driver, it should be considered experimental and may not function as expected in all cases. The defaultRPostgreSQL::PostgreSQL()driver is recommended for most use cases.
NEW FEATURES
pgWriteRast: Now allows insert withappend = TRUEto an existing PostGIS raster table. Note that any existing constraints are dropped for the insert, but re-created after insert (ifconstraints = TRUE). This allows more than one raster to be entered into a table. It is recommended to alter the raster names (names(raster) <-) prior to import to ensure each raster in a table has a unique entry in theband_namescolumn. SeepgGetRast’s newclausesargument for importing subsets of a raster table.pgGetRast: Aclausesargument allows to specify additional SQL (e.g.clauses = "WHERE band_names = '{{landcover_2010}}'") to select a specific subset of a raster table to import.
rpostgis 1.4.2
CRAN release: 2018-11-12
BUG FIXES
fixed bug affecting
pgWriteRast, affecting rasters with irregular x/y resolutions.fixed bug affecting
pgInsert, where single-part polygons with holes were counted as MultiPolygons, causing the geometry column to be defined as MultiPolygon. This did not affect import into the database, but caused an error when single-part polygons (without holes) were attempted to be inserted into the existing table.
rpostgis 1.4.1
CRAN release: 2018-08-17
DOCUMENTATION
rpostgisnow has a new home: https://mablab.org/rpostgis/Documentation prepared using
pkgdown.
BUG FIXES
- Fixed bug affecting
dbReadDataFrame, where datetimes were assigned the PostgreSQL time zone instead of the system timezone. This resulted in incorrect time assignments when the PostgreSQL time zone setting did not match the system’s time zone setting. Tables in PostgreSQL written bydbWriteDataFramewere not affected and have the correct time assigned.
rpostgis 1.4.0
CRAN release: 2017-12-10
NEW FEATURES
dbAddKeyanddbIndex: support added for keys and indexes referencing multiple columns.pgWriteRast: newblocksargument to specify exact number of desired blocks for the new raster in PostGIS table. Default block size (blocks = NULL) will retain previous functionality, though the minimum block size (rows or columns) was increased to 100 (previously 80).
BUG FIXES
-
pgWriteRast: fixed alignment issue affecting high-precision (generally decimal-degree unit) based raster writing, where PostGIS was not able to add a same alignment constraint to all tiles in the newly-created raster.
rpostgis 1.3.0
CRAN release: 2017-06-30
OVERALL CHANGES
- Example data removed, now part of extension package
rpostgisLT
NEW FUNCTIONS
-
pgListRastto list all raster columns in a PostGIS database
NEW FEATURES
pgGetRast: re-written for faster reading of rasters from the database. Multi-band raster import is now supported (bandargument changed tobands, and can be given a vector of integers, or TRUE to return all bands). Default is still to import the first band (1) of the raster. Multi-band rasters imported asRasterBrick-class objects. When raster blocks have imperfect alignment, PostGIS functionST_SnapToGridis applied to register the raster according to the upper left pixel of the full raster dataset.pgGetRast/pgWriteRast: now support sp-classSpatialGrid*andSpatialPixels*type objects. The class of the raster written in pgWriteRast is saved in a database column, and re-applied to the raster during import withpgGetRast.“Data frame mode” for Spatial* objects: now saves proj4string of Spatial* objects in data frame mode writing with
pgInsert. It is then re-imported usingpgGetGeom, if the saved proj4string and the database proj4string (defined by the column’s SRID) are equivalent. Otherwise, the database proj4string is used.pgGetRast/pgWriteRast: original R proj4string is saved in the raster database table, and re-imported, if the saved proj4string and the database proj4string (defined by the column’s SRID) are equivalent. Otherwise, the database proj4string is used.pgGetGeom: now includesboundaryparameter, to spatially subset GEOMETRY/GEOGRPAHY objects to return (same usage as inpgGetRast).pgGetBoundary: now includesclausesparameter, with same usage as inpgGetGeom
UPDATES
pgWriteRast: now attempts to write a new SRID tospatial_ref_sys, if one cannot be resolved from the raster’s proj4string.All query-constructor functions (e.g.
dbDrop) now return nothing (previously returned TRUE) ifexec = FALSE.pgGetGeom:other.cols = FALSEnow not necessary when reading only a geometry column (e.g., in query mode or from a one-column table).
BUG FIXES
pgWriteRast: fixed bug affecting imported raster’s metadata regarding the upper left pixel location (returned by PostGIS functionST_UpperLeftX/ST_UpperLeftY(rast)). Previously,pgWriteRastwas erroneously applying the lower left pixel location for this value. This did not affect the actual data of the raster, or their usage within PostGIS, however it could have affected export of this raster to external files, or viewing in a GIS.pgWriteRast: fixed bug where constraints were not written for tables given without a schema name inname.pgGetGeom: fixed bug for one-columnother.colsspecifications.dbReadDataFrame: infolocs columns of typePOSIXltnow re-import time zone attribute correctly (previously just used database time zone).
rpostgis 1.2.1
CRAN release: 2017-05-07
NEW FEATURES
- Support for PostGIS
GEOGRAPHYtypes added, inpgGetGeom,pgListGeom,pgGetBoundary,pgInsert. WithpgInsert, aSpatial*object can be uploaded to PostGIS as a geography usinggeog = TRUE.
BUG FIXES
pgInsertandpgWriteRast: fixed bug causing failed uploads when multiple PostGIS SRIDs found withpgSRIDfor a spatial object, now uses the first one returned.pgGetGeom: fixed bug when loading non-spatial columns with names ‘x’ or ‘y’ for point geometries.
UPDATES
-
pgGetRast:digitsargument default lowered to 5 (same asraster::rasterFromXYZ). Resolution of the raster is now determined using PostGIS functions and directly applied to the R raster. This allows (in some cases) for faster recognition of uneven cell sizes, which result in an error.
rpostgis 1.2.0
CRAN release: 2017-03-14
NEW FEATURES
pgGetGeom: newqueryargument allowspgGetGeomto specify a full SQL query which returns a GEOMETRY instead of an existing table/view. If desired, the query can be saved in the database as a new view using thenameargument.pgInsert: now can insert geometries stored as character indata.frames usingdf.geomargument.
BUG FIXES
- Add support for materialized views (read geometries with
pgGetGeom, drop withdbDrop).
rpostgis 1.1.1
CRAN release: 2017-01-18
BUG FIXES
pgGetGeom: fixed bug causing failed imports for views due to usage ofRPostgreSQL::dbListFields(changed torpostgis::dbTableInfo).fixed bug for data frame mode writing (e.g.,
pgInsert(...,df.mode = TRUE)anddbWriteDataFrame) where factor names included a comma.
rpostgis 1.1.0
CRAN release: 2017-01-06
OVERALL CHANGES
- Added four example datasets (all have prefix
roe_).
NEW FUNCTIONS
pgWriteRastto upload R Raster* datasets to PostGIS database tables.dbWriteDataFrame/dbReadDataFrame: Write/read in data frame mode to/from database table (see below).
NEW FEATURES
pgInsertcan write in data frame mode whendf.mode = TRUE(default isFALSE).pgInsertnow defaults to ‘alter.names = FALSE’.pgGetGeomwill try to read Spatial*DataFrames in data frame mode (will not affect import for non-data frame mode tables).pgGetRastnow has abandargument to select which band in the database raster to import.
BUG FIXES
-
pgGetGeom: Fix bug affecting one-column selections withother.colsargument for line and polygon imports.
ABOUT DATA FRAME MODE
Writing in data frame mode is only for new database tables (or for overwriting an existing one). It will save all column names as they appear in R, along with column data types and attributes. This is done by adding metadata to a lookup table in the table’s schema named ‘.R_df_defs’ (will be created if not present). It also adds two field with fixed names to the database table: ‘.R_rownames’ (storing the row.names of the data frame), and ‘.db_pkid’, which is a new integer primary key. Existing columns in the data.frame matching these names will be automatically changed.
All Spatial*DataFrames writing should continue to use pgInsert, which can write in data frame mode when df.mode = TRUE. For more flexible writing of Spatial*DataFrames and data.frames to the database (including all inserts into existing database tables), use pgInsert with df.mode = FALSE (default).
rpostgis 1.0.4
OVERALL CHANGE
- Add package tests to repository.
BUG FIXES
-
pgGetGeom: Fix bug which was causing errors when using ‘ORDER BY …’ statements in theclausesargument.
rpostgis 1.0.3
CRAN release: 2016-10-29
OVERALL CHANGE
- Only allow
for executed queries.
NEW FUNCTIONS
dbBuildTableQuery(internal): Builds CREATE TABLE query for a data frame object.dbExistsTable(internal): Check if a PostgreSQL table exists.dbConnCheck(internal): Check if a supported PostgreSQL connection.
rpostgis 1.0.2
CRAN release: 2016-09-26
OVERALL CHANGES
- Updated to use current search path schema as default in all functions (in previous versions default schema was fixed to ‘public’).
NEW FUNCTIONS
-
dbVersion(internal): PostgreSQL version checking.
NEW FEATURES
-
pgInsertnow provides ‘upsert’ functionality (INSERT ON CONFLICT UPDATE) with the ‘upsert.using’ argument. Requires PostgreSQL version 9.5+.
rpostgis 1.0.0
CRAN release: 2016-08-20
OVERALL CHANGES
- Initial release to CRAN.
NEW FEATURES
-
pgGetGeomnow handles all regular PostGIS Geometry data table imports.
rpostgis 0.10
OVERALL CHANGES
Big package cleaning.
Changed all non-PostGIS related functions to
db-instead ofpg-.All functions not returning an actual object now returns
TRUEif successful.
rpostgis 0.8.3
OVERALL CHANGE
Change ‘str’ to ‘query’
Now uses
messagesinstead ofcatto print SQL code.
rpostgis 0.8
NEW FUNCTIONS
-
pgPostGIS: Check and create PostGIS extension.
NEW FEATURES
-
pgSchema: Now returns TRUE if the schema exists (whether it was already available or was just created).
rpostgis 0.7
OVERALL CHANGES
- Initial merge with
pgis2rpackage, incorporating support for loading geometry/raster objects stored in PostgreSQL databases in R.
NEW FUNCTIONS
pgGetRast: Load raster from PostGIS database.pgGetLines: Load a PostGIS linestring geometry from a PostgreSQL table/view into R.pgGetPolys: Load a PostGIS polygon geometry from a PostgreSQL table/view into R.
rpostgis 0.5
OVERALL CHANGES
- Code completely commented and cleaned.
NEW FUNCTIONS
-
pgColumn: Add or remove a column (replacespgDropColumn).
rpostgis 0.3.1
OVERALL CHANGES
- Global change for
display = TRUEto print the executed or non-executed query.
