com presentations: MongoDB/Geo talk for TrueNorth: geo-truenorth16.xml slides/map/finding-food-take2.xml slides/map/import-script-manchester.xml slides/map/leaflet-ajax.xml slides/map/leaflet-json-return.xml slides/map/leaflet-on-change.xml slides/map/leaflet.xml slides/map/osm-xapi.xml slides/mongodb/big-polygon1.xml slides/mongodb/cells.xml slides/mongodb/geo-aggregation2.xml slides/mongodb/geo-in-2.4.xml slides/mongodb/geo-intersects.xml slide

[email protected] (Derick Rethans) Mon, 21 Nov 2016 08:59:16 +0000
Newsgroups php.pres
Message-ID <[email protected]>
Commit:    1e8330fab741aa4235f54eb6ee2886dec047fda4
Author:    Derick Rethans <[email protected]>         Mon, 21 Nov 2016 08:59:16 +0000
Parents:   294fdb1d5c72ef3320b7ee6acf183f9df38b9a2e
Branches:  master

Link:       http://git.php.net/?p=presentations.git;a=commitdiff;h=1e8330fab741aa4235f54eb6ee2886dec047fda4

Log:
MongoDB/Geo talk for TrueNorth

Changed paths:
  A  geo-truenorth16.xml
  M  slides/map/finding-food-take2.xml
  M  slides/map/import-script-manchester.xml
  A  slides/map/leaflet-ajax.xml
  A  slides/map/leaflet-json-return.xml
  A  slides/map/leaflet-on-change.xml
  M  slides/map/leaflet.xml
  M  slides/map/osm-xapi.xml
  M  slides/mongodb/big-polygon1.xml
  M  slides/mongodb/cells.xml
  M  slides/mongodb/geo-aggregation2.xml
  M  slides/mongodb/geo-in-2.4.xml
  M  slides/mongodb/geo-intersects.xml
  M  slides/mongodb/geo-near.xml
  M  slides/mongodb/geo-within.xml
  A  slides/mongodb/leaflet.jpg
  A  slides/mongodb/locations.png
  A  slides/mongodb/osm-import-leaflet-section.xml
  A  slides/mongodb/osm-import-location-section.xml
  A  slides/mongodb/osm-import-tags-section.xml
  M  slides/mongodb/osm-schema4.xml
  M  slides/mongodb/osm-to-mongo-data3.xml
  A  slides/mongodb/tags.png
