SlideShare a Scribd company logo
1 of 20
Download to read offline
Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Spatial Support in MySQL
Norvald H. Ryeng
Software Development Senior Manager
August 30, 2019
2Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Program Agenda
A brief history of GIS in MySQL
Data types
Spatial reference systems
Storage and indexing
Functions on geometries
1
2
3
4
5
6
7
3Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
A Brief History of GIS in MySQL
MySQL ≤5.5: EOL — please upgrade
MySQL 5.6: Homegrown algorithms — please upgrade
MySQL 5.7: A "reboot" of GIS in MySQL
– Aim for standard compliance
● OGC, SQL/MM, etc.
– Use Boost Geometry instead of homegrown algorithms
● Contribute back to Boost
– Cartesian only
MySQL 8.0: Geography (ellipsoids)
– Spatial reference systems
4Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Spatial Support is Built In
● No plugin, it works out of the box
● First class citizen
● Fully integrated with other functionality
– Data dictionary tables
– INFORMATION_SCHEMA views
– Libraries
● GeoJSON parsed with general JSON parser
– Etc.
5Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Data Types
● Geometry
– Point
– Linestring
– Polygon
– GeometryCollection
● MultiPoint
● MultiLinestring
● MultiPolygon
● Same types for Cartesian and geographic data
– SRID decides interpretation
● Only 2d for now
6Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Spatial Reference Systems
SRID 0 Projected SRS Geographic SRS
Cartesian SRS
5.7 8.0
7Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Spatial Reference Systems
● 5151 predefined 2d SRSs from the EPSG Dataset 9.3 (MySQL 8.0.17)
– 4668 projected
– 483 geographic
● CREATE/DROP SPATIAL REFERENCE SYSTEM statements to create your
own
– Stored in data dictionary
– Viewable through INFORMATION_SCHEMA.ST_SPATIAL_REFERENCE_SYSTEMS
● Axis order is defined by the SRS definition
– EPSG SRSs are always lat-long
8Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Geography
● Ellipsoidal SRSs
– Full freedom: Arbitrary semi-major and semi-minor axes, any unit, any
axis direction and axis order
– ST_Transform between different ellipsoids
● All geometries are supported
– Line segments follow geodesics (shortest path)
9Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Storage and Indexing
● Each geometry type can be a column type
● A column can be restricted to a single SRID
● Currently stored as SRID + WKB-ish (X-Y or long-lat)
● R-tree indexes
– Cartesian or geographic
– Indexed columns must be SRID restricted and NOT NULL
10Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
CREATE TABLE t (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
pt POINT SRID 4326 NOT NULL
);
CREATE INDEX pt_idx ON t(pt);
INSERT INTO t VALUES (pt)
(ST_GeomFromText('POINT(44.4355 26.1025)', 4326));
INSERT INTO t VALUES (pt)
(ST_GeomFromText('POINT(26.1025 44.4355)', 4326,
'axis-order=long-lat'));
11Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
SELECT id, ST_AsText(pt) FROM t;
SELECT id, ST_AsText(pt, 'axis-order=lat-long') FROM t;
SELECT id, ST_AsText(pt, 'axis-order=long-lat') FROM t;
12Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Functions on Geometries
● Import
– ST_GeomCollFromTxt/ST_GeomCollFromText, ST_GeomCollFromWKB,
ST_GeomFromGeoJSON, ST_GeomFromText, ST_GeomFromWKB,
ST_LineFromText, ST_LineFromWKB, ST_MLineFromText,
ST_MLineFromWKB, ST_MPointFromText, ST_MPointFromWKB,
ST_MPolyFromText, ST_MPolyFromWKB, ST_PointFromGeohash,
ST_PolyFromText, ST_PolyFromWKB
● Export
– ST_AsBinary, ST_AsGeoJSON, ST_AsText, ST_Geohash
13Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Functions on Geometries
● Comparison
– ST_Contains, ST_Crosses, ST_Disjoint, ST_Equals, ST_Intersects,
ST_Overlaps, ST_Touches, ST_Within
– MBRContains, MBRCoveredBy, MBRCovers, MBRDisjoint, MBREquals,
MBRIntersects, MBROverlaps, MBRTouches, MBRWithin
● Produce new geometries
– ST_Buffer, ST_Centroid, ST_ConvexHull, ST_Envelope,
ST_MakeEnvelope, ST_Simplify, ST_Difference, ST_Intersection,
ST_SymDifference, ST_Union
14Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Functions on Geometries
● Measures
– ST_Area, ST_Distance, ST_Distance_Sphere, ST_Length
● Extract/modify properties
– ST_Dimension, ST_EndPoint, ST_ExteriorRing, ST_GeometryN,
ST_GeometryType, ST_InteriorRingN, ST_IsClosed, ST_IsEmpty,
ST_IsSimple, ST_IsValid, ST_PointN, ST_SRID, ST_StartPoint, ST_X, ST_Y,
ST_Latitude, ST_Longitude
● Helper functions
– ST_LatFromGeohash, ST_LongFromGeohash, ST_Validate, ST_SwapXY
15Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Functions on Geometries
● Same functions for Cartesian and geographic data
● General rule/goal: All functions support all geometries and
SRIDs
– Some exceptions where it doesn't make sense or we're waiting for
Boost Geometry
● Many functions already support geography
– Geography support is added piece by piece, function by function
● Added to Boost Geometry first, then to MySQL
● Your favorite function may be next
16Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Contributions Wanted
● We'd love to see MySQL support in all GIS applications
● A lot of the software already has some level of MySQL support
– Often unmaintained or lacking in functionality
– Not utilizing MySQL 8.0 improvements
● Please contribute patches to your favorite applications!
– Ask us for help if needed
– Tell us what is missing on the MySQL side
– Let us know what you've done, and we'll help you spread the good news!
17Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Feature descriptions and design details
directly from the source.
http://mysqlserverteam.com/
18Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
19Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
The preceding is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Spatial Support in MySQL

