SlideShare a Scribd company logo
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
Manage LiDAR
data with
PostgreSQL
is it possible?
www.2ndquadrant.com
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
Is the relational approach valid for LiDAR?Is the relational approach valid for LiDAR?
• The relational approach to the data:
– data organized in tuples
– tuples are part of tables
– tables are related to each other through constraints (PK, FK, etc.)
• If the number of tuples grows:
– indexes allow to reduce the complexity of a search to ~O(logN)...
– ...but they must be contained in RAM!
– OTHERWISE: the relational approach start to fail...
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
PostgreSQL & LiDAR dataPostgreSQL & LiDAR data
• PostgreSQL is a relational DBMS with an extension for LiDAR data:
pg_pointcloud
• Part of the OpenGeo suite, completely compatible with PostGIS
– two new datatype: pcpoint, pcpatch (compressed set of points)
• N points (with all attributes from the survey) → 1 patch → 1 record
– compatible with PDAL drivers to import data directly from .las
32b 32b 32b 16b
https://github.com/pgpointcloud/pointcloud
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
Relational approach to LiDAR data with PGRelational approach to LiDAR data with PG
• GiST indexing in PostGIS
• GiST performances:
– storage: 1TB RAID1, RAM 16GB, 8 CPU @3.3GHz,
PostgreSQL9.3
– index size ~O(table size)
– Index was used:
• up to ~300M points in bbox inclusion searches
• up to ~10M points in kNN searches
LiDAR size: ~O(109
÷1011
) → few % can be properly indexed!
http://www.slideshare.net/GiuseppeBroccolo/gbroccolo-foss4-geugeodbindex
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
A new index in PG: Block Range INdexingA new index in PG: Block Range INdexing
8kB8kB8kB8kB
data must be physically sorted on disk!
index node → row
index node → block
less specific than GiST!
Really small!
8kB8kB8kB8kB
8kB8kB8kB8kB
8kB8kB8kB8kB
(S. Riggs, A. Herrera)
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
BRIN support for PostGIS datatypesBRIN support for PostGIS datatypes
8kB8kB8kB8kB
G. Broccolo, J. Rouhaud, R. Dunklau
3rd
May, PGDay @ FOSS4G.NA
NO kNN SUPPORT!!
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
The LiDAR dataset: the ahn2 projectThe LiDAR dataset: the ahn2 project
• 3D point cloud, coverage: almost the whole Netherlands
– EPSG: 28992, ~8 points/m2
• 1.6TB, ~250G points in ~560M patches (compression: ~10x)
– PDAL driver – filter.chipper
• available RAM: 16GB
• the point structure:
X Y Z scan LAS time RGB chipper
32b 32b 32b 40b 16b 64b 48b 32b
the “indexed” part (can be converted to PostGIS datatype)
(thanks to Tom Van Tilburg)
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
Typical searches on ahn2 -Typical searches on ahn2 - x3d_viewerx3d_viewer
• Intersection with a polygon (PostGIS)
– the part that lasts longer – need indexes here!
• Patch “explosion” + NN sorting (pg_PointCloud+PostGIS)
• constrained Delaunay Triangulation (SFCGAL)
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
All just in the DB...All just in the DB...
WITH patches AS (
SELECT patches FROM ahn2
WHERE patches && ST_GeomFromText(‘POLYGON(...)’)
), points AS (
SELECT ST_Explode(patches) AS points
FROM patches
), sorted_points AS (
SELECT points,
ST_DumpPoints(ST_GeomFromText(‘POLYGON(...)’))).geom AS poly_pt
FROM points ORDER BY points <#> poly_pt LIMIT 1;
), sel AS (
SELECT points FROM sorted_points
WHERE points && ST_GeomFromText(‘POLYGON(...)’)
)
SELECT ST_Dump(ST_Triangulate2DZ(ST_Collect(points))) FROM sel;
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
...and with just one query!...and with just one query!
WITH patches AS (
SELECT patches FROM ahn2
WHERE patches && ST_GeomFromText(‘POLYGON(...)’)
), points AS (
SELECT ST_Explode(patches) AS points
FROM patches
), sorted_points AS (
SELECT points,
ST_DumpPoints(ST_GeomFromText(‘POLYGON(...)’))).geom AS poly_pt
FROM points ORDER BY points <#> poly_pt LIMIT 1;
), sel AS (
SELECT points FROM sorted_points
WHERE points && ST_GeomFromText(‘POLYGON(...)’)
)
SELECT ST_Dump(ST_Triangulate2DZ(ST_Collect(points))) FROM sel;
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
patches && polygons - GiST performancepatches && polygons - GiST performance
GiST 2 d
GiST 26GB
index building
index size
polygon
size
timing
~O(m) ~40ms
~O(km) ~50s
~O(10km) hours
searches based on GiST
index not contained in
RAM anymore
(~5G points → ~3%)
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
patches && polygons - BRIN performancepatches && polygons - BRIN performance
BRIN 4 h BRIN 15MB
index building index size
polygon
size
timing
~O(m) ~150s
searches based on BRIN
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
patches && polygons - BRIN performancepatches && polygons - BRIN performance
BRIN 4 h BRIN 15MB
index building index size
polygon
size
timing
~O(m) ~150s
searches based on BRIN
How data was inserted...
LASLASLASLASLASLAS
chipper
chipper
chipper
PDAL driver
(6 parallel processes)
ahn2
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
patches && polygons - BRIN performancepatches && polygons - BRIN performance
CREATE INDEX patch_geohash ON ahn2_subset
USING btree (ST_GeoHash(ST_Transform(Geometry(patch), 4326), 20));
CLUSTER ahn2_subset USING patch_geohash;
~150s → ~800ms [radius ~O(m)]
• x20 slower than GiST searches
• x200 faster than Seq searches
– (x1000 faster in ~O(100m) searches)
(http://geohash.org/)
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
is the drop in performance acceptable?is the drop in performance acceptable?
BRIN searches = x20 GiST searches
= x10÷x100 GiST searches
= x10÷x100 GiST searches
patch explosion
+
NN sorting
constrained
triangulation
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
is the drop in performance acceptable?is the drop in performance acceptable?
BRIN searches = x20 GiST searches
= x10÷x100 GiST searches
= x10÷x100 GiST searches
patch explosion
+
NN sorting
constrained
triangulation
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
ConclusionsConclusions
Can be the relational approach to LiDAR data valid with
PostgreSQL?
– Yes!
• GiST indexes are fast, but can manage just a real small portion
of the dataset
• BRINs are quite slower, but generally do not represent a real
bottleneck
– Make sure that data has the same sequentiality of .las
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
~$ whoami~$ whoami
Giuseppe Broccolo, PhDGiuseppe Broccolo, PhD
PostgreSQL & PostGIS consultantPostgreSQL & PostGIS consultant
@giubro gbroccolo7
giuseppe.broccolo@2ndquadrant.it
gbroccolo gemini__81
2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it
FOSS4G.NA 2016
Raleigh, NC
4th
May 2016
Creative Commons license
This work is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License
http://creativecommons.org/licenses/by-nc-sa/2.5/it/
© 2016 2ndQuadrant Italia – http://www.2ndquadrant.it

More Related Content

Similar to Relational approach with LiDAR data with PostgreSQL

Indexes in PostgreSQL (10)
Indexes in PostgreSQL (10)Indexes in PostgreSQL (10)
Indexes in PostgreSQL (10)
Giuseppe Broccolo
 
a look at the postgresql engine
a look at the postgresql enginea look at the postgresql engine
a look at the postgresql engine
Federico Campoli
 
gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...
gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...
gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...
Giuseppe Broccolo
 
Pg big fast ugly acid
Pg big fast ugly acidPg big fast ugly acid
Pg big fast ugly acid
Federico Campoli
 
Armando Benitez -- Data x Desing
Armando Benitez -- Data x DesingArmando Benitez -- Data x Desing
Armando Benitez -- Data x Desing
Jorge Armando Benitez
 
Machine Learning Applications
Machine Learning ApplicationsMachine Learning Applications
Machine Learning Applications
SimplyInsight
 
Exploratory data analysis in R - Data Science Club
Exploratory data analysis in R - Data Science ClubExploratory data analysis in R - Data Science Club
Exploratory data analysis in R - Data Science Club
Martin Bago
 
SuperAGILE Data Analysis System
SuperAGILE Data Analysis SystemSuperAGILE Data Analysis System
SuperAGILE Data Analysis System
Francesco Lazzarotto
 
Don't panic! - Postgres introduction
Don't panic! - Postgres introductionDon't panic! - Postgres introduction
Don't panic! - Postgres introduction
Federico Campoli
 
The Lazy Traveling Salesman Memory Management for Large-Scale Link Discovery
The Lazy Traveling Salesman Memory Management for Large-Scale Link DiscoveryThe Lazy Traveling Salesman Memory Management for Large-Scale Link Discovery
The Lazy Traveling Salesman Memory Management for Large-Scale Link Discovery
Holistic Benchmarking of Big Linked Data
 
Ontop: Answering SPARQL Queries over Relational Databases
Ontop: Answering SPARQL Queries over Relational DatabasesOntop: Answering SPARQL Queries over Relational Databases
Ontop: Answering SPARQL Queries over Relational Databases
Guohui Xiao
 
ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...
ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...
ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...
Advanced-Concepts-Team
 
Spark Summit EU talk by Sudeep Das and Aish Faenton
Spark Summit EU talk by Sudeep Das and Aish FaentonSpark Summit EU talk by Sudeep Das and Aish Faenton
Spark Summit EU talk by Sudeep Das and Aish Faenton
Spark Summit
 
Fragging Rights: A Tale of a Pathological Storage Workload
Fragging Rights: A Tale of a Pathological Storage WorkloadFragging Rights: A Tale of a Pathological Storage Workload
Fragging Rights: A Tale of a Pathological Storage Workload
Eric Sproul
 
This week in Neo4j - 28th October 2017
This week in Neo4j - 28th October 2017This week in Neo4j - 28th October 2017
This week in Neo4j - 28th October 2017
Neo4j
 
(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists
(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists
(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists
Tobias Gärtner
 
GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!
GeoSolutions
 
7 key recipes for data engineering
7 key recipes for data engineering7 key recipes for data engineering
7 key recipes for data engineering
univalence
 
Distributed and Streaming Graph Processing Techniques
Distributed and Streaming Graph Processing TechniquesDistributed and Streaming Graph Processing Techniques
Distributed and Streaming Graph Processing Techniques
Panagiotis Liakos
 
Portfolio Selection via Particle Swarm
Portfolio Selection via Particle SwarmPortfolio Selection via Particle Swarm
Portfolio Selection via Particle Swarm
Giacomo Di Tollo
 

Similar to Relational approach with LiDAR data with PostgreSQL (20)

Indexes in PostgreSQL (10)
Indexes in PostgreSQL (10)Indexes in PostgreSQL (10)
Indexes in PostgreSQL (10)
 
a look at the postgresql engine
a look at the postgresql enginea look at the postgresql engine
a look at the postgresql engine
 
gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...
gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...
gbroccolo - Use of Indexes on geospatial databases with PostgreSQL - FOSS4G.E...
 
Pg big fast ugly acid
Pg big fast ugly acidPg big fast ugly acid
Pg big fast ugly acid
 
Armando Benitez -- Data x Desing
Armando Benitez -- Data x DesingArmando Benitez -- Data x Desing
Armando Benitez -- Data x Desing
 
Machine Learning Applications
Machine Learning ApplicationsMachine Learning Applications
Machine Learning Applications
 
Exploratory data analysis in R - Data Science Club
Exploratory data analysis in R - Data Science ClubExploratory data analysis in R - Data Science Club
Exploratory data analysis in R - Data Science Club
 
SuperAGILE Data Analysis System
SuperAGILE Data Analysis SystemSuperAGILE Data Analysis System
SuperAGILE Data Analysis System
 
Don't panic! - Postgres introduction
Don't panic! - Postgres introductionDon't panic! - Postgres introduction
Don't panic! - Postgres introduction
 
The Lazy Traveling Salesman Memory Management for Large-Scale Link Discovery
The Lazy Traveling Salesman Memory Management for Large-Scale Link DiscoveryThe Lazy Traveling Salesman Memory Management for Large-Scale Link Discovery
The Lazy Traveling Salesman Memory Management for Large-Scale Link Discovery
 
Ontop: Answering SPARQL Queries over Relational Databases
Ontop: Answering SPARQL Queries over Relational DatabasesOntop: Answering SPARQL Queries over Relational Databases
Ontop: Answering SPARQL Queries over Relational Databases
 
ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...
ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...
ACT Talk, Giuseppe Totaro: High Performance Computing for Distributed Indexin...
 
Spark Summit EU talk by Sudeep Das and Aish Faenton
Spark Summit EU talk by Sudeep Das and Aish FaentonSpark Summit EU talk by Sudeep Das and Aish Faenton
Spark Summit EU talk by Sudeep Das and Aish Faenton
 
Fragging Rights: A Tale of a Pathological Storage Workload
Fragging Rights: A Tale of a Pathological Storage WorkloadFragging Rights: A Tale of a Pathological Storage Workload
Fragging Rights: A Tale of a Pathological Storage Workload
 
This week in Neo4j - 28th October 2017
This week in Neo4j - 28th October 2017This week in Neo4j - 28th October 2017
This week in Neo4j - 28th October 2017
 
(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists
(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists
(Semi-) Big Data Corpora: New Challanges and New Solutions for Corpus Linguists
 
GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!
 
7 key recipes for data engineering
7 key recipes for data engineering7 key recipes for data engineering
7 key recipes for data engineering
 
Distributed and Streaming Graph Processing Techniques
Distributed and Streaming Graph Processing TechniquesDistributed and Streaming Graph Processing Techniques
Distributed and Streaming Graph Processing Techniques
 
Portfolio Selection via Particle Swarm
Portfolio Selection via Particle SwarmPortfolio Selection via Particle Swarm
Portfolio Selection via Particle Swarm
 

More from Giuseppe Broccolo

High scalable applications with Python
High scalable applications with PythonHigh scalable applications with Python
High scalable applications with Python
Giuseppe Broccolo
 
Non-parametric regressions & Neural Networks
Non-parametric regressions & Neural NetworksNon-parametric regressions & Neural Networks
Non-parametric regressions & Neural Networks
Giuseppe Broccolo
 
GBroccolo JRouhaud pgconfeu2016_brin4postgis
GBroccolo JRouhaud pgconfeu2016_brin4postgisGBroccolo JRouhaud pgconfeu2016_brin4postgis
GBroccolo JRouhaud pgconfeu2016_brin4postgis
Giuseppe Broccolo
 
Gbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfsGbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfs
Giuseppe Broccolo
 
Gbroccolo itpug p_gday2015_geodbbrin
Gbroccolo itpug p_gday2015_geodbbrinGbroccolo itpug p_gday2015_geodbbrin
Gbroccolo itpug p_gday2015_geodbbrin
Giuseppe Broccolo
 
Gbroccolo itpug p_gday2014_geodbindex
Gbroccolo itpug p_gday2014_geodbindexGbroccolo itpug p_gday2014_geodbindex
Gbroccolo itpug p_gday2014_geodbindex
Giuseppe Broccolo
 

More from Giuseppe Broccolo (6)

High scalable applications with Python
High scalable applications with PythonHigh scalable applications with Python
High scalable applications with Python
 
Non-parametric regressions & Neural Networks
Non-parametric regressions & Neural NetworksNon-parametric regressions & Neural Networks
Non-parametric regressions & Neural Networks
 
GBroccolo JRouhaud pgconfeu2016_brin4postgis
GBroccolo JRouhaud pgconfeu2016_brin4postgisGBroccolo JRouhaud pgconfeu2016_brin4postgis
GBroccolo JRouhaud pgconfeu2016_brin4postgis
 
Gbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfsGbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfs
 
Gbroccolo itpug p_gday2015_geodbbrin
Gbroccolo itpug p_gday2015_geodbbrinGbroccolo itpug p_gday2015_geodbbrin
Gbroccolo itpug p_gday2015_geodbbrin
 
Gbroccolo itpug p_gday2014_geodbindex
Gbroccolo itpug p_gday2014_geodbindexGbroccolo itpug p_gday2014_geodbindex
Gbroccolo itpug p_gday2014_geodbindex
 

Recently uploaded

一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
dwreak4tg
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
mbawufebxi
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
javier ramirez
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
u86oixdj
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Subhajit Sahu
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
pchutichetpong
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
oz8q3jxlp
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 

Recently uploaded (20)

一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 

Relational approach with LiDAR data with PostgreSQL

  • 1. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 Manage LiDAR data with PostgreSQL is it possible? www.2ndquadrant.com
  • 2. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 Is the relational approach valid for LiDAR?Is the relational approach valid for LiDAR? • The relational approach to the data: – data organized in tuples – tuples are part of tables – tables are related to each other through constraints (PK, FK, etc.) • If the number of tuples grows: – indexes allow to reduce the complexity of a search to ~O(logN)... – ...but they must be contained in RAM! – OTHERWISE: the relational approach start to fail...
  • 3. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 PostgreSQL & LiDAR dataPostgreSQL & LiDAR data • PostgreSQL is a relational DBMS with an extension for LiDAR data: pg_pointcloud • Part of the OpenGeo suite, completely compatible with PostGIS – two new datatype: pcpoint, pcpatch (compressed set of points) • N points (with all attributes from the survey) → 1 patch → 1 record – compatible with PDAL drivers to import data directly from .las 32b 32b 32b 16b https://github.com/pgpointcloud/pointcloud
  • 4. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 Relational approach to LiDAR data with PGRelational approach to LiDAR data with PG • GiST indexing in PostGIS • GiST performances: – storage: 1TB RAID1, RAM 16GB, 8 CPU @3.3GHz, PostgreSQL9.3 – index size ~O(table size) – Index was used: • up to ~300M points in bbox inclusion searches • up to ~10M points in kNN searches LiDAR size: ~O(109 ÷1011 ) → few % can be properly indexed! http://www.slideshare.net/GiuseppeBroccolo/gbroccolo-foss4-geugeodbindex
  • 5. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 A new index in PG: Block Range INdexingA new index in PG: Block Range INdexing 8kB8kB8kB8kB data must be physically sorted on disk! index node → row index node → block less specific than GiST! Really small! 8kB8kB8kB8kB 8kB8kB8kB8kB 8kB8kB8kB8kB (S. Riggs, A. Herrera)
  • 6. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 BRIN support for PostGIS datatypesBRIN support for PostGIS datatypes 8kB8kB8kB8kB G. Broccolo, J. Rouhaud, R. Dunklau 3rd May, PGDay @ FOSS4G.NA NO kNN SUPPORT!!
  • 7. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 The LiDAR dataset: the ahn2 projectThe LiDAR dataset: the ahn2 project • 3D point cloud, coverage: almost the whole Netherlands – EPSG: 28992, ~8 points/m2 • 1.6TB, ~250G points in ~560M patches (compression: ~10x) – PDAL driver – filter.chipper • available RAM: 16GB • the point structure: X Y Z scan LAS time RGB chipper 32b 32b 32b 40b 16b 64b 48b 32b the “indexed” part (can be converted to PostGIS datatype) (thanks to Tom Van Tilburg)
  • 8. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 Typical searches on ahn2 -Typical searches on ahn2 - x3d_viewerx3d_viewer • Intersection with a polygon (PostGIS) – the part that lasts longer – need indexes here! • Patch “explosion” + NN sorting (pg_PointCloud+PostGIS) • constrained Delaunay Triangulation (SFCGAL)
  • 9. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 All just in the DB...All just in the DB... WITH patches AS ( SELECT patches FROM ahn2 WHERE patches && ST_GeomFromText(‘POLYGON(...)’) ), points AS ( SELECT ST_Explode(patches) AS points FROM patches ), sorted_points AS ( SELECT points, ST_DumpPoints(ST_GeomFromText(‘POLYGON(...)’))).geom AS poly_pt FROM points ORDER BY points <#> poly_pt LIMIT 1; ), sel AS ( SELECT points FROM sorted_points WHERE points && ST_GeomFromText(‘POLYGON(...)’) ) SELECT ST_Dump(ST_Triangulate2DZ(ST_Collect(points))) FROM sel;
  • 10. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 ...and with just one query!...and with just one query! WITH patches AS ( SELECT patches FROM ahn2 WHERE patches && ST_GeomFromText(‘POLYGON(...)’) ), points AS ( SELECT ST_Explode(patches) AS points FROM patches ), sorted_points AS ( SELECT points, ST_DumpPoints(ST_GeomFromText(‘POLYGON(...)’))).geom AS poly_pt FROM points ORDER BY points <#> poly_pt LIMIT 1; ), sel AS ( SELECT points FROM sorted_points WHERE points && ST_GeomFromText(‘POLYGON(...)’) ) SELECT ST_Dump(ST_Triangulate2DZ(ST_Collect(points))) FROM sel;
  • 11. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 patches && polygons - GiST performancepatches && polygons - GiST performance GiST 2 d GiST 26GB index building index size polygon size timing ~O(m) ~40ms ~O(km) ~50s ~O(10km) hours searches based on GiST index not contained in RAM anymore (~5G points → ~3%)
  • 12. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 patches && polygons - BRIN performancepatches && polygons - BRIN performance BRIN 4 h BRIN 15MB index building index size polygon size timing ~O(m) ~150s searches based on BRIN
  • 13. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 patches && polygons - BRIN performancepatches && polygons - BRIN performance BRIN 4 h BRIN 15MB index building index size polygon size timing ~O(m) ~150s searches based on BRIN How data was inserted... LASLASLASLASLASLAS chipper chipper chipper PDAL driver (6 parallel processes) ahn2
  • 14. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 patches && polygons - BRIN performancepatches && polygons - BRIN performance CREATE INDEX patch_geohash ON ahn2_subset USING btree (ST_GeoHash(ST_Transform(Geometry(patch), 4326), 20)); CLUSTER ahn2_subset USING patch_geohash; ~150s → ~800ms [radius ~O(m)] • x20 slower than GiST searches • x200 faster than Seq searches – (x1000 faster in ~O(100m) searches) (http://geohash.org/)
  • 15. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 is the drop in performance acceptable?is the drop in performance acceptable? BRIN searches = x20 GiST searches = x10÷x100 GiST searches = x10÷x100 GiST searches patch explosion + NN sorting constrained triangulation
  • 16. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 is the drop in performance acceptable?is the drop in performance acceptable? BRIN searches = x20 GiST searches = x10÷x100 GiST searches = x10÷x100 GiST searches patch explosion + NN sorting constrained triangulation
  • 17. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 ConclusionsConclusions Can be the relational approach to LiDAR data valid with PostgreSQL? – Yes! • GiST indexes are fast, but can manage just a real small portion of the dataset • BRINs are quite slower, but generally do not represent a real bottleneck – Make sure that data has the same sequentiality of .las
  • 18. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 ~$ whoami~$ whoami Giuseppe Broccolo, PhDGiuseppe Broccolo, PhD PostgreSQL & PostGIS consultantPostgreSQL & PostGIS consultant @giubro gbroccolo7 giuseppe.broccolo@2ndquadrant.it gbroccolo gemini__81
  • 19. 2ndQuadrant Italia Giuseppe Broccolo – giuseppe.broccolo@2ndquadrant.it FOSS4G.NA 2016 Raleigh, NC 4th May 2016 Creative Commons license This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License http://creativecommons.org/licenses/by-nc-sa/2.5/it/ © 2016 2ndQuadrant Italia – http://www.2ndquadrant.it