diff_1e8330fab741aa4235f54eb6ee2886dec047fda4.txt (text/plain, 20.3 KB)
diff --git a/geo-truenorth16.xml b/geo-truenorth16.xml
new file mode 100644
index 0000000..fa70589
--- /dev/null
+++ b/geo-truenorth16.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8"?>
+<presentation css="10gen-strict.css">
+<topic>MongoDB</topic>
+<title>Locate All The Things</title>
+<event>TrueNorth PHP</event>
+<location>Missisauga, ON, Canada</location>
+<lat>43.6124</lat><lon>-79.7537</lon>
+<date>November 5th, 2016</date>
+<speaker>Derick Rethans</speaker>
+<email>[email protected]</email>
+<twitter>derickr</twitter>
+<joindin>http://joind.in/19711</joindin>
+
+<slide>slides/mongodb/title.xml</slide>
+
+<slide>slides/mongodb/closed-pub.xml</slide>
+<!-- A few words about our dataset -->
+
+<slide>slides/mongodb/few-words-about-osm.xml</slide>
+
+<slide>slides/map/osm-data.xml</slide>
+
+<slide>slides/mongodb/osm-import-tags-section.xml</slide>
+
+<slide>slides/map/osm-tags1.xml</slide>
+<slide>slides/map/osm-tags2.xml</slide>
+<slide>slides/map/osm-tags3.xml</slide>
+
+
+<slide>slides/mongodb/osm-to-mongo-data.xml</slide>
+<slide>slides/mongodb/osm-to-mongo-data2.xml</slide>
+<slide>slides/mongodb/osm-to-mongo-data3.xml</slide>
+<slide>slides/mongodb/osm-to-mongo-data4.xml</slide>
+
+<slide>slides/mongodb/osm-import-4times-section.xml</slide>
+<slide>slides/mongodb/osm-schema1.xml</slide>
+<slide>slides/mongodb/osm-schema2.xml</slide>
+<slide>slides/mongodb/osm-schema4.xml</slide>
+<slide>slides/mongodb/osm-schema3.xml</slide>
+<slide>slides/mongodb/osm-schema-summary.xml</slide>
+
+<!-- DATA STORAGE -->
+<!--
+	No more [ lon, lat ], but geojson instead
+
+SAY WHERE ELSE GeoJson is used
+-->
+<slide>slides/mongodb/osm-import-location-section.xml</slide>
+<slide>slides/mongodb/geojson.xml</slide>
+
+<!--
+	POINT:
+    show an image, and the GeoJson under 
+-->
+<slide>slides/mongodb/geojson-point.xml</slide>
+<!--
+	LINESTRING:
+    show an image, and the GeoJson under 
+-->
+<slide>slides/mongodb/geojson-linestring.xml</slide>
+<!--
+	POLYGON:
+    show an image, and the GeoJson under 
+-->
+<slide>slides/mongodb/geojson-polygon.xml</slide>
+
+<!--
+	CELLS,
+    We divide the surface of the earth into cells
+        A library called S2 from Google does the hard work
+    Cells have a level which define the size of the cell.
+    S2 provides 31 levels
+    The higher the level, the smaller the cell, and therefore the more needed to cover the earth
+    By default, we use all levels between 500m on a side and 100km on a side
+-->
+<slide>slides/mongodb/cells.xml</slide>
+<!--
+	Show grid of (part of) London:
+	- Point, Westminster palace
+	- Line, Oxford Street
+    - Polygon, Hyde Park
+-->
+<slide>slides/mongodb/cells-level10-example-london-1.xml</slide>
+<slide>slides/mongodb/cells-level10-example-london-2.xml</slide>
+<slide>slides/mongodb/cells-level10-example-london-3.xml</slide>
+
+<slide>slides/map/osm-xapi.xml</slide>
+<slide>slides/map/osm-data.xml</slide>
+<slide>slides/map/import-script-manchester.xml</slide>
+
+
+<!-- operators
+    $near
+        find stuff near a point
+        index required
+    $geoWithin
+        find stuff within a polygon/circle
+        index NOT required
+    $geoIntersects
+        find stuff that intersects with other stuff
+        index NOT required
+
+-->
+<slide>slides/mongodb/geo-in-2.4.xml</slide>
+
+<!-- near
+	- Example with road and park
+	- slide with index/no index, and comparsion with 2.2?
+-->
+<!-- geoWithin
+	- Example with road and park
+	- slide with index/no index, and comparsion with 2.2?
+-->
+<!-- geoIntersects
+	- Example with road and park
+	- slide with index/no index, and comparsion with 2.2?
+-->
+<slide>slides/mongodb/geo-near.xml</slide>
+
+<!--
+	NEAR
+
+    Starts from a point
+    Looks at concentric donuts from that point
+    Want to look at documents within the donut
+    If distance from query point to document is within the donut, output
+    Adapts size of the donut as needed
+-->
+<!--
+	GeoWithin/GeoIntersecs
+
+    Generate a covering for geometry in query
+    Look at all points in all overlapping cells
+        Cells may be larger or smaller than our covering
+        Must look at cells that contain our covering
+        Must look at cells that we contain
+    See if documents are within or intersect our query geometry
+
+	Show examples of:
+	- within: The Palace of Westminster (point) in "City of Westminster" (polygon)
+	- intersect: thames (line) crossing London (polygon)
+-->
+<slide>slides/mongodb/geo-within.xml</slide>
+<slide>slides/mongodb/geo-within-2.xml</slide>
+
+<slide>slides/mongodb/geo-intersects.xml</slide>
+
+
+<!--
+Without index:
+    $near
+        Look at every point
+        Sort by distance
+        Very slow, so requires an index.
+    $geoWithin
+        Look at every document
+        Is it within the query polygon?
+        Order is arbitrary
+    $geoIntersects
+        Look at every document
+        Does it intersect with the query geometry?
+        Order is arbitrary
+-->
+<!-- AGGREGATION:
+
+	- show tube stations per borough
+	- show pubs by borough
+
+http://docs.mongodb.org/manual/reference/aggregation/#stage._S_geoNear
+
+- distance is important
+- $geoNear in aggregation can't deal with more than one 2dsphere index
+- spherical option is *required* when using a 2dsphere index
+-->
+<slide>slides/mongodb/geo-aggregation.xml</slide>
+<slide>slides/mongodb/geo-aggregation2.xml</slide>
+
+<slide>slides/mongodb/osm-import-leaflet-section.xml</slide>
+
+<slide>slides/map/leaflet.xml</slide>
+<slide>slides/map/leaflet-ajax.xml</slide>
+<slide>slides/map/leaflet-json-return.xml</slide>
+
+<slide>slides/mongodb/resources.xml</slide>
+
+</presentation>
diff --git a/slides/map/finding-food-take2.xml b/slides/map/finding-food-take2.xml
index af9f9fb..8d77589 100644
--- a/slides/map/finding-food-take2.xml
+++ b/slides/map/finding-food-take2.xml
@@ -1,5 +1,5 @@
 <slide>
 <title>The data in action!</title>
 