More Related Content

Similar to Spatial Support in MySQL

20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatengeKarin Patenge
 
20190704_AGIT_Georaster_ImageryData_KPatenge
20190704_AGIT_Georaster_ImageryData_KPatenge20190704_AGIT_Georaster_ImageryData_KPatenge
20190704_AGIT_Georaster_ImageryData_KPatengeKarin Patenge
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of PrestoTaro L. Saito
 
MySQL 5.7 GIS
MySQL 5.7 GISMySQL 5.7 GIS
MySQL 5.7 GISMatt Lord
 
Presto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 UpdatesPresto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 UpdatesTaro L. Saito
 
Spark For Plain Old Java Geeks (June2014 Meetup)
Spark For Plain Old Java Geeks (June2014 Meetup)Spark For Plain Old Java Geeks (June2014 Meetup)
Spark For Plain Old Java Geeks (June2014 Meetup)sdeeg
 
How To Visualize Graphs
How To Visualize GraphsHow To Visualize Graphs
How To Visualize GraphsJean Ihm
 
Oracle GoldenGate Performance Tuning
Oracle GoldenGate Performance TuningOracle GoldenGate Performance Tuning
Oracle GoldenGate Performance TuningBobby Curtis
 
20190713_MySQL開発最新動向
20190713_MySQL開発最新動向20190713_MySQL開発最新動向
20190713_MySQL開発最新動向Machiko Ikoma
 
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQLHow-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQLYugabyteDB
 
YugabyteDB - Distributed SQL Database on Kubernetes
YugabyteDB - Distributed SQL Database on KubernetesYugabyteDB - Distributed SQL Database on Kubernetes
YugabyteDB - Distributed SQL Database on KubernetesDoKC
 
