Introducing Crunchy Data Warehouse: A next-generation Postgres-native data warehouse. Crunchy Data Warehouse Learn more
Paul Ramsey
Paul Ramsey
Let's put that on a map!
PostGIS has so many cool features that it is possible to do full GIS analyses without ever leaving the SQL language, but... at the end of the day, you want to get those results, show that data, on the map.
The Crunchy Data geospatial team has been thinking about how to bring PostGIS to the web, and we established some basic principles:
Use the database, as much as possible.
The database already has a user model and security model.
The database can already generate output formats, like MVT
Paul Ramsey
Paul Ramsey
Where are you? Go ahead and figure out your answer, I'll wait.
No matter what your answer, whether you said "sitting in my office chair" or "500 meters south-west of city hall" or "48.43° north by 123.36° west", you expressed your location relative to something else, whether that thing was your office layout, your city, or Greenwich
Paul Ramsey
Paul Ramsey
While PostGIS includes lots of algorithms and functionality we have built ourselves, it also adds geospatial smarts to PostgreSQL by linking in specialized libraries to handle particular problems:
Paul Ramsey
Paul Ramsey
Parallel query has been a part of PostgreSQL since 2016 with the release of version 9.6 and in theory PostGIS should have been benefiting from parallelism ever since.
In practice, the complex nature of PostGIS has meant that very few queries would parallelize under normal operating configurations -- they could only be forced to parallelize using oddball
Paul Ramsey
Paul Ramsey
With the availability of MVT tile format in PostGIS via ST_AsMVT(), more and more people are generating tiles directly from the database. Doing so usually involves a couple common steps:
Paul Ramsey
Paul Ramsey
The raster functionality in PostGIS has been part of the main extension since it was introduced. When PostGIS 3 is released, if you want raster functionality you will need to install both the core postgis
extension, and also the postgis_raster
extension.
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_raster;
Paul Ramsey
Paul Ramsey
Vector tiles are the new hotness, allowing large amounts of dynamic data to be sent for rendering right on web clients and mobile devices, and making very beautiful and highly interactive maps possible.
Since the introduction of ST_AsMVT()
Paul Ramsey
Paul Ramsey
With the release of PostGIS 3.0, queries that ORDER BY
geometry columns will return rows using a Hilbert curve ordering, and do so about twice as fast.
Whuuuut!?!
The history of "ordering by geometry" in PostGIS is mostly pretty bad. Up until version 2.4 (2017), if you did ORDER BY
Paul Ramsey
Paul Ramsey
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. Being able to create useful GeoJSON is important for integrating different parts in a modern geoprocessing application.
PostGIS has had an ST_AsGeoJSON(geometry)
Paul Ramsey
Paul Ramsey
One of the most popular features of PostGIS 2.5 was the introduction of the "vector tile" output format, via the ST_AsMVT() function.
Vector tiles are a transport format for efficiently sending map data from a server to a client for rendering. The vector tile specification