-<iframe filename='examples/find-poi-3angle.php'/>
+<iframe filename='examples/find-poi-3angle.php?zoom=14&amp;lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
 </slide>
diff --git a/slides/map/import-script-manchester.xml b/slides/map/import-script-manchester.xml
index 0371063..2c2d595 100644
--- a/slides/map/import-script-manchester.xml
+++ b/slides/map/import-script-manchester.xml
@@ -16,7 +16,8 @@
 	</bullet>
 </list>
 
-<example>node_cache: 45.1MB — poiConcat:  84.2MB</example>
+<example>London:  cache_demo.nodecache:  45.1MB — demo.poiConcat:  84.2MB</example>
+<example>Toronto: cache_demo.nodecache: 229.3MB — demo.poiConcat:  54.7MB</example>
 
 <blurb>https://github.com/derickr/3angle</blurb>
 </slide>
diff --git a/slides/map/leaflet-ajax.xml b/slides/map/leaflet-ajax.xml
new file mode 100644
index 0000000..343ebaa
--- /dev/null
+++ b/slides/map/leaflet-ajax.xml
@@ -0,0 +1,4 @@
+<slide>
+<title>Acting on Change &amp; The Rest</title>
+<iframe filename='examples/3angle/?zoom=13&amp;l=fivepubs&amp;lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
+</slide>
diff --git a/slides/map/leaflet-json-return.xml b/slides/map/leaflet-json-return.xml
new file mode 100644
index 0000000..0d0af62
--- /dev/null
+++ b/slides/map/leaflet-json-return.xml
@@ -0,0 +1,27 @@
+<slide>
+<title>Feature Return JSON + GeoJSON</title>
+
+<example>
+<![CDATA[[
+    {
+        "type": "Feature",
+        "properties": {
+            "popupContent": "<b>The Drake and Firkin<\/b><br\/>amenity: pub\n",
+            "changed": false,
+            "name": "The Drake and Firkin",
+            "classes": "amenitypub"
+        },
+        "geometry": {
+            "type": "Point",
+            "coordinates": [
+                -79.750616,
+                43.610471
+            ]
+        }
+    },
+    …
+]]]>
+</example>
+
+<blurb align="center">https://github.com/derickr/3angle</blurb>
+</slide>
diff --git a/slides/map/leaflet-on-change.xml b/slides/map/leaflet-on-change.xml
new file mode 100644
index 0000000..75a1495
--- /dev/null
+++ b/slides/map/leaflet-on-change.xml
@@ -0,0 +1,36 @@
+<slide>
+<title>Detecting Change Event</title>
+<div effect="fade-out">
+<iframe filename='examples/leaflet-on-change.php?lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
+</div>
+<div effect="fade-in">
+<example><![CDATA[
+<!DOCTYPE html>
+<html>
+<head>
+    …
+</head>
+<body>
+    <div id="map" style="width: 1004px; height: 590px"></div>
+    <script type="text/javascript">
+        var map = new L.Map('map');
+        
+        var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
+            osmAttrib = 'Map data &copy; 2016 OpenStreetMap contributors',
+            osm = new L.TileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
+        
+        map.setView(new L.LatLng(:-:lat:-:, :-:lon:-:), 13).addLayer(osm);
+
+        map.on('moveend', changeLocation);
+
+        function changeLocation(event) {
+            center = map.getCenter();
+
+            alert( center.lat + ' - ' + center.lng );
+        }
+
+    </script>
+</body>
+</html>]]></example>
+</div>
+</slide>
diff --git a/slides/map/leaflet.xml b/slides/map/leaflet.xml
index 6860180..5c5d847 100644
--- a/slides/map/leaflet.xml
+++ b/slides/map/leaflet.xml
@@ -1,15 +1,14 @@
 <slide>
 <title>Showing a Map</title>