AGIT 2015 - Hans Viehmann: "Big Data and Smart Cities"
AGIT 2015  - Hans Viehmann: "Big Data and Smart Cities"AGIT 2015  - Hans Viehmann: "Big Data and Smart Cities"
AGIT 2015 - Hans Viehmann: "Big Data and Smart Cities"jstrobl
 
Oracle big data spatial and graph
Oracle big data spatial and graphOracle big data spatial and graph
Oracle big data spatial and graphdyahalom
 
Discover PostGIS: Add Spatial functions to PostgreSQL
Discover PostGIS: Add Spatial functions to PostgreSQLDiscover PostGIS: Add Spatial functions to PostgreSQL
Discover PostGIS: Add Spatial functions to PostgreSQLEDB
 
How YugaByte DB Implements Distributed PostgreSQL
How YugaByte DB Implements Distributed PostgreSQLHow YugaByte DB Implements Distributed PostgreSQL
How YugaByte DB Implements Distributed PostgreSQLYugabyte
 
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...TigerGraph
 
Scale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low LatencyScale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low LatencyYugabyte
 

Similar to Spatial Support in MySQL (20)

20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
 
20190704_AGIT_Georaster_ImageryData_KPatenge
20190704_AGIT_Georaster_ImageryData_KPatenge20190704_AGIT_Georaster_ImageryData_KPatenge
20190704_AGIT_Georaster_ImageryData_KPatenge
 
MySQL 5.7 GIS
MySQL 5.7 GISMySQL 5.7 GIS
MySQL 5.7 GIS
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of Presto
 
MySQL 5.7 GIS
MySQL 5.7 GISMySQL 5.7 GIS
MySQL 5.7 GIS
 
Presto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 UpdatesPresto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 Updates
 
Spark For Plain Old Java Geeks (June2014 Meetup)
Spark For Plain Old Java Geeks (June2014 Meetup)Spark For Plain Old Java Geeks (June2014 Meetup)
Spark For Plain Old Java Geeks (June2014 Meetup)
 
How To Visualize Graphs
How To Visualize GraphsHow To Visualize Graphs
How To Visualize Graphs
 
MySQL-InnoDB
MySQL-InnoDBMySQL-InnoDB
MySQL-InnoDB
 
Oracle GoldenGate Performance Tuning
Oracle GoldenGate Performance TuningOracle GoldenGate Performance Tuning
Oracle GoldenGate Performance Tuning
 
20190713_MySQL開発最新動向
20190713_MySQL開発最新動向20190713_MySQL開発最新動向
20190713_MySQL開発最新動向
 
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQLHow-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
 
YugabyteDB - Distributed SQL Database on Kubernetes
YugabyteDB - Distributed SQL Database on KubernetesYugabyteDB - Distributed SQL Database on Kubernetes
YugabyteDB - Distributed SQL Database on Kubernetes
 
AGIT 2015 - Hans Viehmann: "Big Data and Smart Cities"
AGIT 2015  - Hans Viehmann: "Big Data and Smart Cities"AGIT 2015  - Hans Viehmann: "Big Data and Smart Cities"
AGIT 2015 - Hans Viehmann: "Big Data and Smart Cities"
 
Oracle big data spatial and graph
Oracle big data spatial and graphOracle big data spatial and graph
Oracle big data spatial and graph
 
Discover PostGIS: Add Spatial functions to PostgreSQL
Discover PostGIS: Add Spatial functions to PostgreSQLDiscover PostGIS: Add Spatial functions to PostgreSQL
Discover PostGIS: Add Spatial functions to PostgreSQL
 
Greenplum Architecture
Greenplum ArchitectureGreenplum Architecture
Greenplum Architecture
 
How YugaByte DB Implements Distributed PostgreSQL
How YugaByte DB Implements Distributed PostgreSQLHow YugaByte DB Implements Distributed PostgreSQL
How YugaByte DB Implements Distributed PostgreSQL
 
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
 
Scale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low LatencyScale Transactional Apps Across Multiple Regions with Low Latency
Scale Transactional Apps Across Multiple Regions with Low Latency
 

