Shadow Analysis Using Mapbox, Unity and OpenStreetMap

We’ve been pushing along with our latest release of Smart World Professional, and we’ve got some elegant tools coming online that will showcase why we went the route we did.  One of the biggest requests from the AEC industry is Shadow/Solar analysis.  There are tons of tools that do this, but they can be expensive, hard to use and even hard to get data for.  That’s why I really like the Mapbox Unity SDK and its 3D buildings.

You can, of course, load your own buildings into Smart World Professional but this is a great way to see how your projects will impact the surrounding city out of the box with our tools.  The Unity SDK really shines with this kind of work.

Thoughts on Cesium.js

cesiumlogoIf you’ve ever seen Cityzenith before, you would know that the basic premise is a 3D Google Earth like world in the browser. The way we accomplish this is using a JavaScript library called Cesium. There is much to like about Cesium and if you’ve never checked it out I highly encourage you to do so. Not only is Cesium we’ll supported/developed, it has a great community around it and lots of great documentation. Cityzenith had been on Cesium for years and you’ll see our screenshots on the Cesium webpages as a use case. When our customers first see Cesium running in the browser they’re all very excited and impressed with how well it works, how good it looks, and we’ve built a business around it. But in August we decided to go another direction and move to Unity3D. I’ll write more about that move later but this is a post on what worked for us with Cesium, where we had problems and what you can expect if you use it. If people ask me about a 3D solution in the browser, I can still equivocally say that I would recommend Cesium.

The choice of Cesium predates me, so I was not involved with the decision. That said those who made the decision have explained why they went that way. Cesium was probably not the original choice but at the time in 2014/2015 it was the best solution of a “game engine” for our product. We did look at other engines such as Unreal but the 64-bit support and the ease of use in the browser, Cesium won out. In implementing Cesium what were we able to do?

  1. We were able to implement a cross platform 3D world in a browser. That’s not an insignificant accomplishment. Our Cesium team really did an amazing job of making Smart World feel like a regular desktop application even if it was in a browser. No extensions to load, Java or Flash to configure. In a modern browser it basically just worked (more on this though later).
  2. While normally a pain in the rear, the fast updates and quick support for new features on the Cesium project gave us access to new features regularly. We were able to continually update our support for better graphics, performance and features almost by just loading up a new version of Cesium. Of course, in reality it is not that easy but the feature improvements were regular and powerful.
  3. JavaScript is an accessible language. Yes, it has its problems but finding people to code in JavaScript is not difficult. Plus it made it easy to combine other JS libraries we needed into the application.
  4. Open source is very liberating on many levels. Not having to fight a licensing battle and focus on the product is a nice change from other development libraries and SDKs. Also having direct access to the developers. If you don’t follow Patrick Cozzi yet you should. Amazing work and they listen to feedback.
  5. glTF support is second to none. I’ll be talking about glTF soon as well and why we absolutely love it.

OK, so what didn’t work with Cesium? Why leave it?

There are really only two reasons we have left. Most of everything else we get with Unity we would either have with Cesium very soon or it’s being implemented today. But the two reasons have been killer for Smart World. I don’t think everyone runs into the same problem we have with their apps so this is more of a specific issue with what we are doing rather than a problem with Cesium.

  1. Cross browser support. Remember when I said that we had cross platform support? Well that really only works if you use Google Chrome. Other browser support is poor at best. Microsoft Edge? Yea not going to happen. Being an enterprise app, we don’t always have the latest and greatest browsers that our customers can use. It’s not an IE8 problem but Edge and Firefox support really killed it for us. It got so bad that we had to put up a modal dialog box that basically said you couldn’t use Smart World without Google Chrome. That’s just unacceptable to us and while we tried to work on solving this the reality of support in other browsers was not coming quick enough and I’m not sure it was a problem that Cityzenith could have solved throwing money at the problem.
  2. Performance in the browser. Chrome is many things and one of them is that it is a memory hog. Loading up cities in Chrome really would put a strain on our user’s computers. The browser is great for simpler 3D mapping but streaming gigabytes of data into a browser really tasked computers. We worked on a ton of LOD workarounds but the compromises to make the application work on a typical enterprise desktop or laptop really left a bad taste in our mouths.

Roadmap for Cityzenith

We want to provide the best 3D analytical tools and we’ll continue to do so. Combined with AWS Lambda and AWS IoT services, we’re making a huge leap in how people perform spatial analysis. Not only are we working on our own planning tools such as rooftop solar analysis, LEED-ND analysis and traffic analysis, we’re integrating Rhino Grasshopper plugin support, so anyone can use their existing workflows. As I said above, we’re moving our 3D engine to Unity. In fact we’ll be having a closed beta very soon for our customers to try it out. One of the biggest reasons we went with Unity was Mapbox’s Unity SDK. We are already a big user of Mapbox and thus moving to the SDK made a ton of sense. I’ll go more into this in another article.

 

