Archive for the ‘Uncategorized’ Category

Visualizing Baltimore City’s Trees

October 18, 2018
Kevin Danaher

Some time ago, I was browsing my Baltimore neighborhood’s Nextdoor forum and came across a link someone shared to a web map of Baltimore’s Tree Inventory. This was of interest to me not only because I love trees, maps and data, but also because I have joined my neighbors in planting a number of trees throughout our community.

Planting a new tree with members of the community on 23rd street, after “making room” in the sidewalk’s concrete.

The Baltimore Tree Inventory

Digging into the web map, there is a lot of data represented here! Map layers include trees, stumps, as well as locations suitable and not suitable for future planting. Each of the tree features contains a number of attributes including species, common name, height, DBH (diameter at breast height), and much more. All of this data has been painstakingly collected in the field for the entirety of Baltimore, which is no menial task.

The Baltimore Tree Inventory web map

Built as an ArcGIS Online Web App, the map has useful tools/widgets for interacting with the data, my favorite being the “Infographic” which charts the species breakdown in the current map extent. There are other standard but useful widgets as well, including the ability to change the basemap, take measurements, and toggle layers, just to name a few.

Using the ‘Infographic’ widget to chart the distribution of tree species

Visualizing Tree Data in a Different Way

The Baltimore Tree Inventory map is an amazing resource for visualizing tree data and especially to explore the attributes within. After spending some time with the map and data, I had a couple thoughts. First, that the web map performance and rendering is on the slow side dealing with the sheer size and number of points in these map layers. And additionally, that it’s a little hard to get a sense of the density and distribution of these trees with the map’s current symbology. The map seems to be more effective at larger scales (zoomed in to neighborhood/street level) than at smaller scales (visualizing trees across the entire city or spanning multiple neighborhoods) for interacting with the data. This gave me the idea to visualize these points in a different way – as a heatmap.

The Baltimore Tree Inventory data in heatmap form. Click the image to explore.

Making the Map

To create the map, I first gathered the data. I wanted to keep the map as simple as possible, so I’ve made use of only three layers: buildings, water, and the subject data – trees. I also wanted to address any performance issue by using vector tiles, which can easily handle the number of points and polygons we’re dealing with here. I reprojected everything, converted to geojson, and ran through a wonderful command line tool Mapbox has created and maintains called Tippecanoe. Put simply, the purpose of Tippecanoe is to create vector tilesets out of large or complicated datasets that are optimized at a per-zoom-level basis. For example, my building dataset contains over 260,000 polygons and a number of fields. Obviously I’d like to see every individual building at my highest zoom level, but it’s okay for building features to be simplified or dropped entirely at lower zooms. I also dropped all the fields/attributes from the building and water data (preserving only the geometry) which helped keep the size of my tilesets down. In order to create an effective heatmap, I obviously needed to keep all my tree points, so for creating the tree tiles I preserved as much detail in the point data as possible. The lines I fed to Tippecanoe are below:

‘tippecanoe –minimum-zoom=10 –maximum-zoom=17 -o BaltimoreTrees.mbtiles -B 10 –layer=Trees -f –attribution=”TreeBaltimore” Trees.geojson’

‘tippecanoe –minimum-zoom=10 –maximum-zoom=17 -o BaltimoreBuildings.mbtiles –drop-densest-as-needed –extend-zooms-if-still-dropping –layer=Buildings –exclude-all -f -D10 Buildings.geojson’

‘tippecanoe –minimum-zoom=10 –maximum-zoom=17 -o BaltimoreWater.mbtiles –drop-densest-as-needed –extend-zooms-if-still-dropping –layer=Water –exclude-all -f -D11 Water.geojson’

’tile-join -o BaltimoreTreeBlog.mbtiles -n “Baltimore Tree Blog Data” -A “Data @ TreeBaltimore, City of Baltimore” -f  BaltimoreTrees.mbtiles BaltimoreWater.mbtiles BaltimoreBuildings.mbtiles’

The final line above uses tile-join (bundled with Tippecanoe) to merge the tilesets into a single mbtiles file, which I uploaded to our Mapbox account to handle the hosting and serving of vector tiles. The total size of the tiles (created for zooms 10 through 17) is about 30 mb. With more time spent fiddling with Tippecanoe’s many options, I might have decreased the size of the tileset while keeping it usable for my map, but I was happy with the appearance of these tiles across zoom levels.

An oblique view of the map, looking Northeast over Druid Hill Park.