More from Norvald Ryeng

MySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZEMySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZENorvald Ryeng
 
JSON Array Indexes in MySQL
JSON Array Indexes in MySQLJSON Array Indexes in MySQL
JSON Array Indexes in MySQLNorvald Ryeng
 
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZEMySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZENorvald Ryeng
 
LATERAL Derived Tables in MySQL 8.0
LATERAL Derived Tables in MySQL 8.0LATERAL Derived Tables in MySQL 8.0
LATERAL Derived Tables in MySQL 8.0Norvald Ryeng
 
More SQL in MySQL 8.0
More SQL in MySQL 8.0More SQL in MySQL 8.0
More SQL in MySQL 8.0Norvald Ryeng
 
How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0Norvald Ryeng
 

More from Norvald Ryeng (6)

MySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZEMySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZE
 
JSON Array Indexes in MySQL
JSON Array Indexes in MySQLJSON Array Indexes in MySQL
JSON Array Indexes in MySQL
 
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZEMySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
 
LATERAL Derived Tables in MySQL 8.0
LATERAL Derived Tables in MySQL 8.0LATERAL Derived Tables in MySQL 8.0
LATERAL Derived Tables in MySQL 8.0
 
More SQL in MySQL 8.0
More SQL in MySQL 8.0More SQL in MySQL 8.0
More SQL in MySQL 8.0
 
How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0
 

Recently uploaded

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 

Recently uploaded (20)

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 

