SlideShare a Scribd company logo
1 of 34
Download to read offline
1
POSTGIS,POSTGIS,
PGROUTING, ANDPGROUTING, AND
OTHER SPATIALOTHER SPATIAL
EXTENSIONSEXTENSIONS
REGINA OBE AND LEO HSUREGINA OBE AND LEO HSU
http://www.paragoncorporation.com
Buy our books! at http://postgis.us/page_buy_book
OUR LATEST BOOKOUR LATEST BOOK
pgRouting: A Practical Guide http://locatepress.com/pgrouting
2
WORLD OF POSTGRESQL SPATIAL EXTENSIONSWORLD OF POSTGRESQL SPATIAL EXTENSIONS
CREATE EXTENSION ...;
postgis
geometry (Planar Vector),
raster (pixels and values),
geography (Spheroidal Vector)
PostGIS
postgis_topology
support for connected
geometries
(relational geometry -
faces, edges, and nodes)
postgis_tiger_geocoder
geocoding and
reverse geocoding
usiing US Census TIGER data)
address_standardizer
rule-based extension
for standardizing
addresses.
postgis_tiger_geocoder
can use i and can be use alone
address_standardizer_data_us
rules for standardizing US
addresses
pointcloud
data types (pcpatch, pcpoint)
and functions
for managing point clouds
in postgres
pointcloud_postgis
Functions for converting between
PostGIS geometry
and pointcloud
patches and points
PGPOINTCLOUD
earthdistance
measurement between
points on a sphere
pg_sphere
support for spherical objects
like planets and managing
astronomical catalogs
spatial analysis functions
authored by Carto,
uses PostGIS and plpythonu
crankshaft
postgis_sfcgal
additional functions
for supporting 3D geometries
and advanced 2D functions
pgrouting
routing and graphs
e.g dijkstra,
traveling salesmam,
vehicle routing planner,
flow analysis
oracle_fdw
Foreign tables to Oracle
sdo_geometry get exposed
as postgis geometry
if postgis installed
ogr_fdw
foreign tables
to hundreds of
file, database,
webservice formats
spatial columns
can get mapped
to postgis geometry
3
WHAT IS POSTGIS?WHAT IS POSTGIS?
Spatial types: geometry, geography, raster, topogeometry (via
postgis_topology)
Lots of spatial functions: over 400 in core postgis extension for
proximity, time proximity, linear referencing, spatial
aggregation and other kinds of geometry processing, raster ->
vector conversion, vector to raster conversion, raster map
algebra and other raster analysis.
4
POSTGIS CAN TRANSFORM COORDINATE SYSTEMSPOSTGIS CAN TRANSFORM COORDINATE SYSTEMS
PostGIS allows you to transform between coordinate systems.
spatial_ref_sys table - This is how PostGIS knows how to
transform geometric coordinates from one spatial system to
another.
ST_Transform function - the function that transforms one
set of coordinates to another spatial reference system
coordinate space.
ST_SRID, ST_SetSRID - sets the meta data on a
geometry/raster
geography type coordinate are always in degrees and to get
measurements in meters, some planetary spheroid
assumption is required looked up in spatial_ref_sys.
5
POSTGIS GEOMETRY TYPEPOSTGIS GEOMETRY TYPE
The flat space model. The world is a cartesian grid. Supports
drawing of linestrings, polygons, 3D polygons, points, 3d
points, collections of polygons, points, linestrings, Polyhedral
Surfaces, and TINS
Basic geometric
types
Polyhedral
Surface
Triangulated Irregular
Network (TIN)
6
POSTGIS GEOGRAPHY TYPEPOSTGIS GEOGRAPHY TYPE
Model of space as spheroid. Takes into consideration the earth
or any given planet whose spatial reference is defined in
spatial_ref_sys table.
GEODETIC (GEOGRAPHY) 4326GEODETIC (GEOGRAPHY) 4326
(WGS 84 LON LAT) IN GEOGRAPHY(WGS 84 LON LAT) IN GEOGRAPHY
7
POSTGIS RASTER TYPEPOSTGIS RASTER TYPE
Model of space as a numeric matrix (with cells (called pixels)
that have values (on) or don't have values (off))
Elevation
Soil
Weather
Fire
8
RASTERS HAVE BANDSRASTERS HAVE BANDS
Bands / Channels -- correspond to the matrices in raster. For
example an RGB picture has 3 matrices.
Band pixel value types: 1BB (boolean), [2, 4, 8, 16, 32]BUI
(bit unsigned integer), [8, 16, 32]BSI (bit signed integer),
[32,64] BF (bit float)
Original
raster
ST_Band(rast,
'{2,1,1}'::int[])
ST_Band(rast,3)
9
RASTER TYPE AND GEOMETRY TYPE INTEROPERATERASTER TYPE AND GEOMETRY TYPE INTEROPERATE
SELECT ST_AsPNG(ST_Resize(ST_Union(ST_Clip(rast, geom)), 0.20,0.20)), count(*)
FROM aerials_200_200 AS a,
ST_Expand(
ST_Transform(ST_SetSRID(ST_Point(-78.6404,35.77627),4326),
2264),500) As geom
WHERE ST_Intersects(a.rast,geom);
Using aerials: 4 secs (1 row), aerials_200_200: 5.9 sec (120 rows)
o_4_aerials resize 0.5 (980ms 1 row)
Using o_4_aerials resize 0.2, 2000 ft - 5.7 secs
10
POSTGIS TOPOGEOMETRY TYPEPOSTGIS TOPOGEOMETRY TYPE
The topogeometry is how topology represents a geometry. It is
a reference to a bunch of edges, nodes, and faces that make
up the geometry.
CREATE EXTENSION postgis_topology;
Geometry simplification Topogeometry simplification
11
ADDRESS STANDARDIZATION / GEOCODING / REVERSEADDRESS STANDARDIZATION / GEOCODING / REVERSE
GEOCODINGGEOCODING
PostGIS since 2.2 comes with extension address_standardizer.
Also included since PostGIS 2.0 is postgis_tiger_geocoder
(only useful for US).
CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION address_standardizer;
CREATE EXTENSION address_standardizer_data_us;
12
ADDRESS STANDARDIZATIONADDRESS STANDARDIZATION
Need to install address_standardizer,
address_standardizer_data_us extensions (both packaged with
PostGIS 2.2+). Using json to better show non-empty fields
SELECT *
FROM json_each_text(to_json(standardize_address('us_lex', 'us_gaz','us_rules'
, 'One Seaport Lane',
'Boston, Massachusetts 02210' )))
WHERE value > '';
key | value
-----------+---------------
house_num | 1
name | SEAPORT
suftype | LANE
city | BOSTON
state | MASSACHUSETTS
postcode | 02210
(6 rows)
Same exercise using the packaged postgis_tiger_geocoder
tables that standardize to abbreviated instead of full name
SELECT *
FROM json_each_text( to_json(
standardize_address('tiger.pagc_lex', 'tiger.pagc_gaz','tiger.pagc_rules'
, 'One Seaport Lane',
'Boston, Massachusetts 02210' )))
WHERE value > '';
key | value
-----------+---------
house_num | 1
name | SEAPORT
suftype | LN
city | BOSTON
state | MA
postcode | 02210
(6 rows)
13
14
GEOCODING USING POSTGIS TIGER GEOCODERGEOCODING USING POSTGIS TIGER GEOCODER
Given a textual location, ascribe a longitude/latitude. Uses
postgis_tiger_geocoder extension requires loading of US
Census Tiger data.
SELECT pprint_addy(addy) As address,
ST_X(geomout) AS lon, ST_Y(geomout) As lat, rating
FROM geocode('1 Seaport Lane, Boston, MA 02210',1);
address | lon | lat | rating
--------------------------------+-------------------+------------------+--------
1 Seaport Ln, Boston, MA 02210 | -71.0411493412951 | 42.3497520198983 | 0
(1 row)
15
REVERSE GEOCODINGREVERSE GEOCODING
Given a longitude/latitude or GeoHash, give a textual
description of where that is. Using postgis_tiger_geocoder
reverse_geocode function
SELECT pprint_addy(addrs) AS padd,
array_to_string(r.street,',') AS cross_streets
FROM reverse_geocode(ST_Point(-71.04115,42.34975)) AS r
, unnest(r.addy) As addrs;
padd | cross_streets
--------------------------------+---------------
Northern Ave, Boston, MA | Seaport Ln
5 Seaport Ln, Boston, MA 02210 | Seaport Ln
(2 rows)
16
WHAT ARE POINT CLOUDS?WHAT ARE POINT CLOUDS?
A cloud of points where each point can have many numeric
attribute associated with it. It is collected by satellites, drones,
and planes and used to develop the other forms of data raster
and vector. Most popular format is LiDAR (Light detection and
Ranging).
17
CREATE EXTENSION pointcloud SCHEMA postgis;
CREATE EXTENSION pointcloud_postgis SCHEMA postgis;
HOW TO STORE POINTCLOUDS IN POSTGRESQLHOW TO STORE POINTCLOUDS IN POSTGRESQL
PostGIS Bundle for windows (EDB) includes this extension. Will
install both pointcloud and pointcloud_postgis as well as
postgis if it isn't already installed.
18
POSTGRESQL + GDAL (OGR) ~ POSTGIS = OGR_FDWPOSTGRESQL + GDAL (OGR) ~ POSTGIS = OGR_FDW
POSTGRESQL FOREIGN DATA WRAPPERPOSTGRESQL FOREIGN DATA WRAPPER
Doesn't require PostGIS to use, but will expose spatial columns
as PostGIS geometry if PostGIS is installed.
19
USE OGR_FDW EXTENSIONUSE OGR_FDW EXTENSION
If you have all sorts of data of both a spatial and non-spatial
flavor to tame, make sure you have ogr_fdw foreign data
wrapper in your tool belt.
For windows users using EDB distribution, it's part of
PostGIS bundle (versions 2.2 and up) on application
stackbuilder.
For windows/linux/mac desktop users, it's part of the BigSQL
PostGIS package.
For CentOS/Red Hat/Scientific etc, it's available via
yum.postgresql.org
For others, if you have PostGIS with GDAL support, just need
postgresql dev package to compile. Download the source
https://github.com/pramsey/pgsql-ogr-fdw
20
WHY IS OGR_FDW SO GREAT?WHY IS OGR_FDW SO GREAT?
You have the combined power of Geospatial Data Abstraction
Layer (GDAL), PostgreSQL, and any PostgreSQL extension you
want (including PostGIS) working seamlessly together. So
many kinds of data you can query and take advantage of
PostgreSQL functions and any extension functions and types
such as PostGIS, hstore, built-in json/jsonb to tame your data.
Spreadsheets
ODBC datasources
Other relational
OSM files (OSM,
PBF)
Dbase files
ESRI Shapefiles
Spatial web services
Many more
21
ENABLE IT IN YOUR DATABASEENABLE IT IN YOUR DATABASE
CREATE EXTENSION ogr_fdw;
22
OTHER RELATIONAL DATABASESOTHER RELATIONAL DATABASES
Format for SQL Server ODBC
'ODBC:your_user/your_password@yourDSN,table1,table2'.
ODBC can be slow with a lot of tables (more than 150) so filter
list if you have over 200 tables
CREATE SERVER svr_sqlserver FOREIGN DATA WRAPPER ogr_fdw
OPTIONS (datasource 'ODBC:pguser/whatever@MSSQLTest,dbo.IssueLog,dbo.IssueNotes',
format 'ODBC'
);
CREATE SCHEMA IF NOT EXISTS ss;
IMPORT FOREIGN SCHEMA "dbo."
FROM SERVER svr_sqlserver INTO ss;
dE ss.*
List of relations
Schema | Name | Type | Owner
--------+----------------+---------------+----------
ss | dbo_issuelog | foreign table | postgres
ss | dbo_issuenotes | foreign table | postgres
(2 rows)
23
LINK IN A WHOLE FOLDER OF ESRILINK IN A WHOLE FOLDER OF ESRI
SHAPEFILES AND DBASE FILESSHAPEFILES AND DBASE FILES
CREATE SERVER svr_shp FOREIGN DATA WRAPPER ogr_fdw
OPTIONS (datasource 'C:/fdw_data/massgis/shps',
format 'ESRI Shapefile'
);
CREATE SCHEMA shps;
-- this is a PostgreSQL 9.5 feature
IMPORT FOREIGN SCHEMA ogr_all
FROM SERVER svr_shp INTO shps;
dE shps.*
List of relations
Schema | Name | Type | Owner
--------+---------------------+---------------+----------
shps | biketrails_arc | foreign table | postgres
shps | towns_arc | foreign table | postgres
shps | towns_poly | foreign table | postgres
shps | towns_poly_areacode | foreign table | postgres
shps | towns_polym | foreign table | postgres
shps | towns_pop | foreign table | postgres
shps | zipcodes_nt_poly | foreign table | postgres
(7 rows)
24
SPREADSHEETSSPREADSHEETS
Each workbook is considered a server and each sheet a table
CREATE SERVER svr_currency_rates
FOREIGN DATA WRAPPER ogr_fdw
OPTIONS (datasource '/fdw_data/ExchangeRates.xlsx',format 'XLSX',
config_options 'OGR_XLSX_HEADERS=FORCE');
CREATE SCHEMA staging;
-- link only 2 spreadsheets preserve headers
IMPORT FOREIGN SCHEMA ogr_all LIMIT TO (EUR, USD)
FROM SERVER svr_currency_rates INTO staging
OPTIONS (launder_column_names 'false');
Before SELECT * FROM staging.usd;
fid | Date | AED | ARS | AUD | BGN | GBP | CAD | CNY |
-----+------------+---------+---------+---------+---------+----------+---------+--------+---
2 | 2017-11-27 | 3.6729 | 17.3012 | 1.3147 | 1.6418 | 0.749935 | 1.27446 | 6.5989 | 0
3 | 2017-11-28 | 3.6728 | 17.3421 | 1.31255 | 1.6462 | 0.755895 | 1.28042 | 6.6074 |
4 | 2017-11-29 | 3.6729 | 17.4461 | 1.32052 | 1.6489 | 0.74437 | 1.2855 | 6.6145 | 0
5 | 2017-11-30 | 3.67295 | 17.3674 | 1.32005 | 1.64275 | 0.74061 | 1.28896 | 6.6133 | 0
6 | 2017-12-01 | 3.673 | 17.2453 | 1.31105 | 1.6413 | 0.739945 | 1.2702 | 6.6162 | 0
:
-- unpivot
SELECT f."Date" As date, 'USD' AS from_cur,
j.key AS to_cur, j.val::numeric As cur_rate
FROM staging.usd AS f, jsonb_each_text(to_jsonb(f)) AS j(key,val)
WHERE j.key NOT IN('fid', 'Date');
After
date | from_cur | to_cur | cur_rate
-----------+----------+--------+----------
2017-11-27 | USD | AED | 3.6729
2017-11-27 | USD | ARS | 17.3012
2017-11-27 | USD | AUD | 1.3147
2017-11-27 | USD | BGN | 1.6418
:
25
PGROUTING LIVE DEMOSPGROUTING LIVE DEMOS
26
POSTGIS GROWS WITH POSTGRESQLPOSTGIS GROWS WITH POSTGRESQL
Memorable recent moments of change in PostgreSQL that
elevated PostGIS.
Aggregate ORDER BY clause introduced in PostgreSQL 9.0
Extension model in PostgreSQL 9.1
LATERAL support in PostgreSQL 9.3 added
Lots more things depend on PostGIS
True K-Nearest Neighbor (KNN) support for GIST in
PostgreSQL 9.5/ PostGIS 2.2
Parallelism got added in PostgreSQL 9.6, functions such as
ST_Intersects took advantage in 2.4, coming in PostGIS 2.5
ST_AsMVT aggregate function revised to allow parallel
splitting.
JIT Support coming in PostgreSQL 11, PostGIS 2.5.0alpha
has JIT support.
27
POSTGIS AGGREGATES GET ELEVATED WITH ORDER BYPOSTGIS AGGREGATES GET ELEVATED WITH ORDER BY
IN 9.0IN 9.0
Before aggregate ORDER BY
SELECT vehicle, ST_MakeLine(geom) As path
FROM (SELECT geom, vehicle FROM gps_points ORDER BY vehicle, gps_time) AS f
GROUP BY vehicle;
After aggregate ORDER BY
SELECT vehicle, ST_MakeLine(geom ORDER BY gps_time) As path
FROM gps_points
GROUP BY vehicle;
28
POSTGIS EMBRACES THE EXTENSION MODEL IN 9.1POSTGIS EMBRACES THE EXTENSION MODEL IN 9.1
Before CREATE EXTENSION
Find where your package install put the PostGIS scripts.
After CREATE EXTENSION
Install in your database
CREATE EXTENSION postgis;
Upgrade
ALTER EXTENSION postgis UPDATE;
29
LATERAL SIMPLIFIES POSTGIS QUERIESLATERAL SIMPLIFIES POSTGIS QUERIES
Before LATERAL
SELECT p1.name, (gp).geom,
(gp).path[1] As line_index, (gp).path[2] As pt_index
FROM (SELECT name, ST_DumpPoints(geom) AS gp
FROM roads) As p1;
After LATERAL
SELECT p1.name, gp.geom,
gp.path[1] As line_index, gp.path[2] As pt_index
FROM roads As p1, ST_DumpPoints(p1.geom) AS gp;
30
LOTS OF THINGS DEPEND ON POSTGISLOTS OF THINGS DEPEND ON POSTGIS
Restores fail.
Partial Solution: PostGIS changes from being a relocatable
extension to being non-relocatable in 2.3
Indexes and Constraints depend on PostGIS, restore of these
fail, which makes data restore fail
Materialized views require PostGIS, restore fails
Other Extensions require PostGIS, restore fails
Logical decoding requires PostGIS, logical decoding fails
Foreign tables require PostGIS
31
TRUE KNN SIMPLIFIES POSTGIS QUERIESTRUE KNN SIMPLIFIES POSTGIS QUERIES
Before 9.5 / PostGIS 2.2 (no true KNN)
2 closest roads to each point of interest
WITH c AS ( SELECT p.name AS p_name, r.name AS r_name, ST_Distance(p.geom, r.geom
FROM pois AS p INNER JOIN roads AS r ON ST_DWithin(p.geom, r.geom, 50) ),
c2 AS (SELECT p_name, r_name, dist, ROW_NUMBER() OVER(PARTITION BY p_name ORDER B
FROM c2)
SELECT p_name, r_name, dist
FROM c2 WHERE rn < 3;
After True KNN with LATERAL
SELECT p.name AS p_name, r.name AS r_name, r.dist
FROM pois AS p,
LATERAL (SELECT r.name, r.geom <-> p.geom AS dist
FROM roads ORDER BY dist LIMIT 2) AS r;
32
POSTGRESQL 9.6 ADDS PARALLEL SUPPORTPOSTGRESQL 9.6 ADDS PARALLEL SUPPORT
Queries didn't change, but some got a lot faster. Like
ST_Intersects checks could be done in parallel. PostGIS
2.5.0alpha recently released with first parallel aggregate
ST_AsMVT. Can build Mapbox Vector Tiles in parallel mode and
recombine the final output.
33
POSTGRESQL 11 ADDS JIT, POSTGIS 2.5 ADDS JITPOSTGRESQL 11 ADDS JIT, POSTGIS 2.5 ADDS JIT
Checkout PostGIS 2.5.0 alpha released recently. Still some
code to be committed.
https://trac.osgeo.org/postgis/ticket/4060
34
FINFIN
BUY OUR BOOKSBUY OUR BOOKS
HTTP://WWW.POSTGIS.USHTTP://WWW.POSTGIS.US

More Related Content

What's hot

Making Postgres Central in Your Data Center
Making Postgres Central in Your Data CenterMaking Postgres Central in Your Data Center
Making Postgres Central in Your Data CenterEDB
 
Overview of Postgres 9.5
Overview of Postgres 9.5 Overview of Postgres 9.5
Overview of Postgres 9.5 EDB
 
Evolving HDFS to a Generalized Distributed Storage Subsystem
Evolving HDFS to a Generalized Distributed Storage SubsystemEvolving HDFS to a Generalized Distributed Storage Subsystem
Evolving HDFS to a Generalized Distributed Storage SubsystemDataWorks Summit/Hadoop Summit
 
What and Why and How: Apache Drill ! - Tugdual Grall
What and Why and How: Apache Drill ! - Tugdual GrallWhat and Why and How: Apache Drill ! - Tugdual Grall
What and Why and How: Apache Drill ! - Tugdual Gralldistributed matters
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesBobby Curtis
 
오라클 DR 및 복제 솔루션(Dbvisit 소개)
오라클 DR 및 복제 솔루션(Dbvisit 소개)오라클 DR 및 복제 솔루션(Dbvisit 소개)
오라클 DR 및 복제 솔루션(Dbvisit 소개)Linux Foundation Korea
 
Online Upgrade Using Logical Replication
 Online Upgrade Using Logical Replication Online Upgrade Using Logical Replication
Online Upgrade Using Logical ReplicationEDB
 
patroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymentpatroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymenthyeongchae lee
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersNiko Neugebauer
 
There and back_again_oracle_and_big_data_16x9
There and back_again_oracle_and_big_data_16x9There and back_again_oracle_and_big_data_16x9
There and back_again_oracle_and_big_data_16x9Gleb Otochkin
 
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFSMySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFSMats Kindahl
 
Bucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing ShuffleBucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing ShuffleDatabricks
 
Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15Bobby Curtis
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for PostgresEDB
 
Custom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDBCustom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDBArangoDB Database
 

What's hot (20)

Making Postgres Central in Your Data Center
Making Postgres Central in Your Data CenterMaking Postgres Central in Your Data Center
Making Postgres Central in Your Data Center
 
Overview of Postgres 9.5
Overview of Postgres 9.5 Overview of Postgres 9.5
Overview of Postgres 9.5
 
Evolving HDFS to a Generalized Distributed Storage Subsystem
Evolving HDFS to a Generalized Distributed Storage SubsystemEvolving HDFS to a Generalized Distributed Storage Subsystem
Evolving HDFS to a Generalized Distributed Storage Subsystem
 
What and Why and How: Apache Drill ! - Tugdual Grall
What and Why and How: Apache Drill ! - Tugdual GrallWhat and Why and How: Apache Drill ! - Tugdual Grall
What and Why and How: Apache Drill ! - Tugdual Grall
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 
Ogg oracle goldengate-v3.0
Ogg oracle goldengate-v3.0Ogg oracle goldengate-v3.0
Ogg oracle goldengate-v3.0
 
오라클 DR 및 복제 솔루션(Dbvisit 소개)
오라클 DR 및 복제 솔루션(Dbvisit 소개)오라클 DR 및 복제 솔루션(Dbvisit 소개)
오라클 DR 및 복제 솔루션(Dbvisit 소개)
 
Online Upgrade Using Logical Replication
 Online Upgrade Using Logical Replication Online Upgrade Using Logical Replication
Online Upgrade Using Logical Replication
 
patroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymentpatroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deployment
 
LLAP: Sub-Second Analytical Queries in Hive
LLAP: Sub-Second Analytical Queries in HiveLLAP: Sub-Second Analytical Queries in Hive
LLAP: Sub-Second Analytical Queries in Hive
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & Developers
 
There and back_again_oracle_and_big_data_16x9
There and back_again_oracle_and_big_data_16x9There and back_again_oracle_and_big_data_16x9
There and back_again_oracle_and_big_data_16x9
 
HiveACIDPublic
HiveACIDPublicHiveACIDPublic
HiveACIDPublic
 
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFSMySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
 
Bucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing ShuffleBucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
 
Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for Postgres
 
Custom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDBCustom Pregel Algorithms in ArangoDB
Custom Pregel Algorithms in ArangoDB
 
HDFS tiered storage
HDFS tiered storageHDFS tiered storage
HDFS tiered storage
 
MODIS Land and HDF-EOS
MODIS Land and HDF-EOSMODIS Land and HDF-EOS
MODIS Land and HDF-EOS
 

Similar to Postgres Spatial Extensions Guide

2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial WorldGIS in the Rockies
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGISmleslie
 
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterStockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterACSG Section Montréal
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGISmleslie
 
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal OgudahGis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal OgudahMichael Kimathi
 
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRasterFOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRasterJorge Arevalo
 
20210301_PGconf_Online_GPU_PostGIS_GiST_Index
20210301_PGconf_Online_GPU_PostGIS_GiST_Index20210301_PGconf_Online_GPU_PostGIS_GiST_Index
20210301_PGconf_Online_GPU_PostGIS_GiST_IndexKohei KaiGai
 
오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGISJungHwan Yun
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your AppLinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your AppSteven Pousty
 
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
Sql Saturday Spatial Data Ss2008 Michael Stark   CopySql Saturday Spatial Data Ss2008 Michael Stark   Copy
Sql Saturday Spatial Data Ss2008 Michael Stark Copymws580
 
GeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxGeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxDatabricks
 
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1Chris Hill
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech ProjectsJody Garnett
 
Getting Started with Geospatial Data in MongoDB
Getting Started with Geospatial Data in MongoDBGetting Started with Geospatial Data in MongoDB
Getting Started with Geospatial Data in MongoDBMongoDB
 
Opensource gis development - part 2
Opensource gis development - part 2Opensource gis development - part 2
Opensource gis development - part 2Andrea Antonello
 

Similar to Postgres Spatial Extensions Guide (20)

2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGIS
 
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterStockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGIS
 
Gis Xke
Gis XkeGis Xke
Gis Xke
 
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal OgudahGis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
 
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRasterFOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
 
20210301_PGconf_Online_GPU_PostGIS_GiST_Index
20210301_PGconf_Online_GPU_PostGIS_GiST_Index20210301_PGconf_Online_GPU_PostGIS_GiST_Index
20210301_PGconf_Online_GPU_PostGIS_GiST_Index
 
오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS
 
Post gispguk
Post gispgukPost gispguk
Post gispguk
 
Concect postgis
Concect postgisConcect postgis
Concect postgis
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your AppLinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
 
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
Sql Saturday Spatial Data Ss2008 Michael Stark   CopySql Saturday Spatial Data Ss2008 Michael Stark   Copy
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
 
GeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxGeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony Fox
 
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech Projects
 
GeoMesa on Spark SQL: Extracting Location Intelligence from Data
GeoMesa on Spark SQL: Extracting Location Intelligence from DataGeoMesa on Spark SQL: Extracting Location Intelligence from Data
GeoMesa on Spark SQL: Extracting Location Intelligence from Data
 
Getting Started with Geospatial Data in MongoDB
Getting Started with Geospatial Data in MongoDBGetting Started with Geospatial Data in MongoDB
Getting Started with Geospatial Data in MongoDB
 
Opensource gis development - part 2
Opensource gis development - part 2Opensource gis development - part 2
Opensource gis development - part 2
 
Unit3 slides
Unit3 slidesUnit3 slides
Unit3 slides
 

More from EDB

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSEDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenEDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLEDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLEDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLEDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLEDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresEDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINEDB
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQLEDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLEDB
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesEDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoEDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJEDB
 

More from EDB (20)

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Postgres Spatial Extensions Guide

  • 1. 1 POSTGIS,POSTGIS, PGROUTING, ANDPGROUTING, AND OTHER SPATIALOTHER SPATIAL EXTENSIONSEXTENSIONS REGINA OBE AND LEO HSUREGINA OBE AND LEO HSU http://www.paragoncorporation.com Buy our books! at http://postgis.us/page_buy_book OUR LATEST BOOKOUR LATEST BOOK pgRouting: A Practical Guide http://locatepress.com/pgrouting
  • 2. 2 WORLD OF POSTGRESQL SPATIAL EXTENSIONSWORLD OF POSTGRESQL SPATIAL EXTENSIONS CREATE EXTENSION ...; postgis geometry (Planar Vector), raster (pixels and values), geography (Spheroidal Vector) PostGIS postgis_topology support for connected geometries (relational geometry - faces, edges, and nodes) postgis_tiger_geocoder geocoding and reverse geocoding usiing US Census TIGER data) address_standardizer rule-based extension for standardizing addresses. postgis_tiger_geocoder can use i and can be use alone address_standardizer_data_us rules for standardizing US addresses pointcloud data types (pcpatch, pcpoint) and functions for managing point clouds in postgres pointcloud_postgis Functions for converting between PostGIS geometry and pointcloud patches and points PGPOINTCLOUD earthdistance measurement between points on a sphere pg_sphere support for spherical objects like planets and managing astronomical catalogs spatial analysis functions authored by Carto, uses PostGIS and plpythonu crankshaft postgis_sfcgal additional functions for supporting 3D geometries and advanced 2D functions pgrouting routing and graphs e.g dijkstra, traveling salesmam, vehicle routing planner, flow analysis oracle_fdw Foreign tables to Oracle sdo_geometry get exposed as postgis geometry if postgis installed ogr_fdw foreign tables to hundreds of file, database, webservice formats spatial columns can get mapped to postgis geometry
  • 3. 3 WHAT IS POSTGIS?WHAT IS POSTGIS? Spatial types: geometry, geography, raster, topogeometry (via postgis_topology) Lots of spatial functions: over 400 in core postgis extension for proximity, time proximity, linear referencing, spatial aggregation and other kinds of geometry processing, raster -> vector conversion, vector to raster conversion, raster map algebra and other raster analysis.
  • 4. 4 POSTGIS CAN TRANSFORM COORDINATE SYSTEMSPOSTGIS CAN TRANSFORM COORDINATE SYSTEMS PostGIS allows you to transform between coordinate systems. spatial_ref_sys table - This is how PostGIS knows how to transform geometric coordinates from one spatial system to another. ST_Transform function - the function that transforms one set of coordinates to another spatial reference system coordinate space. ST_SRID, ST_SetSRID - sets the meta data on a geometry/raster geography type coordinate are always in degrees and to get measurements in meters, some planetary spheroid assumption is required looked up in spatial_ref_sys.
  • 5. 5 POSTGIS GEOMETRY TYPEPOSTGIS GEOMETRY TYPE The flat space model. The world is a cartesian grid. Supports drawing of linestrings, polygons, 3D polygons, points, 3d points, collections of polygons, points, linestrings, Polyhedral Surfaces, and TINS Basic geometric types Polyhedral Surface Triangulated Irregular Network (TIN)
  • 6. 6 POSTGIS GEOGRAPHY TYPEPOSTGIS GEOGRAPHY TYPE Model of space as spheroid. Takes into consideration the earth or any given planet whose spatial reference is defined in spatial_ref_sys table. GEODETIC (GEOGRAPHY) 4326GEODETIC (GEOGRAPHY) 4326 (WGS 84 LON LAT) IN GEOGRAPHY(WGS 84 LON LAT) IN GEOGRAPHY
  • 7. 7 POSTGIS RASTER TYPEPOSTGIS RASTER TYPE Model of space as a numeric matrix (with cells (called pixels) that have values (on) or don't have values (off)) Elevation Soil Weather Fire
  • 8. 8 RASTERS HAVE BANDSRASTERS HAVE BANDS Bands / Channels -- correspond to the matrices in raster. For example an RGB picture has 3 matrices. Band pixel value types: 1BB (boolean), [2, 4, 8, 16, 32]BUI (bit unsigned integer), [8, 16, 32]BSI (bit signed integer), [32,64] BF (bit float) Original raster ST_Band(rast, '{2,1,1}'::int[]) ST_Band(rast,3)
  • 9. 9 RASTER TYPE AND GEOMETRY TYPE INTEROPERATERASTER TYPE AND GEOMETRY TYPE INTEROPERATE SELECT ST_AsPNG(ST_Resize(ST_Union(ST_Clip(rast, geom)), 0.20,0.20)), count(*) FROM aerials_200_200 AS a, ST_Expand( ST_Transform(ST_SetSRID(ST_Point(-78.6404,35.77627),4326), 2264),500) As geom WHERE ST_Intersects(a.rast,geom); Using aerials: 4 secs (1 row), aerials_200_200: 5.9 sec (120 rows) o_4_aerials resize 0.5 (980ms 1 row) Using o_4_aerials resize 0.2, 2000 ft - 5.7 secs
  • 10. 10 POSTGIS TOPOGEOMETRY TYPEPOSTGIS TOPOGEOMETRY TYPE The topogeometry is how topology represents a geometry. It is a reference to a bunch of edges, nodes, and faces that make up the geometry. CREATE EXTENSION postgis_topology; Geometry simplification Topogeometry simplification
  • 11. 11 ADDRESS STANDARDIZATION / GEOCODING / REVERSEADDRESS STANDARDIZATION / GEOCODING / REVERSE GEOCODINGGEOCODING PostGIS since 2.2 comes with extension address_standardizer. Also included since PostGIS 2.0 is postgis_tiger_geocoder (only useful for US). CREATE EXTENSION postgis_tiger_geocoder; CREATE EXTENSION address_standardizer; CREATE EXTENSION address_standardizer_data_us;
  • 12. 12 ADDRESS STANDARDIZATIONADDRESS STANDARDIZATION Need to install address_standardizer, address_standardizer_data_us extensions (both packaged with PostGIS 2.2+). Using json to better show non-empty fields SELECT * FROM json_each_text(to_json(standardize_address('us_lex', 'us_gaz','us_rules' , 'One Seaport Lane', 'Boston, Massachusetts 02210' ))) WHERE value > ''; key | value -----------+--------------- house_num | 1 name | SEAPORT suftype | LANE city | BOSTON state | MASSACHUSETTS postcode | 02210 (6 rows)
  • 13. Same exercise using the packaged postgis_tiger_geocoder tables that standardize to abbreviated instead of full name SELECT * FROM json_each_text( to_json( standardize_address('tiger.pagc_lex', 'tiger.pagc_gaz','tiger.pagc_rules' , 'One Seaport Lane', 'Boston, Massachusetts 02210' ))) WHERE value > ''; key | value -----------+--------- house_num | 1 name | SEAPORT suftype | LN city | BOSTON state | MA postcode | 02210 (6 rows)
  • 14. 13 14 GEOCODING USING POSTGIS TIGER GEOCODERGEOCODING USING POSTGIS TIGER GEOCODER Given a textual location, ascribe a longitude/latitude. Uses postgis_tiger_geocoder extension requires loading of US Census Tiger data. SELECT pprint_addy(addy) As address, ST_X(geomout) AS lon, ST_Y(geomout) As lat, rating FROM geocode('1 Seaport Lane, Boston, MA 02210',1); address | lon | lat | rating --------------------------------+-------------------+------------------+-------- 1 Seaport Ln, Boston, MA 02210 | -71.0411493412951 | 42.3497520198983 | 0 (1 row)
  • 15. 15 REVERSE GEOCODINGREVERSE GEOCODING Given a longitude/latitude or GeoHash, give a textual description of where that is. Using postgis_tiger_geocoder reverse_geocode function SELECT pprint_addy(addrs) AS padd, array_to_string(r.street,',') AS cross_streets FROM reverse_geocode(ST_Point(-71.04115,42.34975)) AS r , unnest(r.addy) As addrs; padd | cross_streets --------------------------------+--------------- Northern Ave, Boston, MA | Seaport Ln 5 Seaport Ln, Boston, MA 02210 | Seaport Ln (2 rows)
  • 16. 16 WHAT ARE POINT CLOUDS?WHAT ARE POINT CLOUDS? A cloud of points where each point can have many numeric attribute associated with it. It is collected by satellites, drones, and planes and used to develop the other forms of data raster and vector. Most popular format is LiDAR (Light detection and Ranging).
  • 17. 17 CREATE EXTENSION pointcloud SCHEMA postgis; CREATE EXTENSION pointcloud_postgis SCHEMA postgis; HOW TO STORE POINTCLOUDS IN POSTGRESQLHOW TO STORE POINTCLOUDS IN POSTGRESQL PostGIS Bundle for windows (EDB) includes this extension. Will install both pointcloud and pointcloud_postgis as well as postgis if it isn't already installed.
  • 18. 18 POSTGRESQL + GDAL (OGR) ~ POSTGIS = OGR_FDWPOSTGRESQL + GDAL (OGR) ~ POSTGIS = OGR_FDW POSTGRESQL FOREIGN DATA WRAPPERPOSTGRESQL FOREIGN DATA WRAPPER Doesn't require PostGIS to use, but will expose spatial columns as PostGIS geometry if PostGIS is installed.
  • 19. 19 USE OGR_FDW EXTENSIONUSE OGR_FDW EXTENSION If you have all sorts of data of both a spatial and non-spatial flavor to tame, make sure you have ogr_fdw foreign data wrapper in your tool belt. For windows users using EDB distribution, it's part of PostGIS bundle (versions 2.2 and up) on application stackbuilder. For windows/linux/mac desktop users, it's part of the BigSQL PostGIS package. For CentOS/Red Hat/Scientific etc, it's available via yum.postgresql.org For others, if you have PostGIS with GDAL support, just need postgresql dev package to compile. Download the source https://github.com/pramsey/pgsql-ogr-fdw
  • 20. 20 WHY IS OGR_FDW SO GREAT?WHY IS OGR_FDW SO GREAT? You have the combined power of Geospatial Data Abstraction Layer (GDAL), PostgreSQL, and any PostgreSQL extension you want (including PostGIS) working seamlessly together. So many kinds of data you can query and take advantage of PostgreSQL functions and any extension functions and types such as PostGIS, hstore, built-in json/jsonb to tame your data. Spreadsheets ODBC datasources Other relational OSM files (OSM, PBF) Dbase files ESRI Shapefiles Spatial web services Many more
  • 21. 21 ENABLE IT IN YOUR DATABASEENABLE IT IN YOUR DATABASE CREATE EXTENSION ogr_fdw;
  • 22. 22 OTHER RELATIONAL DATABASESOTHER RELATIONAL DATABASES Format for SQL Server ODBC 'ODBC:your_user/your_password@yourDSN,table1,table2'. ODBC can be slow with a lot of tables (more than 150) so filter list if you have over 200 tables CREATE SERVER svr_sqlserver FOREIGN DATA WRAPPER ogr_fdw OPTIONS (datasource 'ODBC:pguser/whatever@MSSQLTest,dbo.IssueLog,dbo.IssueNotes', format 'ODBC' ); CREATE SCHEMA IF NOT EXISTS ss; IMPORT FOREIGN SCHEMA "dbo." FROM SERVER svr_sqlserver INTO ss; dE ss.* List of relations Schema | Name | Type | Owner --------+----------------+---------------+---------- ss | dbo_issuelog | foreign table | postgres ss | dbo_issuenotes | foreign table | postgres (2 rows)
  • 23. 23 LINK IN A WHOLE FOLDER OF ESRILINK IN A WHOLE FOLDER OF ESRI SHAPEFILES AND DBASE FILESSHAPEFILES AND DBASE FILES CREATE SERVER svr_shp FOREIGN DATA WRAPPER ogr_fdw OPTIONS (datasource 'C:/fdw_data/massgis/shps', format 'ESRI Shapefile' ); CREATE SCHEMA shps; -- this is a PostgreSQL 9.5 feature IMPORT FOREIGN SCHEMA ogr_all FROM SERVER svr_shp INTO shps; dE shps.* List of relations Schema | Name | Type | Owner --------+---------------------+---------------+---------- shps | biketrails_arc | foreign table | postgres shps | towns_arc | foreign table | postgres shps | towns_poly | foreign table | postgres shps | towns_poly_areacode | foreign table | postgres shps | towns_polym | foreign table | postgres shps | towns_pop | foreign table | postgres shps | zipcodes_nt_poly | foreign table | postgres (7 rows)
  • 24. 24 SPREADSHEETSSPREADSHEETS Each workbook is considered a server and each sheet a table CREATE SERVER svr_currency_rates FOREIGN DATA WRAPPER ogr_fdw OPTIONS (datasource '/fdw_data/ExchangeRates.xlsx',format 'XLSX', config_options 'OGR_XLSX_HEADERS=FORCE'); CREATE SCHEMA staging; -- link only 2 spreadsheets preserve headers IMPORT FOREIGN SCHEMA ogr_all LIMIT TO (EUR, USD) FROM SERVER svr_currency_rates INTO staging OPTIONS (launder_column_names 'false'); Before SELECT * FROM staging.usd; fid | Date | AED | ARS | AUD | BGN | GBP | CAD | CNY | -----+------------+---------+---------+---------+---------+----------+---------+--------+--- 2 | 2017-11-27 | 3.6729 | 17.3012 | 1.3147 | 1.6418 | 0.749935 | 1.27446 | 6.5989 | 0 3 | 2017-11-28 | 3.6728 | 17.3421 | 1.31255 | 1.6462 | 0.755895 | 1.28042 | 6.6074 | 4 | 2017-11-29 | 3.6729 | 17.4461 | 1.32052 | 1.6489 | 0.74437 | 1.2855 | 6.6145 | 0 5 | 2017-11-30 | 3.67295 | 17.3674 | 1.32005 | 1.64275 | 0.74061 | 1.28896 | 6.6133 | 0 6 | 2017-12-01 | 3.673 | 17.2453 | 1.31105 | 1.6413 | 0.739945 | 1.2702 | 6.6162 | 0 : -- unpivot SELECT f."Date" As date, 'USD' AS from_cur, j.key AS to_cur, j.val::numeric As cur_rate FROM staging.usd AS f, jsonb_each_text(to_jsonb(f)) AS j(key,val) WHERE j.key NOT IN('fid', 'Date'); After date | from_cur | to_cur | cur_rate -----------+----------+--------+---------- 2017-11-27 | USD | AED | 3.6729 2017-11-27 | USD | ARS | 17.3012 2017-11-27 | USD | AUD | 1.3147 2017-11-27 | USD | BGN | 1.6418 :
  • 26. 26 POSTGIS GROWS WITH POSTGRESQLPOSTGIS GROWS WITH POSTGRESQL Memorable recent moments of change in PostgreSQL that elevated PostGIS. Aggregate ORDER BY clause introduced in PostgreSQL 9.0 Extension model in PostgreSQL 9.1 LATERAL support in PostgreSQL 9.3 added Lots more things depend on PostGIS True K-Nearest Neighbor (KNN) support for GIST in PostgreSQL 9.5/ PostGIS 2.2 Parallelism got added in PostgreSQL 9.6, functions such as ST_Intersects took advantage in 2.4, coming in PostGIS 2.5 ST_AsMVT aggregate function revised to allow parallel splitting. JIT Support coming in PostgreSQL 11, PostGIS 2.5.0alpha has JIT support.
  • 27. 27 POSTGIS AGGREGATES GET ELEVATED WITH ORDER BYPOSTGIS AGGREGATES GET ELEVATED WITH ORDER BY IN 9.0IN 9.0 Before aggregate ORDER BY SELECT vehicle, ST_MakeLine(geom) As path FROM (SELECT geom, vehicle FROM gps_points ORDER BY vehicle, gps_time) AS f GROUP BY vehicle; After aggregate ORDER BY SELECT vehicle, ST_MakeLine(geom ORDER BY gps_time) As path FROM gps_points GROUP BY vehicle;
  • 28. 28 POSTGIS EMBRACES THE EXTENSION MODEL IN 9.1POSTGIS EMBRACES THE EXTENSION MODEL IN 9.1 Before CREATE EXTENSION Find where your package install put the PostGIS scripts. After CREATE EXTENSION Install in your database CREATE EXTENSION postgis; Upgrade ALTER EXTENSION postgis UPDATE;
  • 29. 29 LATERAL SIMPLIFIES POSTGIS QUERIESLATERAL SIMPLIFIES POSTGIS QUERIES Before LATERAL SELECT p1.name, (gp).geom, (gp).path[1] As line_index, (gp).path[2] As pt_index FROM (SELECT name, ST_DumpPoints(geom) AS gp FROM roads) As p1; After LATERAL SELECT p1.name, gp.geom, gp.path[1] As line_index, gp.path[2] As pt_index FROM roads As p1, ST_DumpPoints(p1.geom) AS gp;
  • 30. 30 LOTS OF THINGS DEPEND ON POSTGISLOTS OF THINGS DEPEND ON POSTGIS Restores fail. Partial Solution: PostGIS changes from being a relocatable extension to being non-relocatable in 2.3 Indexes and Constraints depend on PostGIS, restore of these fail, which makes data restore fail Materialized views require PostGIS, restore fails Other Extensions require PostGIS, restore fails Logical decoding requires PostGIS, logical decoding fails Foreign tables require PostGIS
  • 31. 31 TRUE KNN SIMPLIFIES POSTGIS QUERIESTRUE KNN SIMPLIFIES POSTGIS QUERIES Before 9.5 / PostGIS 2.2 (no true KNN) 2 closest roads to each point of interest WITH c AS ( SELECT p.name AS p_name, r.name AS r_name, ST_Distance(p.geom, r.geom FROM pois AS p INNER JOIN roads AS r ON ST_DWithin(p.geom, r.geom, 50) ), c2 AS (SELECT p_name, r_name, dist, ROW_NUMBER() OVER(PARTITION BY p_name ORDER B FROM c2) SELECT p_name, r_name, dist FROM c2 WHERE rn < 3; After True KNN with LATERAL SELECT p.name AS p_name, r.name AS r_name, r.dist FROM pois AS p, LATERAL (SELECT r.name, r.geom <-> p.geom AS dist FROM roads ORDER BY dist LIMIT 2) AS r;
  • 32. 32 POSTGRESQL 9.6 ADDS PARALLEL SUPPORTPOSTGRESQL 9.6 ADDS PARALLEL SUPPORT Queries didn't change, but some got a lot faster. Like ST_Intersects checks could be done in parallel. PostGIS 2.5.0alpha recently released with first parallel aggregate ST_AsMVT. Can build Mapbox Vector Tiles in parallel mode and recombine the final output.
  • 33. 33 POSTGRESQL 11 ADDS JIT, POSTGIS 2.5 ADDS JITPOSTGRESQL 11 ADDS JIT, POSTGIS 2.5 ADDS JIT Checkout PostGIS 2.5.0 alpha released recently. Still some code to be committed. https://trac.osgeo.org/postgis/ticket/4060
  • 34. 34 FINFIN BUY OUR BOOKSBUY OUR BOOKS HTTP://WWW.POSTGIS.USHTTP://WWW.POSTGIS.US