-<subtitle>Leaflet</subtitle>
 <div effect="fade-out">
-<iframe filename='examples/leaflet.html'/>
+<iframe filename='examples/leaflet.php?lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
 </div>
 <div effect="fade-in">
 <example><![CDATA[
 <!DOCTYPE html>
 <html>
 <head>
-    <title>Leaflet Quick Start Guide Example</title>
+    <title>Leaflet</title>
     <meta charset="utf-8" />
     
     <link rel="stylesheet" href="leaflet/leaflet.css" />
@@ -22,10 +21,10 @@
         var map = new L.Map('map');
         
         var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
-            osmAttrib = 'Map data &copy; 2011 OpenStreetMap contributors',
+            osmAttrib = 'Map data &copy; 2016 OpenStreetMap contributors',
             osm = new L.TileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
         
-        map.setView(new L.LatLng(51.5179, -0.12), 13).addLayer(osm);
+        map.setView(new L.LatLng(:-:lat:-:, :-:lon:-:), 13).addLayer(osm);
     </script>
 </body>
 </html>]]></example>
diff --git a/slides/map/osm-xapi.xml b/slides/map/osm-xapi.xml
index 9557349..5b38102 100644
--- a/slides/map/osm-xapi.xml
+++ b/slides/map/osm-xapi.xml
@@ -1,48 +1,14 @@
 <slide>
 <title>Fetching OSM data</title>
 
