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

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 

Recently uploaded (20)

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 

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.