Spatial Support in MySQL

  • 1. Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Spatial Support in MySQL Norvald H. Ryeng Software Development Senior Manager August 30, 2019
  • 2. 2Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Program Agenda A brief history of GIS in MySQL Data types Spatial reference systems Storage and indexing Functions on geometries 1 2 3 4 5 6 7
  • 3. 3Copyright © 2019 Oracle and/or its affiliates. All rights reserved. A Brief History of GIS in MySQL MySQL ≤5.5: EOL — please upgrade MySQL 5.6: Homegrown algorithms — please upgrade MySQL 5.7: A "reboot" of GIS in MySQL – Aim for standard compliance ● OGC, SQL/MM, etc. – Use Boost Geometry instead of homegrown algorithms ● Contribute back to Boost – Cartesian only MySQL 8.0: Geography (ellipsoids) – Spatial reference systems
  • 4. 4Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Spatial Support is Built In ● No plugin, it works out of the box ● First class citizen ● Fully integrated with other functionality – Data dictionary tables – INFORMATION_SCHEMA views – Libraries ● GeoJSON parsed with general JSON parser – Etc.
  • 5. 5Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Data Types ● Geometry – Point – Linestring – Polygon – GeometryCollection ● MultiPoint ● MultiLinestring ● MultiPolygon ● Same types for Cartesian and geographic data – SRID decides interpretation ● Only 2d for now
  • 6. 6Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Spatial Reference Systems SRID 0 Projected SRS Geographic SRS Cartesian SRS 5.7 8.0
  • 7. 7Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Spatial Reference Systems ● 5151 predefined 2d SRSs from the EPSG Dataset 9.3 (MySQL 8.0.17) – 4668 projected – 483 geographic ● CREATE/DROP SPATIAL REFERENCE SYSTEM statements to create your own – Stored in data dictionary – Viewable through INFORMATION_SCHEMA.ST_SPATIAL_REFERENCE_SYSTEMS ● Axis order is defined by the SRS definition – EPSG SRSs are always lat-long
  • 8. 8Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Geography ● Ellipsoidal SRSs – Full freedom: Arbitrary semi-major and semi-minor axes, any unit, any axis direction and axis order – ST_Transform between different ellipsoids ● All geometries are supported – Line segments follow geodesics (shortest path)
  • 9. 9Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Storage and Indexing ● Each geometry type can be a column type ● A column can be restricted to a single SRID ● Currently stored as SRID + WKB-ish (X-Y or long-lat) ● R-tree indexes – Cartesian or geographic – Indexed columns must be SRID restricted and NOT NULL
  • 10. 10Copyright © 2019 Oracle and/or its affiliates. All rights reserved. CREATE TABLE t ( id INTEGER AUTO_INCREMENT PRIMARY KEY, pt POINT SRID 4326 NOT NULL ); CREATE INDEX pt_idx ON t(pt); INSERT INTO t VALUES (pt) (ST_GeomFromText('POINT(44.4355 26.1025)', 4326)); INSERT INTO t VALUES (pt) (ST_GeomFromText('POINT(26.1025 44.4355)', 4326, 'axis-order=long-lat'));
  • 11. 11Copyright © 2019 Oracle and/or its affiliates. All rights reserved. SELECT id, ST_AsText(pt) FROM t; SELECT id, ST_AsText(pt, 'axis-order=lat-long') FROM t; SELECT id, ST_AsText(pt, 'axis-order=long-lat') FROM t;
  • 12. 12Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Functions on Geometries ● Import – ST_GeomCollFromTxt/ST_GeomCollFromText, ST_GeomCollFromWKB, ST_GeomFromGeoJSON, ST_GeomFromText, ST_GeomFromWKB, ST_LineFromText, ST_LineFromWKB, ST_MLineFromText, ST_MLineFromWKB, ST_MPointFromText, ST_MPointFromWKB, ST_MPolyFromText, ST_MPolyFromWKB, ST_PointFromGeohash, ST_PolyFromText, ST_PolyFromWKB ● Export – ST_AsBinary, ST_AsGeoJSON, ST_AsText, ST_Geohash
  • 13. 13Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Functions on Geometries ● Comparison – ST_Contains, ST_Crosses, ST_Disjoint, ST_Equals, ST_Intersects, ST_Overlaps, ST_Touches, ST_Within – MBRContains, MBRCoveredBy, MBRCovers, MBRDisjoint, MBREquals, MBRIntersects, MBROverlaps, MBRTouches, MBRWithin ● Produce new geometries – ST_Buffer, ST_Centroid, ST_ConvexHull, ST_Envelope, ST_MakeEnvelope, ST_Simplify, ST_Difference, ST_Intersection, ST_SymDifference, ST_Union
  • 14. 14Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Functions on Geometries ● Measures – ST_Area, ST_Distance, ST_Distance_Sphere, ST_Length ● Extract/modify properties – ST_Dimension, ST_EndPoint, ST_ExteriorRing, ST_GeometryN, ST_GeometryType, ST_InteriorRingN, ST_IsClosed, ST_IsEmpty, ST_IsSimple, ST_IsValid, ST_PointN, ST_SRID, ST_StartPoint, ST_X, ST_Y, ST_Latitude, ST_Longitude ● Helper functions – ST_LatFromGeohash, ST_LongFromGeohash, ST_Validate, ST_SwapXY
  • 15. 15Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Functions on Geometries ● Same functions for Cartesian and geographic data ● General rule/goal: All functions support all geometries and SRIDs – Some exceptions where it doesn't make sense or we're waiting for Boost Geometry ● Many functions already support geography – Geography support is added piece by piece, function by function ● Added to Boost Geometry first, then to MySQL ● Your favorite function may be next
  • 16. 16Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Contributions Wanted ● We'd love to see MySQL support in all GIS applications ● A lot of the software already has some level of MySQL support – Often unmaintained or lacking in functionality – Not utilizing MySQL 8.0 improvements ● Please contribute patches to your favorite applications! – Ask us for help if needed – Tell us what is missing on the MySQL side – Let us know what you've done, and we'll help you spread the good news!
  • 17. 17Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Feature descriptions and design details directly from the source. http://mysqlserverteam.com/
  • 18. 18Copyright © 2019 Oracle and/or its affiliates. All rights reserved.
  • 19. 19Copyright © 2019 Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.