<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Reto Meier on Medium]]></title>
        <description><![CDATA[Stories by Reto Meier on Medium]]></description>
        <link>https://medium.com/@retomeier?source=rss-d2cb9c480c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NYcn221Dtf452z9Z9HnYbw.jpeg</url>
            <title>Stories by Reto Meier on Medium</title>
            <link>https://medium.com/@retomeier?source=rss-d2cb9c480c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 12 Nov 2026 08:59:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@retomeier/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Professional Android 4th Edition]]></title>
            <link>https://medium.com/@retomeier/professional-android-4th-edition-c4013f1795f2?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4013f1795f2</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Tue, 25 Sep 2018 14:57:36 GMT</pubDate>
            <atom:updated>2018-09-26T22:32:16.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZCPPD5L6Il8GYiSbH1Z_g.jpeg" /></figure><h4>A new cover, title, and co-author; and lots of new content</h4><p><a href="https://www.amazon.com/Professional-Android-Reto-Meier/dp/1118949528">Professional Android 4th Edition</a> is now available, and will start shipping today (September 25th) from <a href="https://www.amazon.com/Professional-Android-Reto-Meier/dp/1118949528">Amazon</a>!</p><blockquote>You can order <em>Professional Android 4E</em> in paperback from <a href="https://www.amazon.com/Professional-Android-Reto-Meier/dp/1118949528">Amazon </a>or <a href="https://www.bookdepository.com/Professional-Android-Ian-Lake/9781118949528">The Book Repository</a>, or <a href="https://www.indiebound.org/book/9781118949528">your local bookseller</a>. Or for your electronic reading pleasure, <a href="https://www.amazon.com/Professional-Android-Reto-Meier-ebook/dp/B07GWZRM8K">Kindle US</a> (and <a href="https://www.amazon.co.uk/Professional-Android-Reto-Meier-ebook/dp/B07GWZRM8K">UK</a>) or <a href="https://play.google.com/store/books/details/Reto_Meier_Professional_Android?id=Wu5qDwAAQBAJ">Google Play Books</a>.</blockquote><p>This edition was written using <a href="https://developer.android.com/studio/">Android Studio 3.1</a> and targeting <a href="https://developer.android.com/about/versions/pie/android-9.0-changes-28">API Level 27</a> (with some coverage of API 28 changes). It introduces <a href="https://developer.android.com/kotlin/">Kotlin</a>, but the code samples are written using Java syntax (we plan to make them available in Kotlin on <a href="https://github.com/retomeier/Wrox-ProfessionalAndroid-4E">Github </a>as well — stay tuned!).</p><p>As always, it covers both the fundamentals of Android development, and explores advanced features and best practices for more experienced Android developers. That includes <a href="https://developer.android.com/topic/libraries/architecture/">Android Architecture Components</a> (including Job Scheduler, Live Data, and Room), <a href="https://material.io/design/">material design</a> principles and practice, <a href="https://developers.google.com/android/guides/overview">Google Play services</a> including maps, location, and awareness, and introduces the <a href="https://firebase.google.com/">Firebase APIs</a>.</p><p>All the code snippets and projects from the book are available at <a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-Android-4th-Edition.productCd-1118949528,descCd-DOWNLOAD.html">Wrox.com</a> and <a href="https://github.com/retomeier/Wrox-ProfessionalAndroid-4E">our GitHub repo</a> (please <a href="https://github.com/retomeier/Wrox-ProfessionalAndroid-4E/issues">raise an issue</a> for any bugs!), and you can always get in touch with <a href="https://www.twitter.com/retomeier">@retomeier</a> and <a href="https://www.twitter.com/ianhlake">@ianhlake</a> on Twitter.</p><p>It’s been 6 years since the last revision, 5 years since I agreed to write a new edition (in time for Android 5), and nearly four years since people started pre-ordering their copies on Amazon.</p><h3>Chris #io18 on Twitter</h3><p>Hey @retomeier I saw that your latest Professional Android Dev book will ship Sept 27th, 2018. Should see how old the oldest pre-orders are, and/or sign those copies :D I pre-ordered mine Jan 27, 2015!!</p><p>It’s also been <strong>10 years </strong>since the first copy of <em>Professional Android Application Development</em> rolled off the presses, and — because numbers are fun — it also mainly* follows the existing pattern of:</p><pre>Target Android OS Version = 2^(book edition-1)</pre><p>(*<em>Some stuff from Android 9.0 may have snuck in towards the end there</em>.)</p><p>10 years is a long time; Android has come a long way since I guest blogged about building my first Android app using the 0.8 beta SDK on Google Blogoscoped and Chris Webb from <a href="https://twitter.com/wrox">@Wrox</a> emailed me saying he,</p><blockquote>“Would be interested in speaking with you about your thoughts on the [Android] SDK. We are considering it for a book.”</blockquote><p>While I wrote that first book, the <a href="https://www.t-mobile.com/news/t-mobile-unveils-the-t-mobile-g1-the-first-phone-powered-by">first Android handset</a> hadn’t been released, and the <a href="https://play.google.com/store/apps">Google Play Store</a> (or the <em>Android Market</em> as it was originally named) didn’t have its first app. Today, Android runs on some 2 billion monthly active devices, and in 2017 the Google Play store delivered over 94 billion app downloads.</p><p>In between, there’s been 28 API releases, 14 Android dessert flavors, <a href="https://developer.android.com/studio/">a new IDE</a>, a <a href="https://developer.android.com/kotlin/get-started">new 1st-class programming language</a>, and scores of new platform APIs — not to mention the introduction of material design, the Android Support Library, Google Play services, Android Architecture Components, and Jetpack.</p><p>As a result, Professional Android has grown too. The 4th edition is more than double the size of the first edition, with 500 additional pages. We’re up to our 3rd cover, and we’ve added a co-author — the amazing <a href="https://medium.com/u/51a4f24f5367">Ian Lake</a> (Ed: Hi Ian!)</p><h4><strong>What’s new?</strong></h4><p>The Fourth Edition is fully revised and expanded. It includes detailed coverage of the fundamentals needed by novice developers, and explores advanced features and best practices essential to experienced Android developers creating compelling user experiences, it:</p><ul><li>Covers the latest Android APIs, including the Job Scheduler, Android Architecture Components (including Live Data and Room), and Data Binding</li><li>Offers a detailed exploration of the Android Studio IDE and an introduction to Kotlin</li><li>Introduces material design principles and offers a detailed look at design guidelines, navigation patterns, and UI best practices</li><li>Demonstrates techniques to create compelling UIs for all Android form factors</li><li>Explores Firebase and Google Play services API libraries, including maps, location-based services, and the Awareness API</li></ul><h4>Support</h4><p>You can download all the code snippets and sample projects used in the book from the <a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-Android-2-Application-Development-2nd-Edition.productCd-0470565527,descCd-DOWNLOAD.html">Wrox site</a> or from <a href="https://github.com/retomeier/Wrox-ProfessionalAndroid-4E">our GitHub repo</a>.</p><p>If you’ve got any questions, you can get in touch with me over on <a href="http://www.twitter.com/retomeier">Twitter</a> (<a href="https://www.twitter.com/retomeier">@retomeier</a>). If you find a bug in the code, please <a href="https://github.com/retomeier/Wrox-ProfessionalAndroid-4E/issues">raise an issue</a> and we’ll get it fixed. For more help with Android development, I’d recommend using <a href="http://stackoverflow.com/questions/tagged/PA4AD">Stack Overflow</a>; <a href="https://medium.com/u/51a4f24f5367">Ian Lake</a> and I will keep an eye out and help where we can.</p><p>We’re also known to frequent some of the more popular Android Slack channels.</p><h4>Where to buy</h4><p>Professional Android 4E is currently available for purchase at these fine retailers:</p><ul><li><a href="https://www.amazon.com/Professional-Android-Reto-Meier/dp/1118949528">Amazon.com</a></li><li><a href="https://www.barnesandnoble.com/w/professional-android-reto-meier/1120141911">Barnes &amp; Noble</a></li><li><a href="https://www.bookdepository.com/Professional-Android-Ian-Lake/9781118949528">The Book Depository</a></li><li><a href="https://www.indiebound.org/book/9781118949528">Your local bookseller</a></li></ul><p>If you prefer to travel light, there’s an electronic version to suit your tastes:</p><ul><li><a href="https://www.amazon.com/Professional-Android-Reto-Meier-ebook/dp/B07GWZRM8K">Kindle US</a></li><li><a href="https://www.amazon.co.uk/Professional-Android-Reto-Meier-ebook/dp/B07GWZRM8K">Kindle UK</a></li><li><a href="https://play.google.com/store/books/details/Reto_Meier_Professional_Android?id=Wu5qDwAAQBAJ">Google Play Books</a></li><li><em>DRM-free PDF, Mobi, and ePub coming soon from Wrox</em></li><li><em>Safari Books coming soon</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rks5GL-5a3r0yrLmQwyzIQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4013f1795f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Virtual World Worthy of Sci-Fi]]></title>
            <link>https://medium.com/google-developers/building-a-virtual-world-worthy-of-sci-fi-3d48e2fd05e3?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d48e2fd05e3</guid>
            <category><![CDATA[mmorpg]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Fri, 19 Jan 2018 19:19:30 GMT</pubDate>
            <atom:updated>2018-01-19T19:20:22.389Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/u/d2cb9c480c2">Reto Meier</a> and <a href="https://medium.com/u/6e1a63c4fcd1">Colt McAnlis</a> present Build Out (Episode 2)</h4><h4>Designing a global metaverse</h4><p>In the second episode of Build Out, <a href="https://medium.com/u/6e1a63c4fcd1">Colt McAnlis</a> and <a href="https://medium.com/u/d2cb9c480c2">Reto Meier</a> were given the challenge of designing a global metaverse.</p><p>Take a look at the video to see what they came up with, then continue reading to see how you can learn from their explorations to build your own solution!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLOU2XLYxmsILr0RmtqFITcoXnfOrWtytp&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DH9FbNi5aYYM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FH9FbNi5aYYM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/99e835b9748445bc4c0df7a5d80bac34/href">https://medium.com/media/99e835b9748445bc4c0df7a5d80bac34/href</a></iframe><h3>TL;DW: What they designed</h3><p>Both solutions describe a design to generate a 3D environment that users experience using a virtual reality headset, using various levels of cloud compute and storage to provide virtual Earth data to the client, and calculate changes to the world environment as users interact with it.</p><p><strong>Reto’s solution</strong> is focussed on creating a virtual clone of the real world using millions of drones to obtain real-time sensor readings. His virtual space is intrinsically linked to the real-world, including everything from geometry to prevailing weather conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61k82U4FxUM9lOfd34stlg.png" /></figure><p><strong>Colt’s solution</strong> leverages his video game development experience with a system design that completely disconnects the virtual world from the physical world. His architecture details the required framework for building the back-end services for an MMO (or other large scale cooperative space.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Es5nrGnQu3jQYirGuq8aPw.png" /></figure><h3>Building your own global metaverse</h3><p>The biggest difference in these designs is the source of the virtual environments’ climate and geometry. Reto’s design relies on analyzing the results of sensors in the real-world, where Colt’s system uses artists to contribute artificial landscapes and buildings.</p><p>If you want a system that incorporate real-world geometry and textures, you can use Google Maps as inspiration.</p><p>Their system uses a combination of imagery and sensor data to generate 3D models along with texture information for those models. This allows them to generate very realistic 3D representations of urban environments without needing to employ an army of artists to recreate the same content.</p><p>Mirroring this process let’s us generate a very similar representation. We can use satellite data, LIDAR input, and drone photography from various angles and sources, and push that into a GCS bucket.</p><p>Along with that, we generate work information and push work tokens off to pub/sub. We have a fleet of pre-emptive VMs working to gather those pub/sub requests, and start doing 3D meshing and texture atlas generation. The final results are pushed into a GCS bucket as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2awv-uWabgiVAepGrpUdzA.png" /></figure><blockquote><strong>Why pre-emptive VMs?</strong> PVMs allow themselves to be terminated by the Compute Engine manager. As such they offer a significantly discounted price than standard VMs of the same configuration. Since their lifespans are volatile, they are perfect for batch work jobs where work may get interrupted and not completed.</blockquote><p>Pub/sub works hand-in-hand with PVMs in this regard. Once a PVM received a termination signal, it can stop work, and push the workload back to pubsub for another PVM to pick up and work on later.</p><p>Alternatively, or for areas where this algorithm fails, you could allow users to submit custom models and textures for iconic landmarks, which we can then be inserted into the generated 3D environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ngyDPNUw6GqNRdxWnvJrA.png" /></figure><h3>Storing and distributing metaverse binary data</h3><p>Once all of our mesh and texture data has been processed, the result will be literal terabytes of virtual environment environmental data. Obviously, we can’t stream all that to each client at once, so instead, we bundle up model data based upon geographic boundaries.</p><p>These “regional blobs” are indexed, contain metadata, and can be stored in multi-layered compressed archives so that they can be streamed to the client.</p><p>To compute this, use the same offline build-process as for 3D mesh generation; specifically you can generate a bunch of tasks for pub/sub, and use an army of preemptive vms to compute and combine the proper regional blob archives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEkaLsDQMXbQVvygHYrhGw.png" /></figure><p>Distribution of the regional archives to the client depends on the user’s “physical” location in the virtual universe — as well as what direction they’re facing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jz_zqlU5Ca0MGIIGGjUMlg.png" /></figure><p>In order to optimize load times for the client, it’ll make sense to add a local cache for areas they visit frequently, to keep them from having to download gigs of data every time they enter a new area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6b2I4tUiPyn3pVSw7aPwfg.png" /></figure><p>For the sake of diagram clarity, we can wrap this entire process up as an offline system, and call it “Automated Content Generation” (ACG).</p><p>Over time, the local cache will become invalid, or updates will be need to be pushed out to the user. For this, we put together an update &amp; staging process, where a client can receive the updated environment data as they log-in, or as they re-enter a zone they have recently visited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lCgVkyWLf2gSqfZE2Wlhww.png" /></figure><blockquote><strong>Why GCF?</strong> There’s many ways to allow a client to check for updates. For example, we could create a load balancer which auto-scales a group of GCE instances. Or we could have made a Kubernetes pod which can scale for requests as well.</blockquote><blockquote>Or we could have used app engine flex, which would allow us to provide our own images, but scale just the same. Or we could have used app engine standard, which has its own deployment and scaling.</blockquote><blockquote>The reason we chose Cloud Functions here: First, GCF has enhanced support for Firebase push notifications. If something’s occuring, and we need to notify the client of an emergency patch, we can push that data to the client directly.</blockquote><blockquote>Secondly, GCF needs the least amount of work to get a function deployed. We don’t have to spend extra cycles configuring images, balancing, or deployment specifics; we simply just write our code, and push it out to be ready to be used.</blockquote><h3>Simulation data for your metaverse</h3><p>As your users move and interact with the virtual environment, any changes they make will need to be synced with the rest of the universe data and shared with other users.</p><p>You’ll need some composite components to make sure that user actions aren’t violating any physical rules, and then a system for storing or broadcasting this information to the other players.</p><p>For this, you can leverage a set of App Engine Flex groups, called “World Shards” which allow geographically similar clients to connect and exchange data on position and movement information. So as a user enters a game zone, we’ll figure out their closest region, and connect them directly to the appropriate World Shard.</p><blockquote><strong>Why App Engine Flex?</strong> For the World Shards, we could have easily used an instanced group of GCE VMs, which share an image, however app engine flex gives us that same functionality w/o needing the extra maintenance overhead. Likewise, a GKE Kubernetes cluster would have done the trick, but for our scenario, we didn’t need some of the advanced features that GKE provides.</blockquote><p>We’ll also need a separate set of compute instances to help us manage all the secondary world-interaction items. Things like purchasing goods, inter-player communication, and so on. For this you can spin up a second group of App Engine Flex instances.</p><p>All persistent data that needs to be distributed to multiple other clients will be stored in cloud Spanner, which will allow regionally similarly clients to share information as soon as it happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQnoHJeVWVQbJJr8ELQKcQ.png" /></figure><blockquote><strong>Why Spanner?</strong> We chose spanner here due to it’s managed service, global capacity, and ability to scale to handle very high transactional workloads. You could have also done this with a SQL system, but at that point, you’re doing a lot of heavy lifting in order to get the same effect.</blockquote><p>Since our code will change often, we need to augment our updating and staging servers to also distribute code to our world-shards. Do this, we allow compute-level staging to occur in our staging code, and push images to Google Container Registry to be propped out to various world shards and game servers as needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V0jjfEVbgTpBA1T91L1W1A.png" /></figure><h3>Drawing your metaverse</h3><p>A metaverse isn’t a metaverse unless you have a strapped on headset. For this, you can leverage Google VR and the Android Daydream platform to render our massive metaverse within a fully immersive VR experience. However Daydream by itself is not a proper rendering engine, so you’ll need to leverage something like UNITY as a tool to help draw all our models and interact with the Daydream system on our behalf.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMAXUcr7QcZXdnFnOm38WA.png" /></figure><p>Describing how to properly render millions of polygons per frame in VR mode is a big challenge, but one that’s outside the scope of this article ;)</p><h3>Account &amp; Identity services</h3><p>We’re going to add an app engine front-end instance that leverages Cloud IAM to authenticate and identify the user, and communicate with the account management database, which may include sensitive information like billing and contact data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_XrckPhaLAUKQbfkJAV48g.png" /></figure><blockquote><strong>Why App Engine Standard?</strong> We chose app engine standard as the front-end service for our IAM system for a number of reasons.</blockquote><blockquote>Firstly is that it’s managed, so we don’t have to deal with provisioning and deployment details like with containers/ GKE/ App Engine Flex.</blockquote><blockquote>Secondly, it has built in IAM rules and configurations, so we can write less code and get the right security and login systems we need.</blockquote><blockquote>Thirdly, it has direct built in support for datastore, which we use to store all of our IAM data.</blockquote><p>To hear a more detailed account of some of our choices, check out our companion podcast, Build Out Rewound, our on <a href="https://play.google.com/music/listen#/ps/Imvre4gs5o4fv2aqknxopy6cb7q">Google Play Music</a>, iTunes, or <a href="http://feeds.feedburner.com/BuildOutRewound">your favorite podcast app / site</a>.</p><p>Add a comment here, or on our YouTube video, with any questions you have about our system design or technology choices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d48e2fd05e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/building-a-virtual-world-worthy-of-sci-fi-3d48e2fd05e3">Building a Virtual World Worthy of Sci-Fi</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Garden that Cares for Itself]]></title>
            <link>https://medium.com/google-developers/building-a-garden-that-cares-for-itself-9918a3d3be72?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/9918a3d3be72</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[build-out]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gardening]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Wed, 01 Nov 2017 21:04:14 GMT</pubDate>
            <atom:updated>2020-02-19T20:07:31.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1MrEsiDwVEirTr64oBx7qQ.png" /></figure><h4><a href="https://medium.com/u/d2cb9c480c2">Reto Meier</a> and <a href="https://medium.com/u/6e1a63c4fcd1">Colt McAnlis</a> present <em>Build Out (Episode 1)</em></h4><h3>A Garden that Cares for Itself</h3><h4>Designing an autonomous, learning smart garden</h4><p>In the first episode of <em>Build Out</em>, Colt and Reto — tasked with designing the architecture for a “Smart Garden” — supplied two very different concepts, that nevertheless featured many overlapping elements. Take a look at the video to see what they came up with, then continue reading to see how you can learn from their explorations to build your very own <em>Smart Garden</em>.</p><h3>TL;DW: What they built</h3><p>Both solutions aim to optimize plant care using sensors, weather forecasts, and machine learning. Watering and fertilizing routines for the plants are updated regularly to guarantee the best growth, health, and fruit yield possible.</p><p><strong>Colt’s solution</strong> is optimized for small-scale home farming, using a modified <a href="https://en.wikipedia.org/wiki/Numerical_control">CNC machine</a> to care for a fruit or vegetable patch. The drill bit is replaced with a liquid spout, UV light, and camera, while the cutting area is replaced with a plant bed that includes sensors to track moisture, nutrient levels, and weight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3B4bb1CI3r2BA3dMAwt8w.png" /><figcaption><em>Colt’s CNC machine-based automated grower</em></figcaption></figure><p><strong>Reto’s solution</strong> extends a typical garden sprinkler / reticulation system into a distributed autonomous garden care system. A liquid / fertilizer spout and soil sensors are incorporated into each stand-alone device, each of which is installed alongside a plant in your garden — allowing each plant to receive a custom care regime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NW7_RKCUaBuq2A3BqhjCfA.png" /><figcaption>Reto’s distributed garden care solution</figcaption></figure><h3>How to build your own Smart Garden</h3><p>The basic system architecture is based around the following common components:</p><ul><li>One or more devices powered by a <a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/">microprocessor</a> / <a href="https://www.arduino.cc/">micro-controller</a>.</li><li>An <a href="https://developer.android.com/things/hardware/index.html">Android Things</a> “hub” that connects the garden care device(s) to the cloud.</li><li>A cloud server component built around an <a href="https://cloud.google.com/appengine/docs/flexible/">App Engine Flexible environment</a> that processes camera and sensor results, and determines the appropriate changes to the plant care instructions.</li><li>A machine learning implementation built around <a href="https://www.tensorflow.org/">TensorFlow</a> models to analyze camera images and optimize plant-care instructions.</li><li>User client(s) to monitor (and control) the garden behavior and status.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FXPjahxx1OL1rYfZ." /><figcaption><em>The basic underlying architecture consistent across both solutions.</em></figcaption></figure><h4>Garden-side client architecture</h4><p>The garden care devices — both the CNC rig and individual plant-care sensor/sprinklers — are optimized for their specific role monitoring sensors and controlling the actuators used to move the arm, trigger the water and fertilizer delivery mechanisms, and collect camera footage.</p><p>The specific hardware and software platforms you select for this component will be determined by your specific needs. Colt’s <a href="http://www.instructables.com/id/How-to-Make-a-Three-Axis-CNC-Machine-Cheaply-and-/">“home-made” CNC machine</a> is driven by a <a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/">Raspberry Pi</a>, while Reto’s per-plant devices are built on micro-controller like the <a href="http://espressif.com/en/products/hardware/esp32/overview">ESP32</a>.</p><p>In any case, you don’t want to connect the plant-adjacent hardware directly to the cloud. Reto’s solution includes multiple devices connected together in a <a href="https://blog.bluetooth.com/introducing-bluetooth-mesh-networking">Bluetooth mesh</a>, while even Colt’s CNC system may include multiple CNC devices in each location — so we connect each device wirelessly to a “hub” built using <a href="https://developer.android.com/things/index.html">Android Things</a>.</p><blockquote><strong><em>Why Android Things? </em></strong><em>Android Things is designed to build connected devices using the powerful development tools and APIs used to build apps for Android within Android Studio. Reto and Colt are both experienced Android developers, so this is a big shortcut for them, but you can use any language / SDK supported by the underlying hardware platform.</em></blockquote><p>The Garden Hub serves as the single point-of-contact between garden device(s) and the cloud-based service, and as such serves two purposes. It:</p><ul><li>collects and aggregates the readings from all available sensors and cameras, and uploads them to the cloud for analysis.</li><li>controls the behavior and operation of each garden device (usually based on the results of the cloud analysis.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/0*fkwWcvgbz9IWqOse." /></figure><p>To control the operation of each garden device, each hub begins with a set of default garden care instructions, which are updated as needed. The default and current settings are all stored locally, ensuring full offline support so that losing connectivity won’t prevent the garden being watered.</p><p>One solution for local offline support is using the <a href="https://firebase.google.com/docs/database/">Firebase Real-time Database</a>, which is well supported by Android Things and, as well as offline support, can provide auto-synchronization with our server and client implementation.</p><blockquote><strong><em>Why Firebase Real-time Database? </em></strong><em>The data being stored within each hub is simple, non-relational, and relatively small. Firebase is a NoSQL database that can handle the volume of data we’re storing, takes care of data synchronization for us, and remains available if we go offline. This is handy as it ensures we don’t need to create multiple database storage and synchronization implementations across multiple systems.</em></blockquote><p>The need to have a local database depends on the complexity of your planned garden setup. In the case of a single CNC machine, a database may be overkill — while having a device per plant necessitates a fairly robust database mechanism.</p><p>Choosing to include support for web- or app-based modification / control of your garden makes the use of an auto-synced database even more compelling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FjKJ96fb1mfZQCb0." /></figure><h4>Data collection &amp; storage</h4><p>All your sensor data, including camera imagery, should first be collected at the Garden Hub before being transferred to our cloud for analysis. The frequency at which you collect and upload this data will vary based on the size of your garden, and the resolution of your analysis.</p><p>The camera imagery can all be uploaded easily to <a href="https://cloud.google.com/storage/docs/">Google Cloud Storage</a> (Object/File Serving &amp; Storage), Google’s unified object storage offering.</p><p>There are multiple options for uploading and storing the sensor data. One particularly flexible approach is to use <a href="https://cloud.google.com/pubsub/docs/">Cloud Pub/Sub</a> (Distributed Real-time Messaging) to aggregate and publish the sensor data from each garden into a single durable stream, to which multiple cloud components can subscribe.</p><blockquote><strong><em>Why Cloud Pub/Sub?</em></strong><em> Pub/Sub provides low-latency, durable message delivery based on a many-to-many, asynchronous stream that decouples senders and receivers. That means we’re guaranteed that each message will be received, potentially by multiple subscribers within our server implementation (such as App Engine, BigQuery, and Dataflow.)</em></blockquote><p>Using Pub/Sub allows us to decouple of the uploading and processing steps. This is particularly powerful if multiple components in our cloud architecture need to consume the same data. It also allows us to use services such as <a href="https://cloud.google.com/dataflow/docs/">Cloud Dataflow</a> (Managed Data Processing) to modify the incoming stream, or perform real-time analytics, prior to processing by our analysis engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/0*JBDgUwhS6xvQAl1b." /></figure><p>More recently, Google released <a href="https://cloud.google.com/iot-core/">Cloud IoT Core</a> in Beta. This fully managed service utilizes Pub/Sub, and is designed specifically to securely connect, manage, and ingest data from globally dispersed devices. IoT Core also enables you to re-configure those devices on-the-fly.</p><h4>Server-side data analysis</h4><p>Once the data is uploaded to your cloud, it’s ready for analysis to determine what changes — if any — need to be made to the existing garden-care routine. There are a number of options for building your analysis engine, here we’ll use AppEngine Flex (Managed App Platform).</p><blockquote><strong><em>Why AppEngine?</em></strong><em> AppEngine is a platform-as-a-service, so we can focus on the code rather than infrastructure, and let Google handle scaling and reliability. We’re using Flex instead of Standard to support our use of the Google Cloud Tasks API. As a new project, there’s no legacy or hybrid infrastructure requirements that might suggest using containers.</em></blockquote><blockquote><em>Also we both work at Google, so we know someone who can hook us up with a bunch of credits.</em></blockquote><p>To initiate the analysis process, you can either ping an AppEngine front end from the hub once the sensor / image uploads are complete, or subscribe directly to the pub/sub streams for incoming sensor data or <a href="https://cloud.google.com/storage/docs/pubsub-notifications">modifications to a GCS bucket</a>.</p><p>To perform the analysis the <a href="https://cloud.google.com/appengine/docs/flexible/python/migrating#task_queue">Google Cloud Tasks API</a> is used to initiate an AppEngine Flex instances to perform the analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/0*hrWUFjqk7jVDhwyb." /></figure><blockquote><strong><em>Why not use a </em></strong><a href="https://cloud.google.com/functions/docs/"><strong><em>Google Cloud Function</em></strong></a><em>? A possible alternative to the Cloud Tasks API is triggering a cloud-function based on either the GCS bucket change or Pub/Sub stream. However, the max duration for a Cloud Function is 540 seconds, which may be insufficient for performing image analysis; the Cloud Tasks API supports tasks of up to 24 hours.</em></blockquote><p>Image analysis is used as a signal for determining plant health, so we need to train TensorFlow models to recognize everything from plant decay, to bugs, fruit, and leaf size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/0*Yo3eHKval1JgKvyi." /></figure><p>To simplify our use of TensorFlow, we can use the Google Cloud Machine Learning engine, which can host TensorFlow models for training, prediction — providing you with a managed, serverless solution for training TensorFlow models and using them for prediction.</p><p>To devise a care routine for each plant, we start with a <a href="https://cloud.google.com/appengine/docs/standard/java/datastore/">Datastore</a> (Distributed Hierarchical Key-value Storage) database that contains the baseline care instructions for a variety of plant species.</p><blockquote><strong><em>Why Datastore</em></strong><em>? There’s a large variety of database options we could use here, but the nature of the plant-care database — largely static, potentially very large, and without any relational constraints — is ideal for a NoSQL database, particularly one that is well supported by AppEngine.</em></blockquote><p>The baseline instructions are modified based on a combination of the image analysis results, plant sensor readings (soil moisture / pH, etc.), and environmental signals including local weather forecasts, seasons, and day / night cycles.</p><h4>Updating the garden care routine</h4><p>Having completed your analysis and determined any required updates to your gardening routine, you need to update your Garden Hubs.</p><p>If you’re using the Firebase Real-time Database, you can record those changes server-side and let Firebase synchronize those changes on the hub. If not, you’ll need to implement your own synch mechanism to transfer and apply the updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WcvmI0bWsp0oLR3N." /></figure><p>All changes made to the plant care routines, and the health-history of each plant is all sent to <a href="https://cloud.google.com/bigquery/docs/">BigQuery</a> (Managed Data Warehouse / Analytics), that acts as a data pool of training data for TensorFlow that’s used to learn how to better care for each plant based on prior results.</p><p>Your BigQuery dataset is also connected to <a href="https://cloud.google.com/data-studio/">Data Studio</a> (Visualize and Explore Data), which can be used to create real-time visualizations indicating overall garden health status and trends.</p><h4>User website and app</h4><p>At this stage your garden is completely autonomous; the client / garden owner has neither visibility into the system settings, nor the ability to manually modify its behavior.</p><p>There are a number of options for a client-side implementation, depending on the level of information and control you wish to make available, and the platforms you wish to support.</p><p>It’s likely you’ll want at least a web client, and native Android apps that allow users to observe the current plant care settings for their garden, and manually alter the schedules or trigger things like watering or fertilizing on demand.</p><blockquote><strong><em>Why Android</em></strong><em>? You’re going to build an iOS mobile app as well as Android, and the Firebase Real-time Database and Cloud Messaging both feature an iOS SDK — so when we say “Android” we really mean “Android and iOS”. [</em>Ed: Don’t tell anyone we said this.<em>]</em></blockquote><p>If you used the Firebase Real-time Database to store the plant care settings, the web, Android, and iOS clients can automatically get updated when those settings change — and similarly, providing functionality to modify and save to Firebase within those clients will see the settings updated on the server and Garden Hub.</p><p>If you’re building native mobile apps, you can utilize <a href="https://firebase.google.com/docs/cloud-messaging/">Firebase Cloud Messaging</a> to send realtime notifications for time-sensitive gardening alerts (such as detecting a repeated failure in watering, or mechanical issue with the CNC arms.)</p><p>You may also choose to add peer-to-peer control to your mobile client, providing a way for users to modify the settings on the hub even if you have no Internet connectivity. Using Bluetooth you can connect to the local hub and modify the care instructions, turn on specific sprinklers, or otherwise control the garden devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yLyIymCD-vv6lEG6." /></figure><p>Further features depend on your needs. You can use more TensorFlow models to recognize plants by taking a photograph, add support for manual tasks such as pruning or harvesting, or add voice control through <a href="https://developers.google.com/actions/">Google Assistant Actions</a>.</p><p>The fundamentals of both systems are very similar; the most meaningful difference in the two solutions is flexibility versus cost. Colt’s CNC design is restricted to a fixed unit into which your plants are planted, while Reto’s IoT Devices involve a separate device for each plant — improving flexibility at the expense of… expense.</p><p>To hear a more detailed account of some of our choices, check out our companion podcast, <em>Build Out Rewound</em>, our on <a href="https://play.google.com/music/listen#/ps/Imvre4gs5o4fv2aqknxopy6cb7q">Google Play Music</a>, <a href="/service/itpc://feeds.feedburner.com/BuildOutRewound">iTunes</a>, or <a href="http://feeds.feedburner.com/BuildOutRewound">your favorite podcast app / site</a>.</p><p>Add a comment here, or on our <a href="https://www.youtube.com/playlist?list=PLIivdWyY5sqKoHKrke__lawXs757D8u7M">YouTube video</a>, with any questions you have about our system design or technology choices. In the meantime, check out some of these awesome real-world Smart Garden implementations:</p><ul><li><a href="https://farmbot.io/">Farmbot</a></li><li><a href="http://rachio.com/how-it-works">Rachio Smart Sprinkler</a></li><li><a href="https://cloud.google.com/blog/big-data/2016/08/how-a-japanese-cucumber-farmer-is-using-deep-learning-and-tensorflow">Cucumber Farming with Deep Learning and TensorFlow</a></li><li><a href="https://edyn.com/">Edyn</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8uTcwgWhnb8%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8uTcwgWhnb8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8uTcwgWhnb8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5650003bc9e5f4f97ea16ae403843b01/href">https://medium.com/media/5650003bc9e5f4f97ea16ae403843b01/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9918a3d3be72" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/building-a-garden-that-cares-for-itself-9918a3d3be72">Building a Garden that Cares for Itself</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crime Hotspots and How to Find Them]]></title>
            <link>https://medium.com/google-cloud/places-to-avoid-in-san-francisco-76b0261dec6?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/76b0261dec6</guid>
            <category><![CDATA[san-francisco]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[crime]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[public-data]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Thu, 13 Jul 2017 19:06:13 GMT</pubDate>
            <atom:updated>2019-05-06T15:34:55.923Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1vk9i40RI0VvyQvwU-wbQ.jpeg" /></figure><h3>Crime Hotspots and How to Find Them with BigQuery</h3><h4>Crime Distribution in San Francisco</h4><p>Map all the SFPD incidents since 2010 and the Tenderloin stands out as a place you probably want to be careful if you’re visiting The City.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLIivdWyY5sqI6Jd0SbqviEgoA853EvDsq&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1_MvTuUhCUI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1_MvTuUhCUI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c1143d86f0fd9aee29316ae36625730/href">https://medium.com/media/1c1143d86f0fd9aee29316ae36625730/href</a></iframe><p>I wondered how different <em>types of crime</em> are distributed around the City by the Bay — so I fired up BigQuery and used the <a href="https://bigquery.cloud.google.com/table/bigquery-public-data:san_francisco.sfpd_incidents?pli=1">SFPD Incidents public dataset</a> to investigate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbAQIwRZ_6SFk1rRC6WYqg.jpeg" /><figcaption>Heatmap based on number of SFPD incidents by location</figcaption></figure><p>By calculating the combined <a href="https://en.wikipedia.org/wiki/Standard_deviation">standard deviation</a> of the latitude and longitude of each type of crime, we can find which crimes are the most heavily concentrated in a particular area — highlighting hotspots for specific crimes across the city.</p><pre>SELECT<br>  descript,<br>  STDDEV(latitude) as sdLat,<br>  STDDEV(longitude) as sdLong,<br>  count(*) as count<br>FROM <br>  `bigquery-public-data.san_francisco.sfpd_incidents` <br>WHERE <br>  (Latitude IS NOT NULL) AND (Longitude IS NOT NULL) <br>  AND (Latitude &gt; 30) AND (LATITUDE &lt; 40) <br>  AND (Longitude &gt; -130) AND (Longitude &lt; -120)<br>GROUP BY<br>  descript<br>HAVING <br>  sdlat is not null and sdlong is not null <br>  AND count &gt; 500<br>ORDER BY <br>  sdlat+sdLong ASC</pre><p>The results with the lowest standard deviation represent crimes with the highest location-concentration; the top 10 are shown in the table below. Note that drugs and prostitution make up half the top 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qs21KuMaQjK1r7jeEws7CA.png" /><figcaption>SFPD criminal incident descriptions with over 500 occurrences, and the lowest location standard deviation.</figcaption></figure><p>In total, 75% of the drug-related crimes in the categories from the top 10 table above occurred in this part of San Francisco shown in the map below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*_3BZjaqrx6pBDdBZPeuQMg.png" /><figcaption>Map showing 75% of SFPD incidents for drug-related crimes in categories within the top 10 most concentrated crime types. The Tenderloin is outlined in red.</figcaption></figure><p>Prostitution is also tightly concentrated, but in this case most police incidents occur in two separate, but distinct, areas:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5cs7RWNfCpExbXyV1RKkw.png" /><figcaption>Heat-map of prostitution-related crimes in categories within the top 10 most concentrated crime types.</figcaption></figure><p>Crimes with the <em>highest</em> location standard deviation — or greatest spread — are shown in the table below, with burglary, theft, and found property constituting 7 of the top 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vj7gDEvq5MAdJpmHfaXAhw.png" /><figcaption>SFPD criminal incidents with over 500 occurrences and the highest location standard deviation.</figcaption></figure><p>These crimes tend to occur all over the city; as you can see in the map below that shows locations with at least one burglary or attempted break-in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EplDp0AOj45CHSnZLyodaA.png" /><figcaption>All locations with one or more burglary / attempted break-in across San Francisco.</figcaption></figure><p>Looking at the most common burglary-related incident type, residential break-ins, 74% of incidents occurred in a location with only one break-in. The map below shows only locations with 5 or more burglary break-ins:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-QBZB_JCOO_DGSuBe7RaDQ.png" /><figcaption>Locations with five or more burglary break-in across San Francisco.</figcaption></figure><p>BigQuery includes many more public datasets for <a href="https://tilwbq.com/exploring-san-franciscos-public-data-ccf21cb2bfc3">San Francisco</a>, as well as other cities including <a href="https://tilwbq.com/investigating-new-york-city-public-datasets-with-bigquery-4e91c29d62e3">New York</a> and <a href="https://bigquery.cloud.google.com/table/bigquery-public-data:chicago_crime.crime?pli=1">Chicago</a>. What can you discover about the cities we live in?</p><p>If you’re new to BigQuery follow these <a href="https://medium.com/til-with-bigquery/how-to-run-a-terabyte-of-bigquery-queries-each-month-without-a-credit-card-948773df8c0c#.9jex791fc">getting started instructions</a>, and remember that everyone gets 1TB and 10 GB of storage <a href="https://cloud.google.com/bigquery/pricing">at no charge every month to run queries</a>.</p><p>Share your investigations with us at <a href="http://www.reddit.com/r/bigquery">reddit.com/r/bigquery</a> and subscribe to <a href="http://tilqbq.com/"><em>Today I Learned with BigQuery</em></a><em> </em>for more BigQuery public dataset investigations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76b0261dec6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/places-to-avoid-in-san-francisco-76b0261dec6">Crime Hotspots and How to Find Them</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Investigating Global Temperature Trends with BigQuery and Tableau]]></title>
            <link>https://medium.com/google-cloud/investigating-global-temperature-trends-with-bigquery-and-tableau-46c6ddd036ba?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/46c6ddd036ba</guid>
            <category><![CDATA[environment]]></category>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[weather]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Mon, 17 Apr 2017 18:59:47 GMT</pubDate>
            <atom:updated>2017-04-17T18:59:47.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ptpeVZjlraMkufpi5q-9Pg.png" /></figure><h4>Using the NOAA GHCN and GSOD datasets</h4><blockquote>The analysis in today’s <em>Today I Learned with BigQuery</em> was performed by @savio_lawrence using <a href="https://cloud.google.com/bigquery/docs/">BigQuery</a>, <a href="https://www.tableau.com/">Tableau</a>, and the <a href="https://cloud.google.com/bigquery/public-data/#noaa-ghcn">NOAA GHCN and GSOD</a> datasets to see what observations we can make about changes in the average temperatures recorded at weather observation stations around the world.</blockquote><p>Before we dive-in, note that while interesting, this analysis by itself is insufficient to draw conclusions for something as complex as climate change or global warming.</p><p>Scientific organizations and researchers work hard to account for the challenges we’ll highlight throughout the analysis, as well as combining datasets like these with remote sensing observations to obtain global and consistent coverage of the Earth.</p><p>One of the beauties of having access to such vast datasets is opportunity to explore some of the data that underpins scientific research to find areas for potential future exploration and analysis.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLIivdWyY5sqI6Jd0SbqviEgoA853EvDsq&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOVc9GZzQu-4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOVc9GZzQu-4%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5b5a86ed7d6a229400776ec612efa7b/href">https://medium.com/media/a5b5a86ed7d6a229400776ec612efa7b/href</a></iframe><h4><strong>Using BigQuery and Tableau to Analyze Climate Data</strong></h4><p>Using BigQuery we processed and summarized 196 tables (74GB+ with over 2.5 billion records) from the <a href="https://cloud.google.com/bigquery/public-data/noaa-ghcn">GHCN</a> and <a href="https://cloud.google.com/bigquery/public-data/noaa-gsod">GSOD</a> public datasets.</p><p>NOAA’s Global Historical Climatology Network (GHCN) is an integrated database of climate observations subjected to a common suite of quality assurance reviews.</p><p>The NOAA Global Surface Summary of the Day (GSOD) dataset includes weather observations from a much larger set of stations (over 9,000), but these haven’t undergone any review. As a result they tend to be less reliable than the GHCN observations.</p><p>We used the SQL statement below to perform the following functions, and applied it to both datasets.</p><ul><li>Find the yearly average temperature per station using the aggregate function.</li><li>Group stations into latitude bands.</li><li>Group years into decades using conditional statements and the like operator.</li><li>Finding the number of readings per year for each station, using the count function.</li></ul><pre>SELECT<br>  ID AS STN,<br>  PERIOD_TS,<br>  NUMOFDAYS,<br>  AVERAGE_TMP_C,<br>  LATITUDE,<br>  LONGITUDE,<br>  NAME,<br>  STATE,<br>  CASE<br>    WHEN LATITUDE &gt;= 66  AND LATITUDE &lt;=90  THEN <br>      &quot;ARCTIC CIRCLE&quot;<br>    WHEN LATITUDE &gt;= 23  AND LATITUDE &lt; 66  THEN <br>      &quot;NORTHERN TEMPERATE ZONE - BETWEEN TROPIC OF CANCER &amp; ARCTIC CIRCLE&quot;<br>    WHEN LATITUDE &gt;= 0   AND LATITUDE &lt; 23  THEN <br>      &quot;NORTHERN TROPICS - BETWEEN TROPIC OF CANCER &amp; EQUATOR&quot;<br>    WHEN LATITUDE &gt;= -23 AND LATITUDE &lt; 0   THEN <br>      &quot;SOUTHERN TROPICS - BETWEEN TROPIC OF CAPRICORN &amp; EQUATOR&quot;<br>    WHEN LATITUDE &gt;= -66 AND LATITUDE &lt; -23 THEN <br>      &quot;SOUTHERN TEMPERATE ZONE - BETWEEN TROPIC OF CAPRICORN &amp; ANTARCTIC CIRCLE&quot;<br>    WHEN LATITUDE &gt;= -90 AND LATITUDE &lt; -66 THEN <br>        &quot;ANTARCTIC CIRCLE&quot;<br>  END AS STN_ZN,<br>  IF (NUMOFDAYS &gt;= 300, &quot;GREATER THAN 300&quot;, &quot;LESS THAN 300&quot;) AS NUMOFDAYS_IND,<br>  CASE <br>    WHEN YEAR LIKE &quot;192%&quot; THEN &quot;20S&quot;<br>    WHEN YEAR LIKE &quot;193%&quot; THEN &quot;30S&quot;<br>    WHEN YEAR LIKE &quot;194%&quot; THEN &quot;40S&quot;<br>    WHEN YEAR LIKE &quot;195%&quot; THEN &quot;50S&quot;<br>    WHEN YEAR LIKE &quot;196%&quot; THEN &quot;60S&quot;<br>    WHEN YEAR LIKE &quot;197%&quot; THEN &quot;70S&quot;<br>    WHEN YEAR LIKE &quot;198%&quot; THEN &quot;80S&quot;<br>    WHEN YEAR LIKE &quot;199%&quot; THEN &quot;90S&quot;<br>    WHEN YEAR LIKE &quot;200%&quot; THEN &quot;2000S&quot;<br>    WHEN YEAR LIKE &quot;201%&quot; THEN &quot;2010S&quot;<br>  END AS DECADES<br>FROM (<br>  SELECT<br>    A.ID,<br>    A.PERIOD_TS,<br>    COUNT(*) AS NUMOFDAYS,<br>    ROUND(AVG(A.VALUE/10),1) AS AVERAGE_TMP_C,<br>    B.LATITUDE,<br>    B.LONGITUDE,<br>    B.NAME,<br>    B.STATE,<br>    A.YEAR<br>  FROM (<br>    SELECT <br>      *,<br>      TIMESTAMP_TRUNC(TIMESTAMP(date), YEAR) AS PERIOD_TS,<br>      CAST((EXTRACT(YEAR from DATE)) as String) AS YEAR<br>    FROM<br>      `bigquery-public-data.ghcn_d.ghcnd_*` ) A<br>  INNER JOIN<br>   `bigquery-public-data.ghcn_d.ghcnd_stations` B<br>  ON<br>    A.ID = B.ID<br>  WHERE<br>    A.ELEMENT = &#39;TAVG&#39;<br>  GROUP BY<br>    B.LATITUDE, B.LONGITUDE, <br>    B.NAME, B.STATE, A.ID, A.PERIOD_TS, A.YEAR)</pre><p>Once we summarized the data — along with the derived attributes including latitude zone, decade, and station observation count — we used <a href="https://www.tableau.com/">Tableau</a> to visualize the results.</p><p>Tableau allows us to provide a SQL statement to use as an input into a dashboard, and provides multiple visualization techniques including:</p><ul><li>Map view with colored labeling to help visualize temperature trends by station location.</li><li>A bar chart with reference lines to plot average temperatures by decades.</li><li>Line charts to plot temperature averages by year.</li></ul><p>Using this approach, we created simple dashboards that made it easy to understand our results, and perform more detailed analysis.</p><blockquote><a href="https://public.tableau.com/views/WeatherV4GHCN_3_10/OneDash?:embed=y&amp;:display_count=yes">GHCN Tableau Dashboard</a> | <a href="https://public.tableau.com/views/WeatherGSOD_Blog/OneDash?:embed=y&amp;:display_count=yes">GSOD Tableau Dashboard</a></blockquote><p><strong>Both sets of data indicate a trend of global temperature increase since the 1970s</strong></p><p>The graphs below show a gradual increase in net average global temperature each decade using both the GSOD and GHCN station data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wuqsW9Brqz_RzOyWNtH_QA.png" /><figcaption>Net average global temperature observations each decade using GSOD and GHCN station data</figcaption></figure><p>To generate these graphs we used stations with at least 300 measurements in a given year, starting in 1973 (as explained below.)</p><p>Of course, this doesn’t tell the whole story — global temperature isn’t consistent, so some places may have gotten warmer and others cooler. Later in this article we’ll look at trends at different latitudes to better understand the data.</p><p><strong>We want to consider the full data, so we’ll perform as little filtering as possible</strong></p><p>Significant changes in the number and location of weather stations is likely to have a significant impact on the average temperature, as will big shifts in population, and relative density of reporting locations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*HEWcf1j-xCSjvb5NwQv5Bw.png" /><figcaption>GSOD and GHCN reporting stations in 1972 and 1973</figcaption></figure><p>For our analysis to be meaningful, we want to start in a year after which there aren’t big jumps in the number of reporting stations, and there’s a reasonable global coverage of stations.</p><p>Our data suggests that 1973 was the first year in which the GSOD and GHCN databases both matched these criteria, as shown in these graphs comparing 1972 and 1973.</p><p>Notice, for example, that in 1972, there are few stations in South America; in 1973, there are a lot more. It’s also important to note that the GSOD database includes many stations that record only a small number of observations per year — for example, some station observations are only in the summer.</p><p>To avoid potential seasonal bias in our data we’ll filter out any station with fewer than 300 observations in a given year.</p><p><strong>Comparing the GSOD to GHCN trends since 1973 for stations with 300+ observations</strong></p><p>The graphs below break down the decade-averages into a year by year plot for each data set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMpH3d6yQEPL8ouDmE4ktw.png" /><figcaption>Year by year average temperatures for GHCN and GSOD reporting stations</figcaption></figure><p>This data looks like it’s gotten a lot warmer, but let’s not rush to any conclusions. Averages can be influenced in many ways, and our data might be biased. Notice that over the same time period, there’s a significant increase in the number of reporting stations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DPkRKkn4gBDsBPbrsTThEw.png" /><figcaption>Number of reporting stations reporting average temperature each year within GHCN and GSOD datasets</figcaption></figure><p>If those new stations are disproportionately located at warmer regions, that could bias the average towards warming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*3jqBMC0jIsPbAAYcLaj5NA.png" /><figcaption>Reporting station global locations</figcaption></figure><p>Looking at the overall distribution of stations for both datasets, the map shows that there are more stations in the most heavily populated latitudes (that have more temperate temperatures), and that there are fewer stations in more remote areas (that are frequently much colder).</p><p>As a result the regions with most stations will have disproportionate influence on the overall climate trends.</p><p>To begin to account for these potential issues, we can use a common data science technique of separating out our analysis into smaller slices of the data — in this case regions based on latitude bands.</p><p><strong>The Arctic: The North Pole (90°N) to the Arctic Circle (66°N)</strong></p><p>Both datasets indicate a significant gradual increase in the average temperature reported over the arctic circle each decade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OoS2lPgwQaw7Fnd5VjBLEw.png" /><figcaption>Average daily temperature per decade within the Arctic Circle using GHCN and GSOD data</figcaption></figure><p>GSOD shows a 1.08°C increase from the 70’s to the current decade, and GHCN a 0.67525°C increase over the same period .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*aDtkyunp8Clh1V_s." /></figure><p>Observing both results suggests that the Arctic circle has been warming.</p><p>If we take a look at the number of stations used each year, it suggests there’s no correlation between the reporting station count and the temperature recorded.</p><p><strong>Northern Temperate Zone: The Arctic Circle (66°N) to The Tropic of Cancer (22.5°N)</strong></p><p>The Northern Temperate Zone includes the largest number of stations, and represents the most highly populated region.</p><p>In the graph below, notice the gradual increase in average temperature as we move from the Arctic Circle to the tropics as indicated by the color of each dot representing the average temperature at each measurement station.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8yDBIYLkIVj3d-yj0YojvA.png" /><figcaption>Location and average temperature of stations within the Northern Temperate Zone</figcaption></figure><p>As with the Arctic Circle, both the GSOD and GHCN datasets show a gradual increase in the average temperature reported across the Northern Temperate Zone each decade, though at a slower rate resulting in 0.455°C and 0.65275°C increases in the GSOD and GHCN sets respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YTweWQ4XF6eNf6rekBdADA.png" /></figure><p><strong>Northern Tropics: The Tropic of Cancer (22.5°N) to The Equator (0°)</strong></p><p>When we reach the Northern Tropics, the graphs below show that while the number of stations providing readings has increased significantly since the 1970’s, a gradual temperature increase over time is seen in both datasets — we observe an average temperature increase of 0.1312°C and 0.0279°C per decade in GSOD and GHCN sets respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vkkk_XcuCSvLwAkcjUiNw.png" /></figure><p>This further reinforces the observation that the larger number of stations isn’t a significant factor in increased global average temperature increases, and also demonstrates that the overall warming trend isn’t consistently observed in all locations.</p><p><strong>Southern Tropics: The Equator (0°) to The Tropic of Capricorn (23°S)</strong></p><p>The same is true for the Southern Tropics, with only a slight increase in average temperature and a significant increase in reporting stations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Xjzs_tehtv4XwrW79fb7A.png" /></figure><p>The average increase in temperature per decade for GSOD and GHCN has been 0.186°C and 0.283°C respectively.</p><p><strong>Southern Temperate Zone: The Tropic of Cancer (22.5°S) to The Antarctic Circle (66°S)</strong></p><p>In the Southern Temperate Zone, both datasets saw a small, but gradual <em>decrease</em> from the 1970’s to 2000’s of around 0.5<strong>°</strong>C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ex4ZCVzhdeGljsUg9Oy5XQ.png" /></figure><p>Interestingly, the 2010’s have so far almost entirely countered that drop, recording the highest average since the 1970’s thanks principally to a very hot 2015 and 2016.</p><p>Are these two years outliers or the beginnings of a new warming trend for the Southern Temperate Zone? It’s too early to say based on only two data-points, but it’s an observation worth tracking.</p><p><strong>The Antarctic: The Antarctic Circle (66°S) to The South Pole (90°S)</strong></p><p>The number of stations in the Antarctic is very low compared to the other latitude bands— the GHCN records don’t include any stations with over 300 readings until 1980 within the Antarctic Circle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-si1kBL6UJRm3dwiSlMd0g.png" /></figure><p>The measurements we do have, indicate a general trend of decreasing average temperature each decade, of 6°C and 10°C for the GSOD and GHCN data respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r7Hcl5mkAJbVaztTp2nPTg.png" /></figure><p>Note that most of the weather stations are on the edge of the continent, with very few stations in deeper Antarctica.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*UF_V8Blq7c4CX5esPlTboA.png" /></figure><p>There is a pattern that Northern Antarctic stations have higher temperature than those located deeper within Antarctica.</p><p>The newer reporting stations are skewed towards those deeper, lower temperature, locations that may be contributing to the observed temperature decrease.</p><p>These challenges make the Antarctic data especially difficult to analyze, and require additional steps to gain a better understanding of changing temperatures there.</p><p>You’ll find that investigation in a future article.</p><h4><strong>The raw GSOD data generally agrees with the quality controlled GHCN results</strong></h4><p>Both datasets, when observed globally, indicate an increase in observed temperatures of 0.7125°C (GSOD) and 0.532°C (GHCN) each decade since the 1970s.</p><p>However, when we dig into the details on a regional basis the picture is more complex and a lot less open to simple conclusions.</p><p>The Arctic circle appears to be warming at the highest rate of approximately 1.084°C (GSOD) and 0.675°C (GHCN) each decade; and average temperatures in the Northern Temperate zone are also increasing at 0.455°C(GSOD) and 0.653°C (GHCN) / decade.</p><p>Meanwhile the tropics have maintained a fairly constant to marginal temperature rise per decade — Northern Tropics 0.13125°C (GSOD) and 0.0279°C (GHCN) while Southern Tropics have a rate of 0.186°C (GSOD) and 0.283°C (GHCN).</p><p>And the Southern Temperate zone has been slowly cooling at around 0.01905°C (GSOD) and 0.13°C (GHCN) each decade.</p><h4><strong>Climate science is… complicated</strong></h4><p>When measuring something as complex as climate change, it’s important to understand the many variables that can influence our results. For example, even in our relatively simple datasets new stations can be added, measurement stations can move, the surrounding landscape can change, and instruments can become more precise / accurate.</p><p>Analyzing this data can provide useful starting points to form hypotheses and begin further investigations into the broader trends — and causes — that they may represent.</p><p>If you’re new to BigQuery follow these <a href="https://medium.com/til-with-bigquery/how-to-run-a-terabyte-of-bigquery-queries-each-month-without-a-credit-card-948773df8c0c#.9jex791fc">getting started instructions</a>, and remember that everyone gets 1TB <a href="https://cloud.google.com/bigquery/pricing">at no charge every month to run queries</a>.</p><p>Share your investigations with us at <a href="http://www.reddit.com/r/bigquery">reddit.com/r/bigquery</a> and subscribe to <a href="http://tilqbq.com/"><em>Today I Learned with BigQuery</em></a><em> </em>for more BigQuery public dataset investigations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46c6ddd036ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/investigating-global-temperature-trends-with-bigquery-and-tableau-46c6ddd036ba">Investigating Global Temperature Trends with BigQuery and Tableau</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring San Francisco’s Public Data with BigQuery]]></title>
            <link>https://medium.com/google-cloud/exploring-san-franciscos-public-data-ccf21cb2bfc3?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccf21cb2bfc3</guid>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[transportation]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[crime]]></category>
            <category><![CDATA[san-francisco]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Tue, 07 Mar 2017 21:13:49 GMT</pubDate>
            <atom:updated>2019-05-06T15:35:22.636Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5TssFjR62YjTenLOY_jbw.png" /></figure><p>San Francisco. Fog City. The City by the Bay. No matter what you call it, those 47mi² are home to over 800,000 people about whom we can draw outrageous conclusions using the new San Francisco public dataset in BigQuery.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLIivdWyY5sqI6Jd0SbqviEgoA853EvDsq&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdC-ccbTYswI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdC-ccbTYswI%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/307cdfdfbf2d72a14e968f1e6af3e53c/href">https://medium.com/media/307cdfdfbf2d72a14e968f1e6af3e53c/href</a></iframe><p>Thanks to the City and County of San Francisco’s <a href="https://data.sfgov.org/">SF OpenData</a> project and <a href="http://www.bayareabikeshare.com/">Bay Area Bike Share</a>, <a href="https://cloud.google.com/bigquery/public-data/">Google BigQuery’s Public Datasets</a> now includes San Francisco public data, including:</p><ul><li>2+ million <a href="https://cloud.google.com/bigquery/public-data/sfo-311">311 service requests</a> since 2008 (updated daily)</li><li>2+ million <a href="https://cloud.google.com/bigquery/public-data/sfpd-reports">SF Police Department incidents</a> since 2003 (updated daily)</li><li>4+ million <a href="https://cloud.google.com/bigquery/public-data/sffd-service-calls">SF Fire Department service calls</a> since 2000 (updated daily)</li><li>The location and species for more than 100,000 <a href="https://cloud.google.com/bigquery/public-data/sfo-311">sidewalk trees</a> (updated quarterly)</li><li><a href="https://cloud.google.com/bigquery/public-data/bay-bike-share">Bay Area Bike Share</a> stations and almost 1 million Bay Area Bike Share Trips since 2013 (updated daily)</li></ul><blockquote><strong>SF Protip #1: Don’t leave valuables in your car when parked on Bryant. Especially on Friday. Definitely not before lunch.</strong></blockquote><p>In 2016, stolen cars and theft from locked cars accounts for over 21% of all SFPD crime incidents.</p><pre>SELECT<br>  ROUND(100*countif(strpos(descript, &quot;STOLEN AUTOMOBILE&quot;) &gt; 0)<br>    / count(*)) as stolen_pct,<br>  ROUND(100*countif(strpos(descript, &quot;THEFT FROM LOCKED AUTO&quot;) &gt; 0)<br>    / count(*)) as theft_pct<br>FROM<br>  `bigquery-public-data-staging.san_francisco.sfpd_incidents`<br>WHERE<br>  category != &quot;NON-CRIMINAL&quot; AND category != &quot;SECONDARY CODES&quot;<br>  AND category != &quot;WARRANTS&quot; AND EXTRACT(YEAR from timestamp) = 2016</pre><p>Reports of thefts from locked cars peak on Friday at lunch-time and after-work, presumably as folks are arriving at their cars to find them ransacked. Parking on Bryant is easily the best way to maximize your chances of having your stuff stolen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vr1AhyMKCyG4f0m9-CCucw.png" /></figure><p>If you’re looking to minimize your chances of being a victim of grand theft from a locked auto, this heatmap shows where most thefts from cars have been reported — avoid parking there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*775pKb1tKt-KY_ULohnzlg.png" /></figure><blockquote><strong>SF Protip #2: If you lose something on Bryant, try looking for it on Valencia and Eddy.</strong></blockquote><p>Nearly 20% of all lost property was reported on Bryant Street. The best odds for finding something are over on Valencia and Eddy, where more than twice as many items are reported found than lost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dRLqp9V3JnKtLNfBGwgJHg.png" /></figure><p>You’re most likely to come back to your car and find it missing entirely if you parked on Mission Street. Especially on Friday.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DjFDNwJevMp5EJRtNy0TzA.png" /></figure><blockquote><strong>SF Protip #3: Sunset Boulevard is the leafiest street in San Francisco.</strong></blockquote><p>You can get a taste of Monterey by visiting Sunset Boulevard — the leafiest street in San Francisco, with more trees than any other street, including nearly 1,400 Monterey Pines and Monterey Cypress. If you’re looking for a shady spot, the heatmap below shows the density of tree distribution throughout the City.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkav2vzJ1ig83N5BJWXkTw.png" /></figure><p>SF has a greater density of trees than NYC, featuring 2,637 trees per square mile compared to NYC’s 2,242.</p><p>Like New York, the most common tree in San Francisco is the London Plane Tree, which represents 7% of all SF trees, compared to 13% of the trees in New York. San Francisco trees are much more diverse, you’ll find 492 different species, compared to New York’s 183.</p><p>San Francisco can boast at least 1 example of each of New York’s top 7 tree species, where New York has none of San Francisco’s, apart from the London Plane.</p><blockquote><strong>SF Protip #4: San Francisco residents complain more than New Yorkers.</strong></blockquote><p>Per capita, San Francisco uses its 311 municipal complaint line more often than NYC. The most common complaints in SF are requests for sidewalk cleanups, rubbish pickups, and graffiti removals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NR-qweov5hv-22qTa1UhDw.png" /></figure><h4><strong>SF Protip #5: There’s more graffiti, but at least it’s getting more polite.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uLD1MfiLWFcA7sS7InqUg.png" /></figure><p>The biggest growth in complaints is in the categories that already represent the largest volume, with bulky item pickup requests and illegal homeless encampments rising most quickly.</p><p>Note that non-offensive graffiti is on the rise, with offensive graffiti is the fastest dropping complaint category. So either San Franciscans are writing less offensive graffiti, or the residents have grown immune to the current attempts to offend.</p><blockquote><strong>SF Protip #6: Steep hills make for slower bike rides.</strong></blockquote><p>Riders of the Bay Area Bike Share network average 14 minutes per ride — nearly the same as the 15 min average for New York Citi Bike riders. San Francisco is a smaller town though, and riders average only 1.4 km per trip, compared to New Yorkers, who go 1.8 km.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QP8l02DurrdB0FEKgu2aGg.png" /></figure><p>Or put another way, San Francisco cyclists are 0.3 m/s slower than their New York counterparts. I blame the steep hills.</p><blockquote><strong>SF Protip #7: Marijuana legalization will reduce arrests in Haight-Ashbury by 7%.</strong></blockquote><p>Marijuana represents 26% of all drug related arrests in San Francisco. In 2016, it was overtaken by meth as the most likely drug involved in an arrest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGqlhJbAep5XVC0d2fC3Uw.png" /></figure><p>Overall, drug crime is down 62% since 2003, with fewer arrests for all drugs — except methamphetamine, which is up 14%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-iHfSJuWtYOGHz9ZC6IG2g.png" /></figure><p>The map below shows all areas where there have been at least 5 drug-related arrests since 2003. Red pins are for marijuana, blue for crack cocaine, pink for meth amphetamine, green for heroine, and yellow represent cocaine.</p><p>The larger pins indicate over 200 drug-related arrests in the same location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ry0Bml6i3hNE6z6tG9a0Ig.png" /></figure><p>The Tenderloin is the center of San Francisco’s drug arrests, particularly for crack cocaine — the arrests for which are clustered around specific locations; methamphetamine arrests, however, are more likely to follow roads.</p><p>Marijuana arrests spike in the Haight-Ashbury neighborhood, where they account for 7% of all arrests.</p><blockquote><strong>SF Protip #8: The best place to have your house catch fire is Chinatown. The most likely place is the Tenderloin. If you’re lucky they’ll dispatch Engine 3.</strong></blockquote><p>The average response time between calling 911 and firefighters arriving at your burning building is 6 minutes 8 seconds, with units arriving at Chinatown blazes at an impressive city-wide best of 4 minutes and 30 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xIm-D59meWUFRCtIF78Rkg.png" /></figure><blockquote>The fastest fire truck in the SFFD is Engine 3 based in the 4th battalion with an average response time of just over 3 minutes.</blockquote><h4><strong>This is a taste of what you can explore and find using this new San Francisco dataset.</strong></h4><p><a href="http://tilwbq.com/">Join us here</a> every week, for <em>Today I Learned with BigQuery</em>, as we dig into each of these table in more detail, use the NOAA weather tables to explore the effect of weather on crimes and 311 calls, and compare what we know about San Francisco and other cities, starting with New York.</p><p>If you’re new to BigQuery follow these <a href="https://medium.com/til-with-bigquery/how-to-run-a-terabyte-of-bigquery-queries-each-month-without-a-credit-card-948773df8c0c#.9jex791fc">getting started instructions</a>, and remember that everyone gets 1TB <a href="https://cloud.google.com/bigquery/pricing">at no charge every month to run queries</a>. When you’re done remember to share the results with us using <a href="http://www.twitter.com/hashtag/tilwbq">#TILwBQ</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccf21cb2bfc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/exploring-san-franciscos-public-data-ccf21cb2bfc3">Exploring San Francisco’s Public Data with BigQuery</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Offshoring Your Development Team Means Buying a Boat]]></title>
            <link>https://medium.com/series/when-offshoring-your-development-team-means-buying-a-boat-f9f2f20862e4?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9f2f20862e4</guid>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Fri, 03 Mar 2017 19:36:22 GMT</pubDate>
            <atom:updated>2017-03-03T19:36:22.468Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>10 years ago, I published <a href="http://blog.radioactiveyak.com/2007/03/when-offshoring-your-development-team.html">an article</a> on my experience as an offshore developer. In honor of that anniversary, I’ve revised and re-published it here, as a Medium series.</blockquote><p>When you’re talking software and you mention “offshore workers”, chances are you’re thinking about dev shops in India.</p><p>I grew up in Western Australia, where you can get a job in both major industries: resource mining <em>or</em> extraction.</p><p>Sure, I chose oil &amp; gas — but I joined a dynamic startup as the ‘lynch pin of their new technical department’.</p><p>Sick of paying licenses to other companies for their software, I was hired to write some for them.</p><h4>Day 1</h4><p>New desk, and new copies of Delphi 3…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*gUtnRc-IfQdP503IHfF61A.jpeg" /></figure><p>…and “Learn Delphi in 24 hours”</p><h4>…23 hour later</h4><p>I’m living the dream as a software engineering Tech Lead, writing software for coordinating and logging offshore oil &amp; gas installation inspections.</p><h4>Lesson 1</h4><p><em>The sole developer of untested, mission-critical software, should expect to be going wherever that software goes.The</em></p><p>The day after I cobbled together a working demo, the software was committed to our next job. As was I.</p><p>That job is 150km (95mi) offshore, and lasts for 3–6 weeks.</p><p>The facilities onboard the support vessel we would be calling home, could be considered…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*ASvs8vtnLBFD9nH8hYwUbQ.jpeg" /><figcaption>…primitive.</figcaption></figure><p>Things have changed now, but in the 90’s that meant no broadcast TV, no radio, no phones, and <em>absolutely</em> no Internet.</p><p>That means no Stack Overflow.</p><p>There <em>was</em> a satellite phone, and for only $1 / second I could reach out and touch somebody.</p><p>When the boat’s orientation was <em>just</em> right (and the stars were aligned) there might be a nightly email uplink to send / receive email on a public, unsecured PC running <em>Outlook Express</em>.</p><p>Nothing larger than 50kb and absolutely no attachments.</p><h4>What to Bring?</h4><p>3 pair coveralls (pre-washed and worn to avoid the n00b look), hard hat, steel tipped safety boots, sandals, underwear, socks, t-shirts, and razor and toiletries (to prepare for the flight home).</p><h4><em>No alcohol, drugs, explosives; and the total allowance is 10Kg (22lbs).</em></h4><p>If it’s a decent sized job they’ll do your laundry nightly, so a few clothes go a long way; just remember they wash them at around 150C, so no delicates.</p><p>Or nylon.</p><p>Or dark colors.</p><p>Mobilization is from <a href="http://maps.google.com.au/maps?f=q&amp;hl=en&amp;q=Karratha+WA,+Australia&amp;ie=UTF8&amp;sll=51.418413,-0.224136&amp;sspn=0.00736,0.016716&amp;z=10&amp;ll=-20.664911,116.786041&amp;spn=0.70671,1.520233&amp;ampt=h&amp;om=1&amp;iwloc=addr">Karratha</a></p><p></p><p>The flight leaves at 6am on Monday morning.</p><p>Pre-boarding, most fellow oil &amp; gas workers are smoking — and some look like they’ve been preparing for 6 alcohol free weeks by drinking solidly for the past 6 weeks.</p><h4>Plane → Chopper → Boat</h4><p><em>With any luck without putting any </em><a href="http://www.everything2.com/index.pl?node=Helicopter%20underwater%20escape%20training&amp;lastnode_id=1738644"><em>HUET</em></a><em> training to the test</em></p><p>It’s 40C and the humidity must be 150%.</p><p>It’s into full length coveralls, boots, and a hardhat ready for the vessel safety induction.</p><p>Years of StarTrek means understanding where to go when asked to ‘report to the bridge’.</p><p>You’re shown your muster station and which alarm means to head there — and which one means you’re better off going straight over the side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*OmnPQmrhjfn_Gxai38VQxg.jpeg" /><figcaption>Everyone gets assigned a room, about the size of a smallish walk-in wardrobe, that’s shared with 7 others, each group of 4 on opposing shifts.</figcaption></figure><blockquote><strong>No — that’s not a fire exit.</strong></blockquote><blockquote><strong>Questions?</strong></blockquote><blockquote><strong>No, there is no fire exit.</strong></blockquote><p>The communal death trap room adjoins the engine room and there’s only one entrance / exit — up the stairs.</p><p>If the stairs are burning you have no chance to survive make your time.</p><p>The bridge crew talks about the scourge of piracy, causing me to cast a sidelong glance at my DVD case, but I relax when I realize they’re talking about actual pirates<em>…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*dhCSN2sSphLGSy4Qs9pPFw.jpeg" /><figcaption>…until I realize they’re talking about <strong>actual pirates</strong>.</figcaption></figure><p>There’s the mess, the galley, the smoking room, and the rec room.</p><p>Usually they’r<em>e the same room.</em></p><p></p><h4>A 24 hour living nightmare</h4><p>Mobilization. Building Windows boxes, installing software, and fixing bugs.</p><p>Stringing CATV and 440V mains leads around the back deck.</p><p><a href="http://www.everything2.com/index.pl?node=Telemetry&amp;lastnode_id=1738644">Telemetry</a> from the <a href="http://www.everything2.com/index.pl?node=ROV&amp;lastnode_id=1738644">ROV</a> has to be fed to survey on the bridge, then back down to you in the inspection shack. The <a href="http://www.everything2.com/index.pl?node=RS232&amp;lastnode_id=1738644">RS232</a> breakout box is in full effect.</p><p>Access to everything is awkward, and there’re always three people trying to occupy the same piece of space, and work with the same piece of hardware.</p><p>All this is happening on the back deck of a support vessel as it ploughs out to the field at full steam in 2m seas and 24knot winds; green water coming over the back deck.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*k-y-kyzTDuEv4ARHOBCu0Q.jpeg" /><figcaption>All the data, and four live video feeds need to be recorded onto four separate inspection PCs, the bridge, ROV control.</figcaption></figure><h4>Lesson 2</h4><p><strong>Mission critical means if the software goes down, the job stops.</strong></p><p>Hourly cost of support vessel and crew: <em>$20,000</em></p><p>Hourly cost of ROV crew &amp; vehicle hire: <em>$10,000</em></p><p>Look on the party chief’s face when you tell him the software’s crashed and will take 30mins to bring everything back up so everyone can get back to work: <em>Priceless</em></p><p><em>They paid for a qualified inspection engineer. They got me instead.</em></p><p>I’m a programmer. I know this and so does my employer. But the client paid for an 3.4u Inspection Engineer and expects to get what he paid for.</p><p>This would be less of a problem if my employer didn’t insist on my doing both jobs, or if inspection shifts were less the 12 hours long, or didn’t require my full attention.</p><p>Now, rather than being the cutting-edge developer on the front lines I’m a barely adequate inspection engineer who seems more interested in the software I’m using than the job at hand.</p><p><em>The job runs 24/7, no weekends, no downtime.</em></p><h4>Simulate the daily offshore experience at home!</h4><ul><li>Put an uncomfortable plastic chair in your bedroom closet with 6 LCDs.</li><li>Point 3 cameras at the bottom of an aquarium, each at a slightly different angle.</li><li>Park a big-rig next to the adjoining wall (and leave it idling).</li><li>Turn on a humidifier at least 110% relative humidity. Every 30mins alternate between a heater at 45C with an air-con at 15C.</li><li>Invite five complete strangers into your closet.</li><li>Have someone lock the door and don’t let anyone out for at least 12 hours.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*WVyWuRmiiFQk-i9Z0j24WQ.jpeg" /><figcaption>Get in, sit down and watch the screens.</figcaption></figure><ul><li>You need to give a running voice-over, and log the action in software.</li><li>This is important. Have your friends rock the wardrobe by about 30 degrees side-to-side continuously. Randomly have them drop it.</li><li>Every 2 to 4 hours have something on the camera change slightly for no longer than 3 seconds.</li></ul><p><em>If you miss the change, </em><strong><em>you lose</em></strong><em>.</em></p><p>At 7am the sun’s up and I’ve done the handover to my replacement.</p><p>After downing a cholesterol loaded deep-fried heart attack, it’s time to head for bed.</p><p>Instead, I’m Tier 1, 2, and 3 support for the day-shift, fixing bugs, and implementing features.</p><p>Around midday it’s time time for one last 3 course meal before wedging myself in to bed to avoid plummeting from the top bunk when the boat rolls 30 degrees.</p><p>Up at 5pm, and headed to the mess for breakfast; a quick look at the menu and it’s the low GI staying power of pork spare ribs and mashed potatoes with gravy.</p><p>Breakfast of champions.</p><p>The ROV crew is on midday to midnight shifts, so there’s another full dinner put on at 11:30am and another at 12:30pm. Play your cards right and you can get 5hrs sleep a night and still squeeze in 4 full 3-course dinner meals.</p><h4>Every.</h4><h4>Single.</h4><h4>Day.</h4><p>Three weeks in, it’s clear this three week job is not likely to finish in the next 24 hours.</p><p>Time to craft an email to the loved ones explaining that rather than being home by the weekend, It’ll be another month.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIZcLPyicCHNAx0A7i3QPg.jpeg" /><figcaption>“Another Day at The Office”</figcaption></figure><h3>Time passes…</h3><p>At 5 weeks the homesickness has replaced seasickness.</p><p>I’m swearing like a sailor and no one has shaved since day three. It’s been a month since I’ve seen my girlfriend (or any other three dimensional woman).</p><p>I’ve fixed everyone’s computer at least once, have challenged and defeated the entire crew in a series of all-in Quake3 Arena death matches.</p><p>It’s time to go home.</p><p>On the last night, everyone works 24 hours to get the demobilization finished, those on night shift (like me) are heading for 36 hours “awake.”</p><p>Everyone is barely recognizable having washed, shaved, and put on their ‘good’ clothes for the first time in over a month.</p><p>The flight back to Perth is a blur of G&amp;Ts.</p><p>For the first few days home I’m walking with a swagger, and when attending to nature I still lean forward and support myself against the wall to counter the non-existent swell.</p><p>The bank account certainly enjoyed the trip, and I will <em>never in my life</em> know any code as well as I did that software.</p><p>Was it worth it?</p><h3><em>No</em>.</h3><p>Will I be going again..?</p><p>I was back offshore within a month and did almost a dozen stints over 4 years.</p><p>I’ve worked with people who went on one job, got choppered off after 3 weeks and quit the second they hit dry land.</p><p>Your mileage may vary.</p><p></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9f2f20862e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rise and Fall of New York City (311 complaints) — TIL with BigQuery]]></title>
            <link>https://medium.com/google-cloud/the-rise-and-fall-of-new-york-city-311-complaints-72bd894e0c74?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/72bd894e0c74</guid>
            <category><![CDATA[urban-planning]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[new-york-city]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Thu, 23 Feb 2017 17:31:22 GMT</pubDate>
            <atom:updated>2019-05-06T15:35:54.456Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KRSkI8Jc4HpzSzUc5JiG3w.png" /></figure><p>The <a href="https://cloud.google.com/blog/big-data/2017/01/new-york-city-public-datasets-now-available-on-google-bigquery">New York City public dataset</a> contains all the <a href="http://www1.nyc.gov/311/">311 complaints</a> made since 2010. Let’s see how the city has improved — and gotten worse — over the past 6 years.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLIivdWyY5sqI6Jd0SbqviEgoA853EvDsq&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCtZfZS_8sJ0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCtZfZS_8sJ0%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/18446b737395d393a1b49b31462dfd41/href">https://medium.com/media/18446b737395d393a1b49b31462dfd41/href</a></iframe><p>The graph below highlights the 311 complaints, with significant call volume, with the biggest increase / decrease between 2010 and 2016.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aLMbhi2AfjJh4yN-." /><figcaption>Most significant 311 complaint type call volume increases and decreases since 2010: <a href="https://bigquery.cloud.google.com/savedquery/174015642527:991443ede98348648d233c5ee9db212a">BigQuery Query</a></figcaption></figure><h4><strong>Complaints have been outpacing population growth</strong></h4><p>Since 2010 the number of complaints have grown by 18%, while the population expanded by an estimated 6%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mMHJE9bp2vL8LCH4." /><figcaption>Population growth compared to 311 complaint volume growth since 2010</figcaption></figure><h4><strong>There’s a lot of cars in New York, and people don’t seem to know where to put them</strong></h4><p>Illegal parking, broken parking meters, blocked driveways, and derelict vehicles represent many of the highest-percentage increases. Illegal parking is the biggest offender with more than a four-fold increase.</p><p>Noise represented 18% of all 311 complaints in 2016, up from 10% in 2010. That’s an increase of over 200,000 calls — fully 2/3rds of the total increase.</p><p>We’ve previously <a href="https://medium.com/til-with-bigquery/crowning-the-rat-capital-of-new-york-a35dc82bf6cf#.s2329xh7e">investigated the increase in rat sightings</a>; the increase in complaints regarding missed trash collections and dirty sidewalks might be another clue that helps explain that jump.</p><h4>Graffiti and illegal postering are way down</h4><p>They show a 38% and 78% reduction respectively, in line with New York City’s <a href="https://cooperator.com/article/the-mayors-anti-graffiti-task-force/full#cut">ongoing efforts</a> to eradicate both.</p><p>Street repairs are failing 76% less often, and there are far fewer complaints for broken streetlights and traffic signals — down 50% on average (likely related to the city replacing halogen bulbs with LED lights.)</p><h4>The graph below is a zoomed-in snapshot for every borough</h4><p>We’re graphing the percentage difference of a particular boroughs complaint growth rate on the y-axis, relative to the rest of the borough’s growth rate on the x-axis. The size of each point represents the total number of calls received in 2016.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mx14epkNQ_PN1EUa23PhMg.png" /><figcaption>Make a copy of <a href="https://docs.google.com/spreadsheets/d/1GeLS8CVVK_YTkTRKmBQk0ebrqubWqM77jRmWPm9Mi50/edit?usp=sharing">this Google Sheet</a> to play with the graph yourself</figcaption></figure><p>The highlighted point representing derelict vehicles in Manhattan, shows that in the other boroughs, this complaint type increased by 105% (it doubled from 17,759 to 36,416), while the Manhattan growth rate was 62% faster (a 170% increase, from 7,569 to 20,450).</p><p>It’s a fun graph to play with (you should <a href="https://docs.google.com/spreadsheets/d/1GeLS8CVVK_YTkTRKmBQk0ebrqubWqM77jRmWPm9Mi50/edit?usp=sharing">make a copy of the sheet</a> and investigate it yourself), but it’s pretty hard to interpret, so let’s pull out some notable observations for each borough.</p><h4><strong>The following chart breaks the complaints into four quadrants</strong></h4><p>Those on the right represent complaints that have increased, and on the left where they’ve decreased.</p><p>The upper half represents complaint-types that are worse in one borough than the others, and the lower half, shows where they’re better.</p><p>Values less than -100% in the upper left (colored red) represent complaint types that have increased in one borough while decreasing in the other boroughs, while values under -100% (green) in the lower right indicate complaint types where calls have decreased in one borough, despite increasing elsewhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ULzp-WiYlUBd8XWC." /></figure><p>So here for Brooklyn, complaints about illegal building conversions, street cave-ins, and graffiti have increased, while dropping in the other boroughs. Rough, pitted, and cracked roads complaints in Brooklyn have dropped at more than twice the rate at which they <em>increased</em> in the other boroughs.</p><p>Street-light complaints are improving twice as quickly in Brooklyn than elsewhere, but derelict vehicles complaints are growing 62% faster than the other boroughs.</p><p>You can see the exceptional complaint types for the other boroughs in the charts below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qA5KfUHybtERDF-SzQXUtA.png" /></figure><h4>I’ve cherry picked the ones I thought most notable or interesting</h4><p>There are thousands of individual complaint types and descriptors, so the graphs and lists I’ve used in this blog post aren’t comprehensive</p><p>The complaint types and descriptors have also changed over the years, so a comparison required some reconciliation to account for renamed, deprecated, and newly introduced complaint types.</p><blockquote>Note also that we’re measuring the change in the number of <em>complaints</em>. More complaints are correlated with more problems, but it’s possible that people are just complaining more, or that awareness of the 311 service has been increasing.</blockquote><h4>Run some queries to investigate the changes in more detail</h4><p>There’s a lot more <a href="https://medium.com/til-with-bigquery/investigating-new-york-city-public-datasets-with-bigquery-4e91c29d62e3#.f3fct2mtp">New York City open data</a> to be explored for trends and changes. Everything from Citibike and taxi rides, to motor vehicle accidents. Check it out yourself, and share your findings.</p><p>If you’re new to BigQuery remember that everyone gets 1TB <a href="https://cloud.google.com/bigquery/pricing">at no charge every month to run queries</a>. If you’ve never tried BigQuery before, follow these <a href="https://medium.com/til-with-bigquery/how-to-run-a-terabyte-of-bigquery-queries-each-month-without-a-credit-card-948773df8c0c#.w0kx0s6ho">getting started instructions</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72bd894e0c74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/the-rise-and-fall-of-new-york-city-311-complaints-72bd894e0c74">The Rise and Fall of New York City (311 complaints) — TIL with BigQuery</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crowning the Rat Capital of New York using BigQuery]]></title>
            <link>https://medium.com/google-cloud/crowning-the-rat-capital-of-new-york-a35dc82bf6cf?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/a35dc82bf6cf</guid>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[new-york-city]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Wed, 15 Feb 2017 20:46:39 GMT</pubDate>
            <atom:updated>2019-05-06T15:36:13.120Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GyuyYpjlPCUkiDpG9vXteg.png" /></figure><h4>Importing data for analysis with Google BigQuery</h4><blockquote>Originally published on the <a href="https://cloud.google.com/blog/big-data/2017/02/crowning-the-rat-capital-of-new-york-importing-data-for-analysis-with-google-bigquery">Google Cloud Big Data and Machine Learning</a> blog</blockquote><p>The NYC 311 dataset in BigQuery indicates a dramatic increase in complaints about rats, starting in 2013.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2nyGcoSFcFJxWRJoMa8QAA.jpeg" /></figure><p>To dig deeper, I uploaded the <a href="https://data.cityofnewyork.us/Health/Rodent-Inspection/p937-wjvj">Rodent Inspection table</a> from the NYC Pest Control Database to BigQuery; watch the video to see how I did this, and learn how to compare the NYC 311 data with your own dataset.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLIivdWyY5sqI6Jd0SbqviEgoA853EvDsq&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8W1r3LwL5EI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8W1r3LwL5EI%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/88809c5cdab8404506f874e392edde90/href">https://medium.com/media/88809c5cdab8404506f874e392edde90/href</a></iframe><h4><strong>Manhattanites are the most likely to call in a false rodent alarm</strong></h4><p>The NYC Department of Health sends inspectors to investigate all rodent complaints — 75% of the time, they don’t find anything.</p><p>The heatmap on the left highlights locations where false alarms — inspections where no active rat signs were found — significantly outnumber those that find active rat signs. The blooms in Downtown Manhattan and Harlem show the largest number of false alarms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wO1yRdy3fqfUzYpHnQwT9g.png" /></figure><p>The graph on the right highlights areas where inspectors found signs of active rats more often than not.</p><p>Here Williamsburg and Bushwick are the areas with the highest concentration of inspections that found rat signs, compared to false alarms.</p><h4><strong>Does the increase in 311 rat complaints mean more rats, or more complaints?</strong></h4><p>In 2016 it’s <em>both</em>. But mainly it’s more rats. The graph below shows that since 2014 there’s been an increase in clean inspections (initial inspections that pass), but a larger increase in those finding active rat signs — with 2016 in particular seeing a significant bump.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVB113Etd54-9CtX7AT9Og.png" /></figure><p>In contrast, notice the spike in complaints in 2012 actually corresponded with fewer inspections that detected active rat signs that year.</p><h4><strong>The Bronx dethroned Manhattan as rat-central in 2011, but that lead is under threat</strong></h4><p>The graphs below show the change in inspections finding active rat signs per borough. On the left, we show year-on-year percentage change, and on the right the overall number.</p><p>Note that up to and including 2015, the change between any year was typically less than +/- 30%, but 2016 saw a big increase everywhere but the Bronx.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7CKNyxZTWh16qjw-_VCGSQ.png" /></figure><p>If the current rate of increase continues across New York, Brooklyn will be crowned the Rat Capital by 2019, with The Bronx falling to 4th place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qeq8pl_8Z__JI5LUr3xMA.png" /></figure><p>Looking at the heatmaps below from 2010 through 2016, areas of darker red indicate a concentration of inspections that found active rat signs.</p><p>You can see a gradual migration of the areas of greatest rat sign concentration out of Manhattan (West) towards The Bronx (North East), and more recently, a hotspot forming in Brooklyn around Williamsburg (South East).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHbVEF58ytqRb_a0PaRc-w.jpeg" /></figure><p>If the current trend continues, I’d expect the heatmaps for 2017 onwards to have significant hotspots in Downtown Manhattan and Brooklyn, with The Bronx becoming less prominent.</p><p><strong>To learn what’s causing the increase in rats, we need more data</strong></p><p>For example, when we explored <a href="https://cloud.google.com/blog/big-data/2017/02/four-seasons-in-one-post-using-google-bigquery-to-explore-weather-effects-on-nyc">the effect of weather on NYC 311 complaints</a>, we found a weak correlation between temperature and rat complaints; and 2015 and 2016 were significantly warmer than 2013 and 2014 — so perhaps that’s a factor.</p><p>What other factors might be influencing the increase in rat population? Check out the New York City Open Data collection, and import your own data into BigQuery to see if you can figure it out.</p><p>If you’re new to BigQuery follow these <a href="https://medium.com/til-with-bigquery/how-to-run-a-terabyte-of-bigquery-queries-each-month-without-a-credit-card-948773df8c0c#.9jex791fc">getting started instructions</a>, and remember that everyone gets 1TB <a href="https://cloud.google.com/bigquery/pricing">at no charge every month to run queries</a>. When you’re done remember to share the results with us using <a href="http://www.twitter.com/hashtag/tilwbq">#TILwBQ</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a35dc82bf6cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/crowning-the-rat-capital-of-new-york-a35dc82bf6cf">Crowning the Rat Capital of New York using BigQuery</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four Seasons (and 5 Boroughs) in One Post with BigQuery]]></title>
            <link>https://medium.com/google-cloud/four-seasons-and-5-boroughs-in-one-post-d8c90afc7071?source=rss-d2cb9c480c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8c90afc7071</guid>
            <category><![CDATA[new-york-city]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[weather]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[open-data]]></category>
            <dc:creator><![CDATA[Reto Meier]]></dc:creator>
            <pubDate>Wed, 15 Feb 2017 20:42:50 GMT</pubDate>
            <atom:updated>2019-05-06T15:36:38.288Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xgMxHZdnHv9-e_y521CiyA.png" /></figure><h4>Using Google BigQuery to explore how weather affects NYC</h4><blockquote>Originally published on the <a href="https://cloud.google.com/blog/big-data/2017/02/four-seasons-in-one-post-using-google-bigquery-to-explore-weather-effects-on-nyc">Google Cloud Big Data and Machine Learning</a> blog</blockquote><p>With over 150GB of <a href="https://cloud.google.com/blog/big-data/2017/01/new-york-city-public-datasets-now-available-on-google-bigquery">New York City</a> public data, parsing it all for patterns and insights is a challenge. One solution? Combine it with another 30GB of <a href="https://cloud.google.com/bigquery/public-data/noaa-gsod">weather data</a>, and use the <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#corr">CORR function</a> to find correlations for you.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLIivdWyY5sqI6Jd0SbqviEgoA853EvDsq&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DwZ4IC2YdHkE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FwZ4IC2YdHkE%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/45fdecf59967ebc099e93e6a34af4561/href">https://medium.com/media/45fdecf59967ebc099e93e6a34af4561/href</a></iframe><p><a href="https://en.wikipedia.org/wiki/Correlation_does_not_imply_causation">Correlation doesn’t imply causation</a>, but it can help you identify patterns worth exploring. By finding the highest correlations between weather variables and the NYC datasets, I’m going to try and answer a number of weather-related questions about the city:</p><ul><li>Does the temperature affect Citi Bike and taxi rides?</li><li>Does weather affect the causes of motor vehicle accidents?</li><li>Do wind gusts cause runaway cars?</li><li>Which <a href="http://www1.nyc.gov/311/">311</a> complaint is most closely related to low temperatures?</li><li>What’s the effect of snow on manhole covers and illegal parking?</li><li>Are rats and dead trees related to warmer temperatures?</li><li>Do noise complaints drop when wind speeds rise?</li><li>What happens to dogs in New York in the summer?</li></ul><h4>Does the temperature affect the number of Citi Bike and taxi rides?</h4><p>Inspired by Sara Robinson’s <a href="https://cloud.google.com/blog/big-data/2016/12/analyzing-nyc-biking-data-with-google-bigquery">exploration of Citi Bike data</a>, I thought I’d look at the relationship between <a href="https://cloud.google.com/bigquery/public-data/nyc-citi-bike">Citi Bike rides</a> and temperature. We can see that there’s an apparent relationship between temperature, and the rides taken on the <a href="https://www.citibikenyc.com/about">Citi Bike network</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AKO2TqtiLsVWjWSl07F8xQ.gif" /></figure><p>Here I’m comparing the number of riders each day, normalized against the average number of rides for that day-of-the-week. As the temperature rises, so does the number of rides being taken. The heatmap shows us the concentration of starting stations — as the temperature increases, more rides begin in the outer boroughs.</p><p>Let’s apply the same experiment to the <a href="https://cloud.google.com/bigquery/public-data/nyc-tlc-trips">NYC Yellow Cab ride data</a>. I’m going to simplify the graph by bucketing temperatures into degree increments, and finding the average number of trips taken within each bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*miX1FYY1BuPxCZ-c.png" /><figcaption>Use this <a href="https://bigquery.cloud.google.com/savedquery/174015642527:311f14f079db48e7a3abf30ae578085e">BigQuery Query</a> to get the data used in this graph</figcaption></figure><p>There’s some noise at the upper and lower end, where we have fewer samples, but nothing that indicates a real relationship. But hot, cold or temperate — New Yorkers take a lot of cab rides.</p><h4>Inside the NOAA “global summary of day” (GSOD) weather dataset</h4><p>Before answering the rest of our questions, let’s take a quick detour to simplify things.</p><p>The <a href="https://cloud.google.com/bigquery/public-data/noaa-gsod">GSOD dataset from NOAA</a>, one of several public datasets available in BigQuery, includes temperature, precipitation, snow and wind from over 9,000 stations dating back to 1929. To reduce time and cost, let’s extract only the data we need.</p><p>The following query selects only the weather variables I need from the observations recorded between the 2009 to 2016 span of our NYC data, from the two NYC airports — JFK and La Guardia, calculating the average results between them for each day.</p><pre>SELECT <br>  -- Create a timestamp from the date components.   <br>  timestamp(concat(year,&quot;-&quot;,mo,&quot;-&quot;,da)) as timestamp, <br>  -- Replace numerical null values with 0s <br>  AVG(IF (temp=9999.9, 0, temp)) AS temperature, <br>  AVG(IF (visib=999.9, 0, visib)) AS visibility, <br>  AVG(IF (wdsp=&quot;999.9&quot;, 0, CAST(wdsp AS Float64))) AS wind_speed,<br>  AVG(IF (gust=999.9, 0, gust)) AS wind_gust, <br>  AVG(IF (prcp=99.99, 0, prcp)) AS precipitation, <br>  AVG(IF (sndp=999.9, 0, sndp)) AS snow_depth <br>FROM <br>  `bigquery-public-data.noaa_gsod.gsod20*` <br>WHERE <br>  CAST(YEAR AS INT64) &gt; 2008 <br>  AND <br>  (stn=&quot;725030&quot; OR -- La Guardia <br>   stn=&quot;744860&quot;)   -- JFK <br>GROUP BY <br>  timestamp</pre><p>The total size of the new table is under 200k, so from here on, our weather joins <a href="https://cloud.google.com/bigquery/pricing">cost basically nothing</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-bLBq9yaFHyEV59F.png" /></figure><h4>Does weather affect the likely causes of motor vehicle accidents?</h4><p><a href="https://bigquery.cloud.google.com/savedquery/174015642527:4caaf1992122427eb984196a05a378ba">This query</a> uses the CORR function to calculate the <a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient">Pearson Coefficient</a> — the linear dependence (correlation) — between each weather variable (temperature, precipitation, snow, wind and visibility) and the number of <a href="https://cloud.google.com/bigquery/public-data/nypd-mv-collisions">motor vehicle accidents</a> for each primary cause.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vOOHv9A7Kg1BQxQL.png" /><figcaption>Use this <a href="https://bigquery.cloud.google.com/savedquery/174015642527:caa48837af2c43339fe3dd012732b31b">BigQuery Query</a> to generate this output table.</figcaption></figure><p>The results suggest slippery pavements cause more accidents when there’s more snow on the ground, and that there are more driverless / runaway when it rains and there are gusty winds.</p><p>By graphing snow depth and slips, we can see a possible pattern. The greatest impact appears to be on the heaviest day of snow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xKvLdIfCUPEnXhqn.png" /></figure><p>My gut tells me gusty winds could cause more cars to slip away from their drivers and escape down slippery, rain-covered streets — but with only four months of data, graphing the results doesn’t really support it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-sPyw-tl_UEREgAr.png" /></figure><h3>Calculating correlations for weather variables and 311 complaints</h3><p><a href="http://www1.nyc.gov/311/">311</a> is a service offered by New York City (and many other municipalities) for non-emergency inquiries and non-urgent community concerns.</p><p>Let’s start by running queries to find which 311 complaint categories have the highest correlations with <a href="https://bigquery.cloud.google.com/savedquery/174015642527:9c8fdb753fd34499bc4274d11ad71372">temperature</a>, <a href="https://bigquery.cloud.google.com/savedquery/174015642527:5fd8ac2328494045bfe892451e104239">snow</a>, <a href="https://bigquery.cloud.google.com/savedquery/174015642527:9cb1ba714a2f4599aa54130beee3991d">wind speed</a> and <a href="https://bigquery.cloud.google.com/savedquery/174015642527:8e2f4c3ed32f4b33afb9b79d4b24e5ef">rain</a>, and take a look at the top results to answer our questions.</p><h4>Which 311 complaint is most closely related to low temperatures?</h4><p>The strongest correlation is the least surprising: The call volume for complaints regarding heating are significantly higher when the weather is colder. Looking at the data, you can see the trend line is a good fit for an exponential relationship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-gSQ6JNDoR_e3lvn.png" /></figure><p>What was more surprising was seeing a similar correlation strength for missing manhole covers related to the depth of snow.</p><h4>What’s the relationship between snow, missing manhole covers and illegal parking?</h4><p>Looking at the scatter plot of call volume against snow depth and temperature, we can see that there does appear to be a relationship between snow depth and missing manhole covers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0s0m2KpFjWm_H_1L.png" /></figure><p>If we plot our data against time, we get a clear picture that snowfall <em>is</em> likely a significant contributor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QsN-g64RGtaJgJxAXcHCng.png" /></figure><p>There’s a pattern of spikes in both snow and call volume throughout the past 7 years. It’s unlikely to be a causal relationship (unless people are using the cover of a snowfall to steal manhole covers. Or — if the causation is in the other direction — manhole covers are the only thing between New York and a winter apocalypse.)</p><p>Graphing illegal parking mainly shows a trend of New Yorkers doing so more often. But blocked hydrants seem unrelated to snowfall, with a trend towards more annual reports and higher snowfall likely causing the false correlation.</p><p>Double parking features two spikes consistent with heavy snow in 2010 and 2016, but little correlation with snowfall in between those years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cwpgvaqrUMD7hKeEy1g0dQ.png" /></figure><h4>Are rats and dead trees related to high temperatures?</h4><p>The primary correlation for dead or dying trees appears to be seasonal — with call volumes growing in spring and peaking at the start of summer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FjZOBVUnfT0Qa1rk.png" /><figcaption>Use this <a href="https://bigquery.cloud.google.com/savedquery/174015642527:80eb1ebd1e7c43b5b14c50db8af3a006">BigQuery Query</a> to recreate the graph</figcaption></figure><p>I showed this to <a href="http://aisoftwarellc.weebly.com/articles.html">Lak Lakshmanan</a>, an expert on BigQuery and weather data, and he suggested that we seasonally adjust these figures against the monthly averages.</p><p>The following graph measures the difference from the monthly average temperature, against the proportion of monthly call volume. Without the seasonal effects, the relationship looks very weak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C0DDE9J_AtEmi9EF.png" /></figure><p>If we <a href="https://bigquery.cloud.google.com/savedquery/174015642527:ec074237ab8c4d7683df388743180b67">seasonally adjusted</a> rat sightings, there might be a trend of high temperatures with increased rodent sightings. The scatter point is noisy, but if we bucket our results by finding the average per degree in temperature, we get a much clearer indication of a relationship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PVRT7A0O7ZQJscJer81P7Q.png" /></figure><p>The bucketed graph offers a clearer signal, but by hiding the variance it makes the relationship appear stronger than it really is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dk8TsrPcvSqp_Tvw9VheYA.png" /></figure><p>Which is why I was thrilled when Lak introduced me to the hexbin graph!</p><p>Hexbin graphs group together all the points that land within a given hex, and assigns that hex a color according to the number of points within it.</p><p>It results in a clearer pattern than the scatter plot, but retains the variation. The distinctive diagonal band from lower left to upper right, shown in both the overall shape and in the area of greatest concentration, suggests a weak correlation between heat and rat sightings.</p><h4>Do noise complaints drop when there’s higher wind speeds?</h4><p>Barking dogs, loud talking, car music and loud parties have a correlation coefficient of at least -0.75 with wind speed. But, we also know New York City has windier weather in the winter, so let’s <a href="https://bigquery.cloud.google.com/savedquery/174015642527:a2602bf01b7046dcb007fdc84496bf38">seasonally adjust</a>, and jump straight to our hexbin graph to see if there’s more to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9SGh4FHyurpm3dj5cW2iA.png" /></figure><p>There’s a triangular pattern in the lower left corner of each graph that implies a weak, negative correlation — ​ a greater likelihood that there’ll be more noise complaints when the wind is low, and significantly fewer when the wind is 5 knots above the monthly average.</p><p>The strongest pattern is for parties, which demonstrates the same trend in the overall distribution, as well as a similar pattern within the region of most concentrated results.</p><p>Except for barking dogs. What do you think is going on here?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y5yDBBn4QbD4PAG2.png" /><figcaption>Use this <a href="https://bigquery.cloud.google.com/savedquery/729993340753:ce83143813994bb59d58b28b93fb4bc9">BigQuery Query</a> to recreate this graph.</figcaption></figure><h4>Dig in and find other nuggets hidden within the data</h4><p>I’ve shared a larger subset of possible weather/complaint correlations in <a href="https://docs.google.com/spreadsheets/d/1YffoCllGzE1Nn5TtPIA4NyZqLN6s3R4dPpkqzAXp3gQ/edit?usp=sharing">this Google Sheets spreadsheet</a>. It’s filtered to show only complaints with a Pearson Coefficient stronger than +/-0.7 for temperature, snow depth or wind speed — and +/- 0.5 for precipitation.</p><p>Once you dig in, you’ll find multiple confounding factors, including differences between boroughs, seasonality, annual growth, the relationships between variables and many others. When you’re done, make sure you share the results using <a href="http://www.twitter.com/hashtag/tilwbq">#TILwBQ</a>.</p><p>If you’re new to BigQuery follow these <a href="https://medium.com/til-with-bigquery/how-to-run-a-terabyte-of-bigquery-queries-each-month-without-a-credit-card-948773df8c0c#.9jex791fc">instructions to get started</a>, and remember that everyone gets 1TB <a href="https://cloud.google.com/bigquery/pricing">at no charge every month to run queries</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8c90afc7071" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/four-seasons-and-5-boroughs-in-one-post-d8c90afc7071">Four Seasons (and 5 Boroughs) in One Post with BigQuery</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>