Focus on Data

When you think geospatial you think data, right? You imagine GIS professionals working their butts off making normalized datasets that have wonderful metadata. Nah, that’s just some slide at the Esri UC where “best practices” become the focus of a week away from the family in the Gaslamp. For some reason, GIS has become more about the how we do something and less about the why we do something. I guess that all that “hipster” and “technologist” thinking that goes into these “best practices” loses the focus on why we do what we do, the data.

At Cityzenith the first question a customer asks me is what data do we have available. See that’s because they aren’t GIS technologists, they’re just working folk who have to solve a problem. That problem requires the same problem that an accountant requires, accurate data. The last question these people care about is “Should I script this with JavaScript, Python or Ruby?”. They’re just looking for data that they can combine with their proprietary company data to make whatever decisions they need to make.

Finding Data is Hard

So much of what we do in our space is wasted on the tools to manage the data anymore. Sure in the 90s we needed to create these tools, or improve them so they could rely on enough to get our work done. But the analysis libraries are basically a commodity at this point. I can probably find 100 different ways to perform a spatial selection on GitHub to choose from. Personally, I can’t even recall opening ArcGIS or QGIS to solve a problem. There just isn’t a need to do so anymore. These tools have become so prevalent that we don’t need to fight battles over which one to use anymore.

Your TIGER WMS is available

Thanks to Google and OpenStreetMap, base maps are now commoditized to the point that we rarely pay for them. That part we can be sure that we’ve got the best data. (Disclosure, Cityzenith uses Mapbox for our base mapping) But everything else is still lacking. I won’t pick on any vendor of data but generally, it works the same way, you either subscribe to a WMS/WFS feed (or worse, some wacky ArcGIS Online subscription) and if you’re “lucky”, a downloaded zip file of shapefiles. Neither lends itself to how data is managed or used in today’s companies.

Back to our customers, they expect a platform that can visualize data and one that is easy to use. But I know the first question they ask before signing up for our platform is, “What data do you have?”. They want to know more about our IoT data, data from our other partners (traffic, weather, demographics, etc.) and how they can combine it with their own data. They will ask about our tech stack from time to time, or how we create 3D worlds in the browser but that is so rare. It’s:

  1. What do you have?
  2. Where do you have it?

There are so many choices people have on how they can perform analysis on data. Pick and choose, it’s all personal preference. But access to the most up-to-date, normalized, indexed and available data for their area of interest. That’s why our focus has been partnering with data providers who have these datasets people need and present them to our users in formats and ways that are useful to them. Nobody wants a shapefile. Get over it. They want data feeds that they can bring into their workflows that have no GIS software in them whatsoever.

As I sit and watch the news from the Esri UC it is a stark reminder that the future of data isn’t in the hands of niche geospatial tools, it’s in the hands of everyone. That’s what we’re doing at Cityzenith.

Open Data Has Changed Everything

At Cityzenith we provide open data to all our customers for their decision making. Cities make it so easy to get this data and use it. But there is so much here than open city data. Our partners from General Electric to Mapbox all use open data one way or another to help us all get our jobs done.

A blast from the past hit me as I was cleaning up books in my office. An invoice from GDT (yea I mistyped it above) for their Dynamap product in 1998. What we were getting back then was TIGER data with curation and charged a ton of money. GDT and others organized the data for you which is what you paid for vs the TIGER/Line files that we normally used.

Today though we don’t use TIGER data anymore, at least directly. We use OpenStreetMap data which is more complete and accurate than TIGER ever was. We use Mapbox for our basemaps (aerial, street, traffic, etc) and they’re all built with OSM data. But what is so very different than what GDT and others is companies like Mapbox help build OSM in return for using the data. That means when Cityzenith uses building heights in San Francisco for modeling that we can take advantage of the community and fill in the blanks where needed.

Mapbox Traffic in Cityzenith Smart World

That’s the big difference between then and now. You can have literally the same look and feel as Mapbox without having to pay a dime if you want. That’s the big game changer, open access to open data means that we’re all working on the same basemap and making improvements to that map. We can get all emotional with words like democratization but it has changed how we work with data. Power is no longer controlled by large companies (the reason why GDT was purchased by TeleAtlas which was acquired by TomTom). But we never have to worry about that because the map is controlled by everyone.

As we move to AR and VR mapping, we’ve got the data in place to make all we need for these virtual environments. That’s why we see such innovation in our space, the freedom to create without fear of not having access to the same data as everyone else.