-<div effect="fade-out stop">
-<blurb>The whole planet (bad idea as it's 26GB):</blurb>
+<blurb>The whole planet (bad idea as it's 53GB):</blurb>
 <example>http://planet.openstreetmap.org/planet/planet-latest.osm.bz2</example>
 
 <blurb>A whole country:</blurb>
-<example>http://download.geofabrik.de/openstreetmap/europe/great_britain/england.osm.bz2</example>
+<example>http://download.geofabrik.de/europe/great-britain-latest.osm.bz2</example>
 
 <blurb>A metro extract:</blurb>
-<example>http://metro.teczno.com/#manchester</example>
+<example>https://mapzen.com/data/metro-extracts/</example>
 
-<blurb>XAPI (via Overpass):</blurb>
-<example>http://www.overpass-api.de/api/xapi?map?bbox=7.12,50.73,7.25,50.81</example>
-<example>http://www.overpass-api.de/api/xapi?*[bbox=7.1,51.2,7.2,51.3][amenity=pub]</example>
-</div>
-
-<div effect="fade-in">
-<blurb>Overpass</blurb>
-<example inline="3"><![CDATA[
-&lt;?php
-$bb = '&lt;bbox-query e="0.334" n="51.691" s="51.286" w="-0.510"/>';
-
-*$data = &lt;&lt;&lt;ENDDATA*
-*&lt;union>*
-*    &lt;query type="node">&lt;has-kv k="amenity" v="pub"/>$bb&lt;/query>*
-*    &lt;query type="way">&lt;has-kv k="amenity" v="pub"/>$bb&lt;/query>*
-*&lt;/union>*
-*&lt;query type="node">*
-*    &lt;has-kv k="real_cider" v="yes"/>*
-*&lt;/query>*
-*&lt;print/>*
-*ENDDATA;*
-
-$params = array(
-    'http' => array(
-        'method' => 'POST', 'content' => $data,
-        'header' => 'Content-Type: application/x-www-form-urlencoded'
-    )
-);
-$ctx = stream_context_create($params);
-echo file_get_contents("http://overpass-api.de/api/interpreter", false, $ctx);
-?>
-]]></example>
-</div>
 
 </slide>
diff --git a/slides/mongodb/big-polygon1.xml b/slides/mongodb/big-polygon1.xml
index 72ef008..bd946bf 100644
--- a/slides/mongodb/big-polygon1.xml
+++ b/slides/mongodb/big-polygon1.xml
@@ -7,7 +7,7 @@
 
 <div effect="fade-in">
 <list>
-	<bullet>Queries larger than a hemsiphere</bullet>
+	<bullet>Queries larger than a hemisphere</bullet>
 	<bullet>Special *CRS*: %urn:x-mongodb:crs:strictwinding:EPSG:4326%</bullet>
 	<bullet>"strictwinding" means "counter clockwise"
 	<image filename="bigp-london3a.png"/>
diff --git a/slides/mongodb/cells.xml b/slides/mongodb/cells.xml
index 5103664..274fab5 100644
--- a/slides/mongodb/cells.xml
+++ b/slides/mongodb/cells.xml
@@ -9,8 +9,9 @@
         </list>
     </bullet>
     <bullet>Cells have a level which define the size of the cell</bullet>
-    <bullet>S2 provides 31 levels</bullet>
+    <bullet>S2 provides 31 levels.</bullet>
+	<bullet>Level 0 is a ⅙th of the globe</bullet>
+	<bullet>Each further level devides by 4</bullet>
     <bullet>The higher the level, the smaller the cell, and therefore the more needed to cover the earth</bullet>
-    <bullet>By default, we use all levels between 500m on a side and 100km on a side</bullet>
 </list>
 </slide>
diff --git a/slides/mongodb/geo-aggregation2.xml b/slides/mongodb/geo-aggregation2.xml
index 4a9ce25..9cca80a 100644
--- a/slides/mongodb/geo-aggregation2.xml
+++ b/slides/mongodb/geo-aggregation2.xml
@@ -1,7 +1,7 @@
 <slide>
 <title>Aggregation: $geoNear example</title>
 
-<iframe align="right" width="500" filename='examples/3angle/?l=pubsaggr&amp;zoom=17;&amp;lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
+<iframe align="right" width="500" filename='examples/3angle/?l=pubsaggr&amp;zoom=16;&amp;lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
 
 <div effect="fade-out">
 <example inline="1"><![CDATA[
@@ -13,7 +13,7 @@ res = db.poiConcat.aggregate( [ {
     },
     'distanceField' : 'distance',
     'distanceMultiplier' : 1,
-    'maxDistance' : 500,
+    'maxDistance' : 5000,
     'spherical' : true,
     'query' : { 
       '$or' : [
diff --git a/slides/mongodb/geo-in-2.4.xml b/slides/mongodb/geo-in-2.4.xml
index d5a0f5b..99466c6 100644
--- a/slides/mongodb/geo-in-2.4.xml
+++ b/slides/mongodb/geo-in-2.4.xml
@@ -3,19 +3,19 @@
 
 <blurb>%$geoNear%</blurb>
 <list>
-     <bullet>find stuff near a point</bullet>
+     <bullet>find things near a point</bullet>
      <bullet>index required</bullet>
 </list>
 
 <blurb>%$geoWithin%</blurb>
 <list>
-     <bullet>find stuff within a polygon/circle</bullet>
+     <bullet>find things within a polygon/circle</bullet>
      <bullet>index *not* required</bullet>
 </list>
 
 <blurb>%$geoIntersects%</blurb>
 <list>
-     <bullet>find stuff that intersects with other stuff</bullet>
+     <bullet>find things that intersects with other things</bullet>
      <bullet>index *not* required</bullet>
 </list>
 
diff --git a/slides/mongodb/geo-intersects.xml b/slides/mongodb/geo-intersects.xml
index 79237d5..46d0a76 100644
--- a/slides/mongodb/geo-intersects.xml
+++ b/slides/mongodb/geo-intersects.xml
@@ -33,6 +33,5 @@ db.poiConcat.find( {
 { "_id" : "n2066862842", "ts" : [ "addr:housenumber=440", "addr:street=Strand", "amenity=bank", "name=Coutts &amp; Co", "phone=+44 2077 531000", "postal_code=WC2R 0QS", "website=http://www.coutts.com/locations/london-strand/" ] }
 { "_id" : "w166702178", "ts" : [ "layer=-3", "line=Jubilee", "name=Jubilee Line (disused)", "network=London Underground", "oneway=yes", "railway=disused", "tunnel=yes" ] }
 { "_id" : "w166707824", "ts" : [ "layer=-2", "name=Northern Line Southbound", "railway=platform" ] }
-{ "_id" : "w166707825", "ts" : [ "layer=-2", "name=Northern Line Northbound", "railway=platform" ] }
 </example>
 </slide>
diff --git a/slides/mongodb/geo-near.xml b/slides/mongodb/geo-near.xml
index 9fc3f45..5a21375 100644
--- a/slides/mongodb/geo-near.xml
+++ b/slides/mongodb/geo-near.xml
@@ -4,7 +4,7 @@
 <!--
 <image filename="near-pub.png" align="right"/>
 -->
-<iframe align="right" width="500" filename='examples/3angle/?l=fivepubs&amp;zoom=17;&amp;lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
+<iframe align="right" width="500" filename='examples/3angle/?l=fivepubs&amp;zoom=14;&amp;lat=:-:lat:-:&amp;lon=:-:lon:-:'/>
 
 <example inline="1">
 db.poiConcat.find( {
diff --git a/slides/mongodb/geo-within.xml b/slides/mongodb/geo-within.xml
index 8320985..13c4221 100644
--- a/slides/mongodb/geo-within.xml
+++ b/slides/mongodb/geo-within.xml
@@ -16,7 +16,6 @@ db.poiConcat.find( {
   *} },*
   ts: "amenity=cafe"
 } );
-
 </example>
 
 <example inline="1">
diff --git a/slides/mongodb/leaflet.jpg b/slides/mongodb/leaflet.jpg
new file mode 100644
index 0000000..279ce13
Binary files /dev/null and b/slides/mongodb/leaflet.jpg differ
diff --git a/slides/mongodb/locations.png b/slides/mongodb/locations.png
new file mode 100644
index 0000000..2fda18d
Binary files /dev/null and b/slides/mongodb/locations.png differ
diff --git a/slides/mongodb/osm-import-leaflet-section.xml b/slides/mongodb/osm-import-leaflet-section.xml
new file mode 100644
index 0000000..75f083a
--- /dev/null
+++ b/slides/mongodb/osm-import-leaflet-section.xml
@@ -0,0 +1,4 @@
+<slide style="title">
+<title>Leaflet</title>
+<image align="center" filename="leaflet.jpg" attr=""/>
+</slide>
diff --git a/slides/mongodb/osm-import-location-section.xml b/slides/mongodb/osm-import-location-section.xml
new file mode 100644
index 0000000..d849bda
--- /dev/null
+++ b/slides/mongodb/osm-import-location-section.xml
@@ -0,0 +1,4 @@
+<slide style="title">
+<title>Locations</title>
+<image align="center" filename="locations.png" attr=""/>
+</slide>
diff --git a/slides/mongodb/osm-import-tags-section.xml b/slides/mongodb/osm-import-tags-section.xml
new file mode 100644
index 0000000..8c95c78
--- /dev/null
+++ b/slides/mongodb/osm-import-tags-section.xml
@@ -0,0 +1,4 @@
+<slide style="title">
+<title>Tags</title>
+<image align="center" filename="tags.png" attr=""/>
+</slide>
diff --git a/slides/mongodb/osm-schema4.xml b/slides/mongodb/osm-schema4.xml
index 9b081ef..e83906b 100644
--- a/slides/mongodb/osm-schema4.xml
+++ b/slides/mongodb/osm-schema4.xml
@@ -13,7 +13,7 @@ $db->poi->createIndex( [ 'tags' => 1 ] );
 // Road with name=Strand
 $db->poi->find( [ 'tags' => 'name=Strand' ] );
 // All roads
-$db->poi->find( [ 'tags' => new MongoRegex( '/^highway=/' ) ] );</example>
+$db->poi->find( [ 'tags' => new \MongoDB\BSON\Regex( '/^highway=/' ) ] );</example>
 <list>
     <bullet>One index required</bullet>
     <bullet>Good for finding key/value combinations</bullet>
diff --git a/slides/mongodb/osm-to-mongo-data3.xml b/slides/mongodb/osm-to-mongo-data3.xml
index 508b94f..2101470 100644
--- a/slides/mongodb/osm-to-mongo-data3.xml
+++ b/slides/mongodb/osm-to-mongo-data3.xml
@@ -8,12 +8,23 @@
 <blurb>Let's look at the "explain" output:</blurb>
 <example inline="1">db.poi.find( { 'tags.amenity' : 'pub' } ).explain();
 {
-    "cursor" : "BasicCursor",
-    "isMultiKey" : false,
-*|e70000|    "n" : 3895,|*
-*|e70000|    "nscannedObjects" : 2347913,|*
-    "nscanned" : 2347913,
-    ...
+    "queryPlanner" : {
+        "plannerVersion" : 1,
+        "namespace" : "demo.poiConcat",
+        "indexFilterSet" : false,
+        "parsedQuery" : {
+            "tags.amenity" : { "$eq" : "pub" }
+        },
+        "winningPlan" : {
+            "stage" : *"COLLSCAN"*,
+            "filter" : {
+                "tags.amenity" : { "$eq" : "pub" }
+            },
+            "direction" : "forward"
+        },
+        "rejectedPlans" : [ ]
+    },
+    …
 </example>
 </div>
 
@@ -22,13 +33,24 @@
 <example>db.poi.createIndex( { "tags.amenity" : 1 } );</example>
 <blurb>And the new "explain" output:</blurb>
 <example inline="1">db.poi.find( { 'tags.amenity' : 'pub' } ).explain();
-{
-    "cursor" : "BtreeCursor tags.amenity_1",
-    "isMultiKey" : false,
-    "n" : 3895,
-*|00e700|    "nscannedObjects" : 3895,|*
-    "nscanned" : 3895,
-    ...
+…
+        "winningPlan" : {
+            "stage" : "FETCH",
+            "inputStage" : {
+                *|007700|"stage" : "IXSCAN",|*
+                "keyPattern" : { "tags.amenity" : 1 },
+                "indexName" : "tags.amenity_1",
+                "isMultiKey" : false,
+                "isUnique" : false,
+                "isSparse" : false,
+                "isPartial" : false,
+                "indexVersion" : 1,
+                "direction" : "forward",
+                "indexBounds" : {
+                    "tags.amenity" : [ "[\"pub\", \"pub\"]" ]
+                }
+            }
+        },
 </example>
 </div>
 </slide>
diff --git a/slides/mongodb/tags.png b/slides/mongodb/tags.png
new file mode 100644
index 0000000..2d3b2e2
Binary files /dev/null and b/slides/mongodb/tags.png differ