Finally, I began some coding in the Mapbox GL JS API. After pulling my tileset and setting up the basics, I was finding the trickiest thing to get right was the colors for the heatmap data. I started with a color gradient which showed red for the densest data, as is so commonly seen in heatmaps. But this just felt wrong. We’re dealing with trees here, so the color palette should reflect a greener theme. I consulted with Tim, our graphic designer and 3d specialist, whose design decisions I would trust with my life. We toyed with a lot of ideas before landing on the fairly simple range of greens seen in the current interactive. In a heatmap, the key to getting the color right seems to be thinking in how intensities should be represented. In the case of this heatmap, I started wrongfully thinking I wanted areas with more trees to be greener, but the reality is I simply want those areas to pop. So denser areas take on a lighter, near-yellow green which really grabs a users attention, while less dense areas take on the a base green color.

Above zoom 17, it is no longer effective to keep the “heat” in the map. I switched to symbolizing the trees as circles, and included a popup on hover which provides the tree species.

Above zoom 17, trees are represented by circles, and include some interaction.

Final Thoughts, Future Improvements

Viewed in heatmap form, the data tells a somewhat different story than what we see in the Baltimore Tree Inventory map where trees are individually symbolized. In the heatmap, we see some parts of the city stand out much more than others as far as tree density. Something to bear in mind is that this data doesn’t necessarily represent all trees in Baltimore, but does show those that the city, TreeBaltimore, Recreation & Parks and other organizations have inventoried and maintain in a database. Visualizing the tree inventory data in this manner might show tree planting organizations which neighborhoods to put focus on for future planting efforts, or show where additional field collection might be needed to improve the dataset.

My original intent for this map was to allow user filtering by species of tree. However, the data contains over 120,000 tree points and over 300 unique tree species, so to start I thought it best to just stick with mapping… trees. Another thought was to exclude tree data from the heatmap that fell within city parks, and to symbolize the parks on the map in a (green) symbology that would represent an obvious haven for trees. Doing this would put the map’s emphasis on urban trees, or those along the sidewalks of our neighborhoods. But, the park data in Baltimore’s open data portal hasn’t been accessible lately, so I gave up on that for now.

Even since I pulled a snapshot of the dataset several weeks ago, I see that the tree feature layer has been updated – rendering my heatmap outdated! As a resident of Baltimore City, I am extremely pleased that this data is maintained, let alone that it exists. Now, when planting new trees in Baltimore, we can all look forward to the addition of points to this dataset and map.

Data from TreeBaltimore and the City of Baltimore. Thank you to all organizations who contribute to the greening of Baltimore.

Why Maps Bring Tableau Visualizations to the Next Level

September 21, 2018

Basics of Tableau

So what exactly is this Tableau thing, anyways? I asked that same question several months ago, but once I got familiar with it, I never looked back. Tableau is an incredibly powerful data visualization platform that allows you to craft interactive visualizations (or as some call them for short, “vizzes”). Tableau is primarily used for business intelligence. However, it can be used for anything from a series of charts showing changes in a city’s population density over time to comparing your favorite football team’s stats to its rivals.

At this point, you might be wondering what exactly Tableau has to do with maps. Tableau visualizations give your audience the opportunity to explore the data that is being presented. One of the best ways to explore data is with, well, maps. Tableau contains a fairly comprehensive and easy-to-use set of mapping capabilities. It can read a variety of spatial files, including GeoJSON, MapInfo, KML, and shapefile formats. It’s also integrated with Mapbox, which allows you to import custom basemaps if you’re feeling fancy. Using maps in Tableau provides your audience with the ability to better interpret the “where” aspect of your visualizations.

There’s some Tableau lingo that’s important to know before diving in. Tableau is essentially made up of worksheets, dashboards, and stories. A worksheet is the equivalent to your workspace – this is where you create a chart or visual or make calculations, among other things. You place the visuals that you create in your worksheets onto your dashboards or stories, which are sort of like blank palettes for your visualizations. Once you create your dashboard or story, you can save it to Tableau Public. Once published, you can share your viz with others or even embed it on a blog or website.

Mapping Your Data in Tableau

Enough with the overview though – let’s explore some vizzes with maps! The dashboards below, which span a variety of topics, incorporate maps in different ways.

I created a dashboard that examines the percentage of abandoned/vacant buildings versus the crime rates of Baltimore neighborhoods from 2013–2016. The chart included on this dashboard might be useful on its own, but the incorporation of a choropleth/graduated symbol map serves as a particularly important component of this visualization. A user can simply hover on a neighborhood or a point on the scatter plot and immediately make the spatial connection between a neighborhood and its data values.

Tableau visualization of vacant buildings vs. crime rates in Baltimore
Source Link

The viz below explores the average cost of supplemental healthcare plans in the US for citizens over 65 that fill the gaps of Medicare health insurance. The inclusion of the simple, tile-gridded map allows the user to easily make a spatial connection with the data. It also lends insight into which regions of the US may rank higher or lower on healthcare costs for senior citizens.

Tableau visualization of the costs of MediGap health plans for citizens over 65
Source Link

