48
PostGIS Vincent Picavet – Oslandia – www.oslandia.com

PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

  • Upload
    others

  • View
    20

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PostGIS

Vincent Picavet – Oslandia – www.oslandia.com

Page 2: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Post -G eographicalI nformationS ystem

Capture, create, store,analyze, share, visualize data related to space

Page 3: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PostGIS

Page 4: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PostGIS 2.0 is out !

(.. since 2012 ..)

Page 5: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

2012..

Page 6: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Internals

New serialization format

New geometry types (3D)Fix 2D only bounding boxesFix bytes alignment

New parsers

WKBWKT

Page 7: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder
Page 8: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Functions

Page 9: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PostGIS 2.1

Page 10: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Topology

Page 11: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder
Page 12: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Topology - Graphs

› Explicit relations between objects

› Graph representation

› OGC : Node / edge / face

› TopoGeometry datatype

› SQL/MM support

› Sandro Santilli – Toscane Region

Page 13: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder
Page 14: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Raster

Page 15: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Rasters

› Raster / vector analysis

› New datatype

› Looks like geometry

› But for rasters

› Multiresolution, multiband, tile coverage

› Import/export (GDAL)

› Functions

› Statistics, reprojection, edit, compute

› Vector/raster functions

› More & more functions & faster

Page 16: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Rasters

Page 17: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Indexing

Page 18: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Indexing - pick-split

› #define KOROTKOV_SPLIT 1

› « Double sorting-based node splitting algorithm for R-tree »

› Huh ?

› → Better bbox organization in indexes

(Suggestion of presentation)

Page 19: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

KNN-Search

› KNN-GIST search in PostgreSQL 9.1+

› Use indexes !

› Spatial nearest neighbors

SELECT name, gid FROM geonamesORDER BY

geom <-> st_setsrid(st_makepoint(-90,40),4326)LIMIT 10;

› Distance operator

› <-> or <#> : center or bbox

› Need to refine for non-point geometries

Page 20: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

SP-Gist

› « SP » = SPatial

› New PG index type

› Faster to read

› 3x faster to build

› Good fit for spatial data

› GSoC 2014

› OK for points, not for other geometries

Page 21: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

VODKA

› Korotkov, Bartunov, Sigaev

› create index .. using vodka

› Derivation of JSONB indexing

› R-Tree based on GiST as entry tree

› Use multiple boxes per polygons

Beware of the spaghetti monster killing your R-Trees !

Page 22: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Geocoding

Page 23: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PAGC in PostGIS

› Address standardizer as PG extension

› standardizer → PostGIS project

› Soon replace TIGER parts

› Later work on Next gen. Geocoder

› European addressing

› …

› Collaboration with PAGC team

› Stephen Woodbridge & Regina Obe

Page 24: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

3D

Page 25: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PostGIS 3D / SFCGAL

Page 26: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

SFCGAL functions

ST_3DIntersection

ST_Tesselate

ST_3DArea

ST_Volume

ST_3DUnion

ST_3DDifference

ST_Extrude

ST_ForceLHR

ST_Orientation

ST_MinkowskiSum

ST_StraightSkeleton

Page 27: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder
Page 28: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

2D Building Footprint

Straight Skeleton Extrusion & roof computation

Page 29: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

SFCGAL news

› create extension sfcgal ;

› Windows binaries

› Some more functions

› CI integration (regress, unit)

› Texture support

› More import/export, « GeoJSON 3D », CityGML

Page 30: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

SET postgis.backend = 'geos' ;

SET postgis.backend = 'sfcgal' ;

Page 31: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Viewer : Horao

› OpenSceneGraph-based

› Independant + QGIS plugin

› Synchronization with QGIS

› MNT, 3D, custom queries

› www.horao.net

Page 32: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Viewer : Cuardo

› Full WebGL viewer

› Mixed 2D/3D viewer/generator

› Using Three.js power

› GIS server with 3D webservices

› PostGIS companion

› 3D GIS Stack

Page 33: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PointCloud

Page 34: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PointCloud

› PostgreSQL extension + PostGIS

› Paul Ramsey – Natural resources Canada

› LIDAR - Huge point datasets

› N-Dimensional

› PDAL I/O

› Point patches

› Indexes

› Functions

Page 35: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder
Page 36: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Try it out

Page 37: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

docker-pggis

› Docker container for latest database GIS stuff

› Latest versions

› PG 9.4

› PostGIS 2.1.4 + SFCGAL

› PointCloud master

› PDAL

› Run everything in two lines

› Based on phusion baseimage

› Not for production !

docker build -t oslandia/pggis .docker run --rm -P --name pggis_test oslandia/pggis

https://github.com/vpicavet/docker-pggis

Page 38: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Oracle FDW

Page 39: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

oracle_fdw

› FDW for Oracle database (Laurenz Albe)

› NEW : Oracle Spatial support (Vincent Mora)

› Native, R+W, Fast !

› Points, lines & polygons

› Combine with Materialized V.

› Heterogeneous systems

› Migration

› ora2pg support

Page 40: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PG 9.x

Page 41: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

PG → PostGIS

› PG improvements → PostGIS benefits :-)

› Some parts :

› JSONB & GeoJSON

› Multimaster logical replication

› Postgres-XL ( parallel PG )

Page 42: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

What more ?

Page 43: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Other PostGIS stuff...

› Raster features

› Function interruptions in GEOS

› More formats

› Vector tiles

› ...

› 3D

› More functions

› Server-side services

› More functions

Page 44: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

That's (almost)

all

Page 45: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Thank them

Page 46: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder
Page 47: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

Thank you

Page 48: PostGIS - PgConf.Russia · PAGC in PostGIS › Address standardizer as PG extension › standardizer → PostGIS project › Soon replace TIGER parts › Later work on Next gen. Geocoder

[email protected]

@vpicavet

www.oslandia.com