SlideShare a Scribd company logo
1 of 34
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Mapping with MySQL:
GIS in MySQL 5.7
Pavan Naik
MySQL Eng Team
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following 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.
3
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
GIS in MySQL 5.7 : Agenda
1
2
3
4
5
Introduction to GIS
Common terms and concepts
What’s new in MySQL 5.7
A real world example
What’s next for MySQL GIS
4
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Introduction to GIS
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
What is GIS?
• Geographic Information Systems
– Features : graphic spatial representations of real-world physical features
• Generally a map of some sort
– Attributes : non-spatial data describing the features
• Name/value pairs used to describe a location and to allow for grouping of data
• Data formats
– Vector data : points, lines and polygons
• Generally what’s used with an RDBMS, such as MySQL
– Raster data : grid matrix containing cells
• Generally used for aerial and satellite imagery
6
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
What Would I Use it for?
• Location services
– Where is something?
– How do I get from Point A to Point B?
– What are the closest <thing>s to me?
– What are the relevant details of each location or Point?
7
* Source: ESRI
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
How Would I Use It?
8
StoreCollect
AnalyzeVisualize
• Collect spatial data
– Free (OSM)
• Store the data
– Within MySQL tables
• Analyze the data
– SQL queries are used to analyze the data to derive
meaningful relationships
• Visualize the data
– Provide maps containing the resulting attributes and relationships
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Common Terms and Concepts
9
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Common Terms
• Coordinates
– x,y,z coordinates in planar space (4D is m or measure)
– MySQL currently only supports x,y(2D) coordinates
• Projection
– Allows a spheroidal surface to be represented in planar format
– Necessary for creating “flat” or 2D maps from locations on a spheroid
• Coordinate reference system (CRS/SRS/SRID)
– Defines where a POINT—represented by a longitude and latitude coordinate pair—is
located on the physical earth and defines its relationship to other POINTs
10
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Data Formats
• Vector
– Points, lines, and polygons
– Position (x,y) is relative in a coordinate system
– Generally used by database servers
– Includes .OSM, .KML, .GeoJSON, …
• Raster
– Cells in a grid matrix, tied to an anchor (e.g. the {1,1} cell)
– Generally used in aerial, satellite, and other imagery
– Includes .jpg, .gif and other pixel based formats
11
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Data Formats
12
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Geometry Data Types
• POINT
• LINESTRING
• POLYGON
• MULTIPOINT
• MULTILINESTRING
• MULTIPOLYGON
• GEOMETRYCOLLECTION
13
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
What’s New in MySQL 5.7
14
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Integrating Boost.Geometry
• Replaced custom code
– For geometry representations
– For geometry comparisons
• Provides OGC compliance
– With improved performance
• Boost.Geometry contains
– Field and domain experts
– Bustling and robust community
• We’re also Boost.Geometry contributors!
– Two full-time developers contributing upstream
15
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Spatial Indexes for InnoDB
• R-tree based
– Full transactional support
– Minimum bounding rectangle
• Small and compact
– Currently only supports 2D data
• We would like to add 3D support in the future
16
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Additional Features
• GeoHash
– B-tree indexes on the generated hash values
– Quick lookups for exact matches
• GeoJSON
– Open standard for encoding
geometric/geographical features
17
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}
}
GeoJSON Example
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
A Real World Example
18
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Starting Point
• My apartment in
Brooklyn, NY
– 33 Withers Street
Brooklyn, NY 11211
– POINT(<LONG>,<LAT>)
• -73.951353,40.716914
19
https://www.google.com/maps/place/33+Withers+St,+Brooklyn,+NY+11211/@40.7169144,-73.9513538
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
The Application Use Case
• I’m hungry and in the mood for Thai food
– What Thai restaurants are around me?
– What’s the closest one?
– How would I get there?
20
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Getting Some Data In
• Download a NYC OSM extract:
– http://osm-extracted-metros.s3.amazonaws.com/new-york.osm.bz2
• Import the data using a customized OsmDB.pm Perl module
– http://wiki.openstreetmap.org/wiki/OsmDB.pm (original)
– https://www.dropbox.com/s/l17vj3wf9y13tee/osmdb-scripts.tar.gz (customized)
• Creates a spatial index on the ‘geom’ column
21
mysql -e "create database nyosm"
bunzip2 new-york.osm.bz2
./bulkDB.pl new-york.osm nyosm
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
The Generated Schema
• http://wiki.openstreetmap.org/wiki/Elements
22
mysql> show tables;
+-----------------+
| Tables_in_nyosm |
+-----------------+
| nodes |
| nodetags |
| relationmembers |
| relations |
| relationtags |
| waynodes |
| ways |
| waytags |
+-----------------+
– We’ll focus on nodes and nodetags for our
examples
– Nodes
• A point or location
– Nodetags
• Metadata about each location
• name/value pairs
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
De-normalizing the Tag Data
• Greatly simplify our query
• Allow for the use of a full-text index
– Also improves performance
23
mysql> alter table nodes add column tags text, add fulltext index(tags);
mysql> update nodes set tags=(SELECT group_concat(concat(k, "=", v) SEPARATOR
';') from nodetags where nodetags.id=nodes.id group by nodes.id);
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Final Nodes Table
24
mysql> show create table nodesG
*************************** 1. row ***************************
Table: nodes
Create Table: CREATE TABLE `nodes` (
`id` bigint(20) DEFAULT NULL,
`geom` geometry NOT NULL,
`user` varchar(50) DEFAULT NULL,
`version` int(11) DEFAULT NULL,
`timestamp` varchar(20) DEFAULT NULL,
`uid` int(11) DEFAULT NULL,
`changeset` int(11) DEFAULT NULL,
`tags` text,
UNIQUE KEY `i_nodeids` (`id`),
SPATIAL KEY `i_geomidx` (`geom`),
FULLTEXT KEY `tags` (`tags`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Creating a Distance Calculation Function
• Various great circle (orthodrome) distance formulas
– Haversine, Spherical Law of Cosines (my choice), …
– http://en.wikipedia.org/wiki/Great-circle_distance
– Necessary for calculating distances between two Geometries
• Need goes away when we support Geography Type
25
mysql> CREATE FUNCTION slc (lat1 double, lon1 double, lat2 double, lon2 double)
RETURNS double
RETURN 6371 * acos(cos(radians(lat1)) * cos(radians(lat2)) * cos(radians(lon2)
- radians(lon1)) + sin(radians(lat1)) * sin(radians(lat2)));
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Creating a Bounding Box For Our Search
• Utilize the r-tree index by limiting area
– Need to use some additional geographic formulas
• http://www.movable-type.co.uk/scripts/latlong.html
26
${origlon} = -73.951368
${origlat} = 40.716743
${lon1} = ${origlon} + (${distance_in_km}/111)
${lat1} = ${origlat} + (${distance_in_km}/111)
${lon2} = ${origlon} - (${distance_in_km}/111)
${lat2} = ${origlat} - (${distance_in_km}/111)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Calculating the Results
• Our final query, searching within ~ 10km radius
27
mysql> SELECT id,
slc(40.716743, -73.951368, y(geom), x(geom))*1000 as distance_in_meters,
tags, ST_AsText(geom)
FROM nodes
WHERE ST_Contains(ST_Envelope(linestring(point((-73.951368+(10/111)),
(40.716743+(10/111))), point((-73.951368-(10/111)), (40.716743-(10/111))))),
geom)
AND match(tags) against ("+thai +restaurant" IN BOOLEAN MODE)
ORDER BY distance_in_metersG
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Examining the Results
28
*************************** 1. row ***************************
id: 888976948
distance_in_meters: 614.4973960877276
tags: addr:street=Bedford Avenue;amenity=restaurant;name=Tai
Thai;addr:housenumber=206;phone=7185995556
astext(geom): POINT(-73.958637 40.717174)
*************************** 2. row ***************************
id: 2178443635
distance_in_meters: 2780.87697408101
tags: microbrewery=no;website=http://www.onemorethai.net/;name=One
More Thai;amenity=restaurant;opening_hours=12:00-22:30;cuisine=thai;phone=(212)
228-8858
astext(geom): POINT(-73.983871 40.7210541)
*************************** 3. row ***************************
…
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Mapping the Results
29
• From my place
– -73.951353,40.716914
• To Tai Thai
– -73.958637,40.717174
https://www.google.com/maps/dir/40.716914,+-73.951353/40.717174,+-73.958637
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
What’s Next for MySQL GIS
30
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Additional Features
• R-tree enhancements
– 3D support
• Improved storage
– Fixed length storage when possible
• Geography types
• Projections
• Additional performance optimizations
• What else would you like to see…? Let us know..!!!
31
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Appendix : Additional Resources
• Manual
– http://dev.mysql.com/doc/refman/5.7/en/spatial-extensions.html
• Community forum
– http://forums.mysql.com/list.php?23
• Boost.Geometry
– http://www.boost.org/libs/geometry
• Report GIS bugs and submit feature requests
– http://bugs.mysql.com/
32
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Q&A
33
MySQL 5.7 GIS

More Related Content

What's hot

Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGISmleslie
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLEDB
 
Extending Hadoop for Fun & Profit
Extending Hadoop for Fun & ProfitExtending Hadoop for Fun & Profit
Extending Hadoop for Fun & ProfitMilind Bhandarkar
 
Hadoop and OpenStack - Hadoop Summit San Jose 2014
Hadoop and OpenStack - Hadoop Summit San Jose 2014Hadoop and OpenStack - Hadoop Summit San Jose 2014
Hadoop and OpenStack - Hadoop Summit San Jose 2014spinningmatt
 
PostGIS and Spatial SQL
PostGIS and Spatial SQLPostGIS and Spatial SQL
PostGIS and Spatial SQLTodd Barr
 
The Zoo Expands: Labrador *Loves* Elephant, Thanks to Hamster
The Zoo Expands: Labrador *Loves* Elephant, Thanks to HamsterThe Zoo Expands: Labrador *Loves* Elephant, Thanks to Hamster
The Zoo Expands: Labrador *Loves* Elephant, Thanks to HamsterMilind Bhandarkar
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Jean Ihm
 
Future of Data Intensive Applicaitons
Future of Data Intensive ApplicaitonsFuture of Data Intensive Applicaitons
Future of Data Intensive ApplicaitonsMilind Bhandarkar
 
Apache HAWQ and Apache MADlib: Journey to Apache
Apache HAWQ and Apache MADlib: Journey to ApacheApache HAWQ and Apache MADlib: Journey to Apache
Apache HAWQ and Apache MADlib: Journey to ApachePivotalOpenSourceHub
 
Hive+Tez: A performance deep dive
Hive+Tez: A performance deep diveHive+Tez: A performance deep dive
Hive+Tez: A performance deep divet3rmin4t0r
 
Tuning up with Apache Tez
Tuning up with Apache TezTuning up with Apache Tez
Tuning up with Apache TezGal Vinograd
 
The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...
The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...
The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...spinningmatt
 
GeoServer Orientation
GeoServer OrientationGeoServer Orientation
GeoServer OrientationJody Garnett
 
Distro-independent Hadoop cluster management
Distro-independent Hadoop cluster managementDistro-independent Hadoop cluster management
Distro-independent Hadoop cluster managementDataWorks Summit
 
Using PostgreSQL with Bibliographic Data
Using PostgreSQL with Bibliographic DataUsing PostgreSQL with Bibliographic Data
Using PostgreSQL with Bibliographic DataJimmy Angelakos
 
Java Image Processing for Geospatial Community
Java Image Processing for Geospatial CommunityJava Image Processing for Geospatial Community
Java Image Processing for Geospatial CommunityJody Garnett
 
Hadoop on OpenStack - Sahara @DevNation 2014
Hadoop on OpenStack - Sahara @DevNation 2014Hadoop on OpenStack - Sahara @DevNation 2014
Hadoop on OpenStack - Sahara @DevNation 2014spinningmatt
 
Cmu-2011-09.pptx
Cmu-2011-09.pptxCmu-2011-09.pptx
Cmu-2011-09.pptxTed Dunning
 

What's hot (20)

Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGIS
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
 
Extending Hadoop for Fun & Profit
Extending Hadoop for Fun & ProfitExtending Hadoop for Fun & Profit
Extending Hadoop for Fun & Profit
 
Hadoop and OpenStack - Hadoop Summit San Jose 2014
Hadoop and OpenStack - Hadoop Summit San Jose 2014Hadoop and OpenStack - Hadoop Summit San Jose 2014
Hadoop and OpenStack - Hadoop Summit San Jose 2014
 
PostGIS and Spatial SQL
PostGIS and Spatial SQLPostGIS and Spatial SQL
PostGIS and Spatial SQL
 
The Zoo Expands: Labrador *Loves* Elephant, Thanks to Hamster
The Zoo Expands: Labrador *Loves* Elephant, Thanks to HamsterThe Zoo Expands: Labrador *Loves* Elephant, Thanks to Hamster
The Zoo Expands: Labrador *Loves* Elephant, Thanks to Hamster
 
Day 6 - PostGIS
Day 6 - PostGISDay 6 - PostGIS
Day 6 - PostGIS
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
 
Future of Data Intensive Applicaitons
Future of Data Intensive ApplicaitonsFuture of Data Intensive Applicaitons
Future of Data Intensive Applicaitons
 
February 2014 HUG : Hive On Tez
February 2014 HUG : Hive On TezFebruary 2014 HUG : Hive On Tez
February 2014 HUG : Hive On Tez
 
Apache HAWQ and Apache MADlib: Journey to Apache
Apache HAWQ and Apache MADlib: Journey to ApacheApache HAWQ and Apache MADlib: Journey to Apache
Apache HAWQ and Apache MADlib: Journey to Apache
 
Hive+Tez: A performance deep dive
Hive+Tez: A performance deep diveHive+Tez: A performance deep dive
Hive+Tez: A performance deep dive
 
Tuning up with Apache Tez
Tuning up with Apache TezTuning up with Apache Tez
Tuning up with Apache Tez
 
The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...
The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...
The state of the art for OpenStack Data Processing (Hadoop on OpenStack) - At...
 
GeoServer Orientation
GeoServer OrientationGeoServer Orientation
GeoServer Orientation
 
Distro-independent Hadoop cluster management
Distro-independent Hadoop cluster managementDistro-independent Hadoop cluster management
Distro-independent Hadoop cluster management
 
Using PostgreSQL with Bibliographic Data
Using PostgreSQL with Bibliographic DataUsing PostgreSQL with Bibliographic Data
Using PostgreSQL with Bibliographic Data
 
Java Image Processing for Geospatial Community
Java Image Processing for Geospatial CommunityJava Image Processing for Geospatial Community
Java Image Processing for Geospatial Community
 
Hadoop on OpenStack - Sahara @DevNation 2014
Hadoop on OpenStack - Sahara @DevNation 2014Hadoop on OpenStack - Sahara @DevNation 2014
Hadoop on OpenStack - Sahara @DevNation 2014
 
Cmu-2011-09.pptx
Cmu-2011-09.pptxCmu-2011-09.pptx
Cmu-2011-09.pptx
 

Similar to MySQL 5.7 GIS

MySQL 5.7 GIS-Norvald H. Ryeng
MySQL 5.7 GIS-Norvald H. RyengMySQL 5.7 GIS-Norvald H. Ryeng
MySQL 5.7 GIS-Norvald H. Ryeng郁萍 王
 
MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014Sanjay Manwani
 
Database trendsv4
Database trendsv4Database trendsv4
Database trendsv4Tinku Ajit
 
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)Andrew Morgan
 
Introduction to Apache Geode (Cork, Ireland)
Introduction to Apache Geode (Cork, Ireland)Introduction to Apache Geode (Cork, Ireland)
Introduction to Apache Geode (Cork, Ireland)Anthony Baker
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptxIvan Ma
 
Apache Spark Overview part1 (20161107)
Apache Spark Overview part1 (20161107)Apache Spark Overview part1 (20161107)
Apache Spark Overview part1 (20161107)Steve Min
 
From Lucene to Solr 4 Trunk
From Lucene to Solr 4 TrunkFrom Lucene to Solr 4 Trunk
From Lucene to Solr 4 Trunktdthomassld
 
The Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesThe Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesEDB
 
Analyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache DrillAnalyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache Drilltshiran
 
Apache Geode Meetup, Cork, Ireland at CIT
Apache Geode Meetup, Cork, Ireland at CITApache Geode Meetup, Cork, Ireland at CIT
Apache Geode Meetup, Cork, Ireland at CITApache Geode
 
Apache Geode Meetup, London
Apache Geode Meetup, LondonApache Geode Meetup, London
Apache Geode Meetup, LondonApache Geode
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large GraphsNishant Gandhi
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Codemotion Tel Aviv
 
JDD2014: Multitenant Search - Pablo Barros
JDD2014: Multitenant Search - Pablo BarrosJDD2014: Multitenant Search - Pablo Barros
JDD2014: Multitenant Search - Pablo BarrosPROIDEA
 
2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdf2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdfHaiping Li
 
Cassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache CassandraCassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache CassandraDataStax Academy
 
A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014Anuj Sahni
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018harvraja
 
Analyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache DrillAnalyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache DrillTomer Shiran
 

Similar to MySQL 5.7 GIS (20)

MySQL 5.7 GIS-Norvald H. Ryeng
MySQL 5.7 GIS-Norvald H. RyengMySQL 5.7 GIS-Norvald H. Ryeng
MySQL 5.7 GIS-Norvald H. Ryeng
 
MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014
 
Database trendsv4
Database trendsv4Database trendsv4
Database trendsv4
 
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
 
Introduction to Apache Geode (Cork, Ireland)
Introduction to Apache Geode (Cork, Ireland)Introduction to Apache Geode (Cork, Ireland)
Introduction to Apache Geode (Cork, Ireland)
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
 
Apache Spark Overview part1 (20161107)
Apache Spark Overview part1 (20161107)Apache Spark Overview part1 (20161107)
Apache Spark Overview part1 (20161107)
 
From Lucene to Solr 4 Trunk
From Lucene to Solr 4 TrunkFrom Lucene to Solr 4 Trunk
From Lucene to Solr 4 Trunk
 
The Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesThe Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle Databases
 
Analyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache DrillAnalyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache Drill
 
Apache Geode Meetup, Cork, Ireland at CIT
Apache Geode Meetup, Cork, Ireland at CITApache Geode Meetup, Cork, Ireland at CIT
Apache Geode Meetup, Cork, Ireland at CIT
 
Apache Geode Meetup, London
Apache Geode Meetup, LondonApache Geode Meetup, London
Apache Geode Meetup, London
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
 
JDD2014: Multitenant Search - Pablo Barros
JDD2014: Multitenant Search - Pablo BarrosJDD2014: Multitenant Search - Pablo Barros
JDD2014: Multitenant Search - Pablo Barros
 
2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdf2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdf
 
Cassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache CassandraCassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache Cassandra
 
A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018
 
Analyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache DrillAnalyzing Real-World Data with Apache Drill
Analyzing Real-World Data with Apache Drill
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

MySQL 5.7 GIS

  • 1.
  • 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Mapping with MySQL: GIS in MySQL 5.7 Pavan Naik MySQL Eng Team
  • 3. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following 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. 3
  • 4. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | GIS in MySQL 5.7 : Agenda 1 2 3 4 5 Introduction to GIS Common terms and concepts What’s new in MySQL 5.7 A real world example What’s next for MySQL GIS 4
  • 5. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Introduction to GIS 5
  • 6. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | What is GIS? • Geographic Information Systems – Features : graphic spatial representations of real-world physical features • Generally a map of some sort – Attributes : non-spatial data describing the features • Name/value pairs used to describe a location and to allow for grouping of data • Data formats – Vector data : points, lines and polygons • Generally what’s used with an RDBMS, such as MySQL – Raster data : grid matrix containing cells • Generally used for aerial and satellite imagery 6
  • 7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | What Would I Use it for? • Location services – Where is something? – How do I get from Point A to Point B? – What are the closest <thing>s to me? – What are the relevant details of each location or Point? 7 * Source: ESRI
  • 8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | How Would I Use It? 8 StoreCollect AnalyzeVisualize • Collect spatial data – Free (OSM) • Store the data – Within MySQL tables • Analyze the data – SQL queries are used to analyze the data to derive meaningful relationships • Visualize the data – Provide maps containing the resulting attributes and relationships
  • 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Common Terms and Concepts 9
  • 10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Common Terms • Coordinates – x,y,z coordinates in planar space (4D is m or measure) – MySQL currently only supports x,y(2D) coordinates • Projection – Allows a spheroidal surface to be represented in planar format – Necessary for creating “flat” or 2D maps from locations on a spheroid • Coordinate reference system (CRS/SRS/SRID) – Defines where a POINT—represented by a longitude and latitude coordinate pair—is located on the physical earth and defines its relationship to other POINTs 10
  • 11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Data Formats • Vector – Points, lines, and polygons – Position (x,y) is relative in a coordinate system – Generally used by database servers – Includes .OSM, .KML, .GeoJSON, … • Raster – Cells in a grid matrix, tied to an anchor (e.g. the {1,1} cell) – Generally used in aerial, satellite, and other imagery – Includes .jpg, .gif and other pixel based formats 11
  • 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Data Formats 12
  • 13. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Geometry Data Types • POINT • LINESTRING • POLYGON • MULTIPOINT • MULTILINESTRING • MULTIPOLYGON • GEOMETRYCOLLECTION 13
  • 14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | What’s New in MySQL 5.7 14
  • 15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Integrating Boost.Geometry • Replaced custom code – For geometry representations – For geometry comparisons • Provides OGC compliance – With improved performance • Boost.Geometry contains – Field and domain experts – Bustling and robust community • We’re also Boost.Geometry contributors! – Two full-time developers contributing upstream 15
  • 16. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Spatial Indexes for InnoDB • R-tree based – Full transactional support – Minimum bounding rectangle • Small and compact – Currently only supports 2D data • We would like to add 3D support in the future 16
  • 17. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Additional Features • GeoHash – B-tree indexes on the generated hash values – Quick lookups for exact matches • GeoJSON – Open standard for encoding geometric/geographical features 17 { "type": "Feature", "geometry": { "type": "Point", "coordinates": [125.6, 10.1] }, "properties": { "name": "Dinagat Islands" } } GeoJSON Example
  • 18. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | A Real World Example 18
  • 19. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Starting Point • My apartment in Brooklyn, NY – 33 Withers Street Brooklyn, NY 11211 – POINT(<LONG>,<LAT>) • -73.951353,40.716914 19 https://www.google.com/maps/place/33+Withers+St,+Brooklyn,+NY+11211/@40.7169144,-73.9513538
  • 20. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | The Application Use Case • I’m hungry and in the mood for Thai food – What Thai restaurants are around me? – What’s the closest one? – How would I get there? 20
  • 21. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Getting Some Data In • Download a NYC OSM extract: – http://osm-extracted-metros.s3.amazonaws.com/new-york.osm.bz2 • Import the data using a customized OsmDB.pm Perl module – http://wiki.openstreetmap.org/wiki/OsmDB.pm (original) – https://www.dropbox.com/s/l17vj3wf9y13tee/osmdb-scripts.tar.gz (customized) • Creates a spatial index on the ‘geom’ column 21 mysql -e "create database nyosm" bunzip2 new-york.osm.bz2 ./bulkDB.pl new-york.osm nyosm
  • 22. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | The Generated Schema • http://wiki.openstreetmap.org/wiki/Elements 22 mysql> show tables; +-----------------+ | Tables_in_nyosm | +-----------------+ | nodes | | nodetags | | relationmembers | | relations | | relationtags | | waynodes | | ways | | waytags | +-----------------+ – We’ll focus on nodes and nodetags for our examples – Nodes • A point or location – Nodetags • Metadata about each location • name/value pairs
  • 23. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | De-normalizing the Tag Data • Greatly simplify our query • Allow for the use of a full-text index – Also improves performance 23 mysql> alter table nodes add column tags text, add fulltext index(tags); mysql> update nodes set tags=(SELECT group_concat(concat(k, "=", v) SEPARATOR ';') from nodetags where nodetags.id=nodes.id group by nodes.id);
  • 24. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Final Nodes Table 24 mysql> show create table nodesG *************************** 1. row *************************** Table: nodes Create Table: CREATE TABLE `nodes` ( `id` bigint(20) DEFAULT NULL, `geom` geometry NOT NULL, `user` varchar(50) DEFAULT NULL, `version` int(11) DEFAULT NULL, `timestamp` varchar(20) DEFAULT NULL, `uid` int(11) DEFAULT NULL, `changeset` int(11) DEFAULT NULL, `tags` text, UNIQUE KEY `i_nodeids` (`id`), SPATIAL KEY `i_geomidx` (`geom`), FULLTEXT KEY `tags` (`tags`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1
  • 25. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Creating a Distance Calculation Function • Various great circle (orthodrome) distance formulas – Haversine, Spherical Law of Cosines (my choice), … – http://en.wikipedia.org/wiki/Great-circle_distance – Necessary for calculating distances between two Geometries • Need goes away when we support Geography Type 25 mysql> CREATE FUNCTION slc (lat1 double, lon1 double, lat2 double, lon2 double) RETURNS double RETURN 6371 * acos(cos(radians(lat1)) * cos(radians(lat2)) * cos(radians(lon2) - radians(lon1)) + sin(radians(lat1)) * sin(radians(lat2)));
  • 26. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Creating a Bounding Box For Our Search • Utilize the r-tree index by limiting area – Need to use some additional geographic formulas • http://www.movable-type.co.uk/scripts/latlong.html 26 ${origlon} = -73.951368 ${origlat} = 40.716743 ${lon1} = ${origlon} + (${distance_in_km}/111) ${lat1} = ${origlat} + (${distance_in_km}/111) ${lon2} = ${origlon} - (${distance_in_km}/111) ${lat2} = ${origlat} - (${distance_in_km}/111)
  • 27. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Calculating the Results • Our final query, searching within ~ 10km radius 27 mysql> SELECT id, slc(40.716743, -73.951368, y(geom), x(geom))*1000 as distance_in_meters, tags, ST_AsText(geom) FROM nodes WHERE ST_Contains(ST_Envelope(linestring(point((-73.951368+(10/111)), (40.716743+(10/111))), point((-73.951368-(10/111)), (40.716743-(10/111))))), geom) AND match(tags) against ("+thai +restaurant" IN BOOLEAN MODE) ORDER BY distance_in_metersG
  • 28. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Examining the Results 28 *************************** 1. row *************************** id: 888976948 distance_in_meters: 614.4973960877276 tags: addr:street=Bedford Avenue;amenity=restaurant;name=Tai Thai;addr:housenumber=206;phone=7185995556 astext(geom): POINT(-73.958637 40.717174) *************************** 2. row *************************** id: 2178443635 distance_in_meters: 2780.87697408101 tags: microbrewery=no;website=http://www.onemorethai.net/;name=One More Thai;amenity=restaurant;opening_hours=12:00-22:30;cuisine=thai;phone=(212) 228-8858 astext(geom): POINT(-73.983871 40.7210541) *************************** 3. row *************************** …
  • 29. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Mapping the Results 29 • From my place – -73.951353,40.716914 • To Tai Thai – -73.958637,40.717174 https://www.google.com/maps/dir/40.716914,+-73.951353/40.717174,+-73.958637
  • 30. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | What’s Next for MySQL GIS 30
  • 31. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Additional Features • R-tree enhancements – 3D support • Improved storage – Fixed length storage when possible • Geography types • Projections • Additional performance optimizations • What else would you like to see…? Let us know..!!! 31
  • 32. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Appendix : Additional Resources • Manual – http://dev.mysql.com/doc/refman/5.7/en/spatial-extensions.html • Community forum – http://forums.mysql.com/list.php?23 • Boost.Geometry – http://www.boost.org/libs/geometry • Report GIS bugs and submit feature requests – http://bugs.mysql.com/ 32
  • 33. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Q&A 33

Editor's Notes

  1. This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template. One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy To learn more about this policy, e-mail: Revrec-americasiebc_us@oracle.com For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.   http://my.oracle.com/site/fin/gfo/GlobalProcesses/cnt452504.pdf For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.
  2. GIS: A computer-based system that stores geographically referenced data layers (features) and links it with non-graphic data tables (attributes) allowing for a wide range of information processing, including manipulation, analysis, and modeling. A GIS also allows for map display and production.
  3. We’re going to focus on simple location services in our examples.
  4. X or northing which will typically be a longitude value, Y or easting which will typically be a latitude value, Z or height (optionally a true geodetic value), and M or measure (which can be used for Time, for example).
  5. University Consortium for Geographic Information Science USGS or United States Geological Survey
  6. Started out as the Generic Geometry Library by OSGeo. Now it’s of course part of Boost.
  7. R-trees are the most common index type used for spatial data. It’s a wide search tree, with some similarities with B-trees. It’s similar in that of course it’s a search tree, and it has root nodes, branch nodes, and leaf nodes. The main differences are: 1. R-trees use pages for each level in the tree, and the page can contain X number of nodes. So the search is not binary at any level. Each level in the tree can have up to some maximum number of nodes. The maximum being set by the specific implementation. 2. You search by bounding box. If the search box overlaps with the MBR stored in a node, then you continue to search down that path, moving to the next child node.
  8. You can set the SRID of geometries in MySQL to any 32 bit unsigned integer, and we will refuse to mix geometries of different SRIDs in the same operation. In calculations, everything will be treated as SRID 0, which in MySQL is a Cartesian system without units (what you get if you don't specify an SRID).
  9. Common alternatives are a fixed address like this, or a GPS location from your mobile device.
  10. I’m using the spherical law of cosines formula because it’s simpler, and thus faster, than Haversine; while also giving us virtually the same accuracy (Haversine is generally more accurate though, particularly for short distances). That’s generally why Haversine is the most common method that you’ll see used. It’s possible that this need goes away later in 5.7 too. We’re looking into possibly adding an ST_Distance_Sphere() function that returns the great-circle earth distance calculation, in meters, between two geometries (which are points containing X,Y or LON/LAT coordinate pairs). ST_Distance_Sphere — Returns minimum distance in meters between two lon/lat geometries. Uses a spherical earth and radius of 6,370,986 meters.
  11. We’ll simply use the average distance between longitude and latitude degrees in our coming example. We don’t need the envelope to be too accurate as we’re simply using it to pass down to the spatial index, and we’re later calculating the actual distance using our new SLC function. The need for this may go away later in 5.7 too. We’re considering adding an ST_MakeEnvelope() function that takes a Geometry parameter (again a POINT containing a LON/LAT coordinate pair) and an integer to create an envelope that would contain all points within the specified number of meters from the Geometry. ST_MakeEnvelope(point, distance) --- Make a rectangle around a point(x,y) so that the distance between the point and the rectangle's boundaries is 'distance' units (km) away. This is done on an abstract cartesian plane and simply creates an envelope that contains all points within a radius of approximately <distance> km around the <point>.
  12. In our example query we’re simplifying the bounding box calculation and using <km>/111, 111 being the average distance in km between longitude and latitude degrees. It’s not very accurate for longitude, in particular the further you get away from the equator, but it doesn’t have to be very accurate for our bounding box as we’re calculating the actual distance with our SLC function. The bounding box is just to pass down to the spatial index so that we can weed out all of the irrelevant points.