Let’s check out a viz that’s a little more fun, which also happens to involve my favorite caffeinated beverage. This dashboard shows the distribution of Starbucks locations across the US. The user can choose their location, or even multiple ones, and explore further from there using the google maps panel that is integrated into the dashboard.

Tableau visualization of the distribution of Starbucks locations across the US
Source Link

A Review of Tableau from a Geographer’s Perspective

Like with anything, there are pros and cons to using Tableau. The most important (and obvious) benefit to mention is Tableau’s robust data visualization capabilities. It gives you and your audience the freedom to really unleash the power of the data you are utilizing. Also, the learning curve isn’t too steep. If you’re willing to get your feet wet and make some mistakes (I certainly have), you’ll master the basics in no time. Another great aspect of Tableau is the level of customization. There is almost always a workaround to achieve something that isn’t readily apparent in the software. Additionally, there exists an active and supportive online community that can help you learn the ins and outs of Tableau. This can be a lifesaver when you’re stumped on anything from getting your dual-axis chart to display correctly to mastering some advanced calculations to further enhance your viz.

On the other hand, you may encounter some challenges if you’re looking to create a dashboard with perfectly aligned and sized objects to then place in a printed report. The formatting capabilities of Tableau are lacking in several respects. To be honest, it’s because Tableau isn’t really meant for that; the platform is more geared towards creating unique visualizations that are to be interacted with online. However, the limited formatting features are a drawback if you are working on a project that requires precise design specifications. Exporting your vizzes to PDFs or other file formats are another issue. Your dashboard might look picture-perfect on your desktop, but come out with mismatched formatting and colors once exported to a PDF or uploaded onto Tableau Public.
Some solutions exist out there for these issues, but they can be time-consuming and they don’t always work.

General pros and cons aside, the mapping capabilities in Tableau are well-integrated into the software. They also align well with Tableau’s creed of allowing your audience to interact with the visualization being presented to them. It gives anyone, even if you’re not a spatial expert, the power to incorporate the “where” component of a dataset into your visualization. This capability should never be underestimated.

Excited to create awesome visualizations (which will hopefully include some maps!) but need some inspiration? The Tableau Public gallery is a wonderful place to start and can be accessed here.

Happy Tableau-ing!

A Cartographer Visits the Prime Meridian

May 9, 2018
Marissa Wood

Like any dedicated mapmaker, visiting the Royal Observatory at Greenwich and the Prime Meridian were at the top of my tourist to-dos on a recent trip to London.

Today, the Prime Meridian is located in the yard of the Royal Observatory at the top of the hill in Greenwich Park. One can look “down” the marked line, due north, and take in the National Maritime Museum and Queen’s House, the Thames, and London shimmering in glass in the distance. I found the view incredible, especially on a rare, sunny March day. But the Prime Meridian itself was a bit of a letdown. Sure, it’s neat to straddle the line and have a foot on either side of zero. And yeah, its cool to stand at the precise longitudinal location from which time was standardized. But it’s really just a metal ribbon slicing through an old stone courtyard.

However, if one turns around and glances back at the Observatory, things start to get a little interesting. Due south of the Prime Meridian, just a few feet—I mean about a meter—away is a great big telescope, the Transit Circle telescope constructed by Sir George Biddell Airy in 1850 to be exact. Airy’s Transit Circle telescope was used to precisely measure the movements of stars as they crossed the Prime Meridian.

There is another telescope to the left of Airy’s, and then another smaller, older one. Following the view of these earlier telescopes toward London back into the yard, one’s eye catches another prime meridian to the west of the Prime Meridian and yet another stone marking yet another important meridian to history. Each of these meridians were used to chart stars and measure longitude and time. But with each new telescope, more precise and accurate than the last, the Prime Meridian was pushed to the east by a few yards (meters) as the building was extended to accommodate the latest equipment.

I was struck by how arbitrary the location of the Prime Meridian is. 0˚ is located at the top of a hill outside of London because it was convenient for an astronomer of history to put it there. The world decided that this line, several iterations after the original, was the Prime Meridian at the International Meridian Conference in Washington DC, in 1884. Adopting the Prime Meridian as an international standard allowed for time to be consistent amongst nations and made maritime charting and navigation more accurate.

Then a third truth struck me. Standing with feet on either side of zero, I checked the GPS on my phone, and it placed me ever so slightly to the west of 0˚. Apparently, the Prime Meridian as marked isn’t even the Prime Meridian anymore. It was moved unceremoniously about 100 meters to the east based on standardization of Earth’s geodesy in 1984. It was yet another arbitrary move; although, probably even more math went into this adjustment than Airy’s original placement of his telescope in 1850.

Twitter Facebook Linked In YouTube
Subscribe to our newsletter! SUBSCRIBE