Last week, the PostGIS development team released PostGIS 3.0.0. This release works with PostgreSQL 9.5-12 and GEOS >= 3.6. If developers are using postgis_sfcgal extension, they need to compile against SFCGAL 1.3.1 or higher.
The major change in the PostGIS 3.0.0 version is the raster functionality which has been broken out as a separate extension. Take a look at other breaking changes in this release below:
Breaking changes in PostGIS 3.0.0
- Raster support now in a separate extension – postgis_raster
- Extension library files no longer include the minor version. If developers need the old behavior, they can use the new configure switch –with-library-minor-version. This change is intended to smoothen future pg_upgrade since lib file names will not change between version 3.0, 3.1, 3.* releases.
- ND box operators (overlaps, contains, within, equals) will not look at dimensions that aren’t present in both operands. Developers will need to REINDEX their ND indexes after upgrade.
- Includes 32-bit hash fix (requires reindexing hash(geometry) indexes)
- Sorting now uses Hilbert curve and Postgres Abbreviated Compare.
New features in PostGIS 3.0.0
- PostGIS used to expose a SQL function named geosnoop(geometry) to test the cost of deserializing and re-serializing from the PostgreSQL backend. In this release they have brought that function back named as postgis_geos_noop(geometry) with the SFCGAL counterpart.
- Added ST_AsMVT support for Feature ID. ST_AsMVT transforms a geometry into the coordinate space of a Mapbox Vector Tile of a set of rows corresponding to a Layer. It makes best effort to keep and even correct validity and might collapse geometry into a lower dimension in the process.
- Added SP-GiST and GiST support for ND box operators overlaps, contains, within, equals. SP-Gist in PostGIS has been designed to support K Dimensional-trees and other spatial partitioning indexes.
- Added ST_3DLineInterpolatePoint. ST_Line_Interpolate_Point returns a point interpolated along a line.
- Introduced WAGYU to validate MVT polygons. Wagyu can be chosen at configure time to clip and validate MVT polygons. This library is faster and produces more correct results than the GEOS default, but it might drop small polygons. It will require a C++11 compiler and will use CXXFLAGS (not CFLAGS).
- With PostGIS 3.0, it is now possible to generate GeoJSON features directly without any intermediate code, using the new ST_AsGeoJSON(record) function. The GeoJSON format is a common transport format, between servers and web clients, and even between components of processing chains.
- Added ST_ConstrainedDelaunayTriangles SFCGAL function. This function returns a Constrained Delaunay triangulation around the vertices of the input geometry. This method needs SFCGAL backend, supports 3d media file and will not drop the z-index.
Additionally the team has done other enhancements in this release. To know more about this news, you can check out the official blog post by the PostGIS team.