The Great Escape – 3D Fantasy Map Tutorial

The COVID-19 lockdown has brought with it an abundance of online professional development opportunities – a welcome escape from the terrors caused by the novel coronavirus (or by the house arrest and social distancing regime itself, if you concur with my view ;). On April 29, cartographer Daniel P. Huffman of Madison, Wisconsin, organized “How to do Map Stuff: A Live Community Sharing Event” with virtual workshops offered by volunteers from around the world, see https://somethingaboutmaps.wordpress.com/2020/03/19/how-to-do-map-stuff/.

Along with several interesting presentations, I listened in to Minnesota-based cartographer Ross Thorn, who went through the process of “Creating an Interactive Fantasy Map” using QGIS and MapBox. The recording is now posted on Youtube at https://www.youtube.com/watch?v=2nmLibB3lGs (starts around minute 9:30). Rather than create a set of islands from scratch, Ross “floods” a digital elevation model (DEM) so that mountains or hills turn into islands while lower elevations are transformed into the open seas… The remainder of that tutorial focused on vectorizing the island boundaries and adding land-use polygons as well as settlement locations with attached information.

During the April 29 live session, a chat participant asked whether the original elevations could be preserved as terrain on the islands. In this post, I would like to show how this can be done and how the result become an interactive 3D map within the QGIS and Web environment. I am using QGIS 3.4.12 and QGIS 3.10 with the Qgis2threejs plugin. The plugin does not correctly install on my Windows 8.1 office computer, thus the second part of this post is completed using the newer Windows and QGIS versions on my laptop. Also, this is certainly not the first time someone has created a 3D fantasy map, nor the only way in which it can be done; it just happens to be the first time I was motivated to try this myself using one of the GIS tools I am familiar with.

To begin the process outlined in Ross Thorn’s tutorial, I downloaded the southern portion of Ontario’s provincial DEM from https://geohub.lio.gov.on.ca/datasets/mnrf::provincial-digital-elevation-model-pdem. Attention: This file is almost 2 GB large! You can likely find smaller DEMs from your local or regional government that can be used equally well, or work with the data that Ross used.

The above screenshots show the PDEM displayed in QGIS using the default black-to-white gradient for increasing elevations. The Niagara Escarpment is visible in the south adjacent to the Greater Toronto Area, while the remaining high altitudes are all part of the Canadian Shield. I zoomed in to an area west of Lake Temiskaming near the eastern border of Ontario with Quebec.

A further zoom yielded an area with several distinct peaks above 500m in elevation. Also shown above is the symbology dialog to distinguish pixels by elevation above and below 500m and the resulting “islands”. Using the menu sequence Raster | Extraction | Clip Raster by Extent | Use Canvas Extent | Save to File “PDEM_Escape.tif”, I clipped the province-wide DEM to the area shown. I renamed the new layer and used copy & paste to apply the same blue-red style from PDEM_South.

Under layer properties, you can view a histogram of raster grid values. The above screenshot is zoomed in to values above 500m to get a sense of their frequency distribution; I didn’t know what to expect, but the fast decline of higher elevation certainly makes sense.

We now use Raster | Raster Calculator for what is the key “contribution” of this post. In his tutorial, Ross used the following formula to set cells with elevation below the threshold (here: 500m) to zero (= water) and cells above threshold to one (= land):

(("PDEM_South@1" <= 500) * 0) + (("PDEM_South@1" > 500) * 1)

Here, we do not want to condense the higher elevations to a categorical value representing land, but keep them as land elevations above the new “sea level” of 0. We achieve this by multiplying the values selected in the second term of the sum by the original elevation value, from which we subtract the threshold. Thus, while values up to 500m will be converted to 0m, the value of 501m will be converted to 1m (= 501m – 500m) and so on:

(("PDEM_South@1" <= 500) * 0) + (("PDEM_South@1" > 500) * ("PDEM_South@1" - 500))

After completing the remainder of the tutorial, I realized that the configuration of my area’s elevations did not yield sufficient terrain variation. I went back to the current step to introduce a vertical exaggeration factor of 5. Therefore, the final raster calculation is as follows:

(("PDEM_South@1" <= 500) * 0) + (("PDEM_South@1" > 500) * ("PDEM_South@1" - 500) * 5)

The following screenshot shows a colour scheme I created for the symbology property of the new LDEM_Escape5 layer, to allude to the different land cover classes that may be associated with increasing elevations, i.e. water, coastal sand, grasslands, forests, and bare rock. Another important change I made here is under Project | Properties | CRS tab, where you want to find and set “WGS 84 / Pseudo-Mercator” (EPSG:3857) to set the map units to metres instead of degrees (if that’s what it was before).

For the 3D version of our fantasy world, we will primarily use the raster dataset. However, we will also complete the instructions from Ross Thorn’s tutorial to create a vector dataset with the coastlines of our islands. The command sequence Raster | Conversion | Polygonize (Raster to Vector) turns the grid cells of the raster layer into square polygons. Unfortunately, cells with different elevation values on the islands will result in separate polygons, as shown in the first of the following screenshots (I clicked to select and highlight the large water polygon as well as a few small in-land squares for illustration). Ross did not have this issue, since all of his land pixels had the same value of 1 and formed contiguous polygons for each island. We will achieve this with the command sequence Vector | Geoprocessing Tools | Dissolve. This generates the situation shown in the second screenshot, with all land pixels combined and the water polygon removed. However, different islands are now all combined into one, multi-part polygon (I clicked to select only one island, which results in the highlighting of all land areas, since they are part of this multi-part feature). We now use Vector | Geometry Tools | Multipart to Singleparts in order to separate the land mass into independent entities, as shown in the third screenshot where a small island in the northwest is highlighted without also selecting the remaining islands. After adapting the symbology and project background colour, and adding a text field with a few island names for labelling, we achieve the status shown in the fourth screenshot below.

Our last steps in QGIS include making the island polygon fill transparent and give its borders a sand colour. For island labelling, I selected the three islands that actually had a name assigned and used right-click on the layer name | Export | Save Selected Features to create a new Shapefile layer with only these three islands; otherwise, there would be a lot of NULL labels down the road (not in QGIS but in the 3D export). I also created two new point layers according to Ross’ video: one for named cities and another for a mountain peak. Labels are activated under each layer’s properties and I am using “buffers” in the label options to make the label text better visible. The end result is shown in the following screenshot.

At this point we are starting to work with the Qgis2threejs plugin, which will convert our 2D map into an interactive 3D scene that is exportable to the Web. As noted above, I had to migrate the project to my Windows 10 laptop using QGIS 3.10. To find the Qgis2threejs plugin, go to Plugins | Manage and Install Plugins and let the system fetch the latest plugins. In the search field, type “threejs” to find the plugin and install it. If all goes well, you should have a new item in the “Web” menu and be able to run the “Exporter” from there. The tool opens with all project layers available for display and customization.

Check to activate the (vertically exaggerated) island terrain layer (LDEM_Escape5) and right-click for properties. I enabled “Surrounding blocks” to extend the seas beyond the map canvas and deactivated “Build sides” so that the water level is a plane rather than a block. The default material setting to display “Map canvas image” drapes the 2D map from QGIS over the elevation model. While this is what we want for the topographic colour scheme, it does not work for the points of interest and labels, which we’d rather turn into 3D objects. The QGIS window underneath the plugin window is still actionable and we thus uncheck the visibility of the places, mountain, and island names layers (see background/left side of the following screenshot).

So for example, we see the places layer unchecked in the QGIS project/map canvas but checked in the Qgis2threejs Explorer. In the corresponding 3D layer properties, we set the object for cities to a box sized 400m x 400m x 100m (assuming you set a coordinate reference system with metres as the map unit, as outlined above). Under “Features”, I should have checked “All features” to ensure that points that aren’t included in the current QGIS map extent are still exported. Lastly, activating “Export attributes” creates the 3D “airborne” labels at a set height that you can see in the scene. All this is done for the cities, island labels (only names are visible, coastlines of this layer remain invisible but come from the other island polygon layer), and the mountain peak (also no object symbol, just the name/label).

Under File | Export Settings, you have the option to save the Qgsi2threejs settings if you need to close your session and load them to restore it.

I did not play with the other Explorer settings but proceeded straight to File | Export to Web, using a temporary directory, the “3D Viewer” template, and “Enable the Viewer to Run Locally”. The template “3D Viewer with dat-gui panel” may be of interest in other applications where controlling layer visibility and opacity is useful (try it!). The above screenshot of the 3D Web map shows our fantasy world from the northwest. A live version can be accessed in my Github repository at https://crinner.github.io/escape5/.

Future work should include checking out the HTML and Javascript code that was generated. Another participant in Ross Thorn’s tutorial asked about putting units in the fantasy world, and while I was not sure whether they were referring to map units or game avatars, it would certainly be neat to add animated objects (or subjects!?) to the three.js scene! A quick Web search suggests that this is perfectly possible. I can think of other customizations of the geospatial objects, their appearance, or the functionality of the 3D viz, some of which are inspired by student work posted at https://spatial.blog.ryerson.ca/, e.g. flight simulation or vintage map design.

The Graduated Colour Map: A Minefield for Armchair Cartographers

Do not use choropleths for your COVID-19 counts, ever!

In a hilarious contribution to Medium, Dr. Noah Haber et al. issued a call to “Flatten the Curve of Armchair Epidemiology“. They analyze the transmission of “well-intended partial truths” about COVID-19 and caution of hidden “viral reservoirs throughout the internet”. To flatten this curve, they recommend fact-checking before posting and go as far as endorsing social-media distancing measures. As with general COVID-19 tips based on armchair epidemiology, misinformation can also be spread through the numerous COVID-19 maps that are widely circulating through the Web. In this article I want to focus on one particular instance of armchair cartography: wrongly mapping COVID-19 count data using choropleth symbology.

Choropleths are great-looking maps, my favourite thematic map type! They use graduated colour schemes to fill areas (the spatial units of analysis) to represent the magnitude (usually in ranges) of data collected for, or aggregated to, these units. But they can be deceptive in many ways, one of which arises from using raw-count data without adjusting for the different sizes of the spatial units. The above gallery of cartographic failures shows a small selection of misleading choropleth maps of COVID-19 cases published by major government and news media Web sites as of March 26, 2020.

Representing raw-count variables using choropleth mapping is a mistake that is notoriously difficult to explain. In “Mapping coronavirus, responsibly“, Dr. Kenneth Field notes the need to normalize raw COVID-19 totals to account for different underlying population sizes of China’s provinces. But in a related debate on Twitter, Dr. Stephanie Tuerk, a Senior Data Visualization Engineer at Mathematica, pointedly asks: “Can you further articulate the problem with using a choropleth to display counts? What precisely will people misunderstand?” She also questions the recommendation to transform count data into normalized rates, if the goal is to map the original counts. Indeed, I tell my cartography students that normalizing their data (by area, total population, or another reference total) will create a new variable and they need to think about whether that’s what they actually want to visualize.

The best explanation that I have seen as to the actual reason for the misrepresentation of raw-count data through choropleth maps was written by GIS Consultant and former Harvard Lecturer Paul Cote under the heading “Effective Cartography – Mapping with Aggregated Statistics“. Using the schematic figures shown above, Paul underlines our cognitive ability to understand quantity from graphics that vary in one dimension (size), such as in proportional symbols, in contrast to how we read intensity from colour (lightness, value), such as on choropleth maps. It appears that we are wired to understand a choropleth map as a representation of an intensity (e.g. population density per sqkm, infection rate per one million people), not as a count, and therefore this map type does not fit with raw-count data.

The cartography textbook by Dr. Terry Slocum et al. (2009) proposes an additional explanation. They note that we read information from a choropleth map as the probability of encountering a phenomenon. For example, if we look at Google’s world map of COVID-19 cases, China’s 80,000 cases put it in the highest class (dark blue). We’d therefore expect to be exposed to many infected people if we were to travel around that country. Conversely, we’d expect to find fewer cases in Canada, since this country’s 4,000 cases are mapped two classes lower (medium blue). Assuming we run into comparable numbers of people given space-time constraints (but ignoring current travel restrictions!), this is a wrong conclusion since Canada’s COVID-19 infection rate of 103 cases per one million population is roughly twice as high as China’s 53 (March 26 data from https://www.worldometers.info/coronavirus/#countries).

It is important to note that this issue does not automatically occur on every choropleth map or between any two spatial units on a given map. In fact, I had a hard time finding a suitable pair of provinces or countries, in which the relationship between raw counts was inverted compared to that between normalized data. Yet, the possibility of this issue is what makes the choropleth map a no-go for visualizing total counts.

The above example also highlights another serious issue of the choropleth technique: It maps each value homogenously across its entire spatial unit, while in reality many phenomena are unevenly distributed within the units. Infectious disease is a good example of a phenomenon that produces highly localized clusters (China’s city of Wuhan, Italy’s Lombardy region, Germany’s Heinsberg district), which are poorly represented on any choropleth map that uses data aggregated to larger spatial units. The coronavirus pandemic demonstrates that improper cartography is not just an academic concern but can have serious real life implications – on public attitudes and even on policy decisions!

Reflections on a Decade and a Half of Teaching Cartography and Geovisualization

This past fall semester of 2019 marked my 15th time teaching our graduate cartography course. When I joined Ryerson University in August 2006, I had already taught MSA 9050 Digital Cartography at the University of Toronto for three years, in Fall 2003, 2004, and 2005. The course was part of the joint Master of Spatial Analysis (MSA) program between UofT’s and Ryerson’s Geography departments, and was also cross-listed with UofT’s graduate course GGR 1913H of the same title. The course had been taught by Byron Moldofsky, who retired as Manager of UofT’s GIS and Cartography Office in 2017, after 37 years of service as a staff member, and continues to be active as an executive member of the Canadian Cartographic Association and a free-lance cartographer.

Then, and now as SA8905 Cartography and Geovisualization, the course “introduces [traditional] cartographic principles and their application to the design of thematic maps with [modern] GIS software” – the words “traditional” and “modern” were removed from the Ryerson calendar course description at some point, without altering the core message. While the lecture portion has remained consistent over the years, heavily relying on three subsequent editions of Terry Slocum’s comprehensive textbook “[Thematic] Cartography and [Geographic] Visualization”, the approach to the hands-on lab component has changed significantly. Expanding on Byron’s design, the earlier iterations of the course saw students select a mid-sized Census Metropolitan Area (CMA), complete a series of weekly lab exercises using socio-economic data from the Canadian Census, submit one or two intermediate lab assignments and one or two reading summaries (later replaced by a map critique), and prepare a final lab project. One lab assignment let the student select, present, and analyze an issue of data normalization, classification, or colour choice. In 2004 in conjunction with a teaching technology grant, students chose their “good” map from the first assignment to turn into a web mapping application as the second assignment. The final project was a thematic atlas plate containing three or more maps portraying the student’s choice of Census data for the selected CMA. The final assignment also required a sketch map or editorial plan for instructor feedback during the term.

Through a series of annual changes to the evaluation scheme, the current set of assignments emerged, consisting of a map poster with two or three maps and a geovisualization project. The map poster is a logical extension of the atlas plate assignment, though students are now free to use any data for any geographic extent, making the assignment more suitable for students across all fields of study in the MSA program (business/retail, social/community, and environmental/physical). The range of topics and data sets being mapped has been impressive; these are the most recent poster topics from Fall 2019:

The map poster assignment includes an early proposal, students’ in-class presentation and discussion of a draft map poster, and final submission. Students are free to use the GIS software of their choice, and many also use graphics tools to finalize their posters. To ensure the student’s preparation for the map poster proposal, the lecture component of the course is now compressed into the first half of the term. This was also possible because most MSA students now enter the program with solid GIS and mapping skills, so that the lecture and textbook material usually serves as review rather than new information. Nevertheless, practice in examining data distribution, selecting adequate cartographic options, and creating “correct” and meaningful thematic maps is still sorely needed by most students who take the course!

Before we move on to examine the second major assignment, the geovis project, I would like to highlight some outstanding student work with respect to the map poster. To my knowledge, three SA8905 students have received external awards for their map posters:

  • Brad Carter, Broken Windows and Violent Crime in Philadelphia: 2nd place winner of the 2012 National Geographic Award in Mapping. Brad’s map poster also won Honorable Mention in the Student Maps Category of the Cartography and Geographic Information Society’s 39th Annual Map Design Competition.
  • Yishi Zhao, Earthquake Intensity and Population at Risk – California, USA (2006-2014): 2nd place winner of the 2015 National Geographic Award in Mapping.
  • Nebojsa Stulic, East Asians in USA – Demographic Trends of Diverse Population: winner of the Canadian Cartographic Association’s 2019 President’s Prize for excellence in student map design at the university level. Nebojsa’s map poster also won Honorable Mention for the Arthur Robinson Award for Best Printed Map in the Cartography and Geographic Information Society’s 46th Annual CaGIS Map Design Competition.

Several MSA graduates and “SA8905 alumni” have become part of what I call the Toronto School of Mapping, a loosely defined group of part-time mappers who use open data to create thematic maps for issues of public interest and distribute them via social media, whether as individual map images or as illustrations within write-ups such as blog posts. The blog by Jonathan Critchley at http://jonathancritchley.ca/ includes the three dot density maps from his Fall 2011 map poster, along with examples of his later work. Of note, Jonathan teaches our department’s Web Mapping course since he graduated!

Another former student, William Davis, became Data Analyst and Online Cartographer with the Toronto Star, Visual Journalist for Dow Jones Media, and finally Infographic Designer for Sun Life Financial. His personal blog, http://www.formerspatial.com/, contains numerous examples of his work, primarily interactive maps published in support of Toronto Star articles or on his own initiative. William also collaborates with another MSA graduate, Tom Weatherburn, on the award-winning mapping collective mapTO at http://www.mapto.ca/.

William Davis and yet another former SA8905 student, Michael Markieta, were the first exhibitors in the Student Gallery of the Ryerson Image Centre, who were neither photographers nor Image Arts students. Their three-week show “Geographies of Urban Form” in October/November 2015 abstracted the structure of global cities through skeletal maps of their road networks using OpenStreetMap data.

Two other SA8905 alumni, Sean Marshall and Igor Dragovic, maintain active blogs in which they utilize their cartographic skills to support in-depth analyses of urban issues (https://seanmarshall.ca/) and trends in real estate (https://idragovic.wordpress.com/), respectively.

Some of the interactive maps by William Davis and others, as well as the pursuit of cartography as an art form by Davis+Markieta, are echoed in a second major course assignment introduced to SA8905 in Fall 2013 as a “Mini Research Paper” and then in Fall 2015 reconfigured as the “Geovisualization Project”. While the idea behind the research paper was to improve the students’ writing skills through a 2,000-3,000 word description of a web mapping or GIS automation project, the focus of the assignment quickly shifted from the write-up to a more in-depth technical experience. The geovis project expectations are to “develop a professional-quality geographic visualization product that uses novel mapping technology to present a topic of your interest”. This product, which can e.g. take the form of an online and/or animated map, digital or physical 3D model, or a story map, is accompanied by a tutorial published on https://spatial.blog.ryerson.ca/, in which the students provide enough information for others to be able to replicate the projects. The three grading criteria reflect whether the project is “cool, comprehensive, and compelling”.

The MSA curriculum structure has been consistent since the start of the program in Fall 2000 and due to resource constraints, our objective to add courses in topics such as programming and web mapping as well as the inclusion of advanced analytical software such as R and Tableau has been difficult to achieve. The SA8905 geovis project however provides each student with an opportunity to test their interest in, and develop or expand their skills with, one or more tools that are not formally taught in any MSA course. The following list of Fall 2019 geovis project topics states the technology in the project title or in parentheses; tools included Python, R, Tableau, CARTO, Mapbox, Esri Operations Dashboard, Esri Story Maps, ArcGIS Pro, and QGIS. This year, only one student created a physical (in contrast to digital) project; in other recent years, several students would select 3D printing, wood cutting, Raspberry Pi, or other “maker technologies” to create their final product. In addition to the geovis technology, students are also exposed to writing concise technical reports in the form of the tutorials created within Ryerson’s WordPress site.

The most noteworthy external recognition of an SA8905 geovis project assignment was for Melanie MacDonald’s “Geovisualizing ‘Informality’ – Using OpenStreetMap & Story Maps to tell the story of infrastructure in Kibera (Nairobi, Kenya)” (Fall 2017). As part of the project, Melanie led a one-week mapathon to add building footprints for an informal settlement in Nairobi, Kenya, to OpenStreetMap. She then created a story map (shown below and still available at https://ryerson.maps.arcgis.com/apps/MapTour/index.html?appid=a3bf9a5e2bd14fae85f07bf096cf25ae) to explain the background and mapping process. In addition, Melanie also created a line art print as a tangible project outcome “formalizing the informal”. At the 2018 meeting of the Canadian Cartographic Association (CCA), Melanie received the best student paper award for her presentation on this outstanding course project.

Melanie MacDonald’s “Geovisualizing Informality” project (Fall 2017)

The final submission of the geovis projects also includes a departmental or public presentation event. In 2015, the Department of Geography and Environmental Studies together with the Ryerson Library’s Geospatial Map and Data Centre organized a GIS Day event that included speakers and an exhibit with SA8905 geovis project displays. In 2016 and 2018, students presented their geovis projects at the user conferences of our industry partner Environics Analytics with an audience of some 500 data analysts and marketing professionals. In 2017 and 2019, projects were presented in the GIS lab to a departmental audience, including undergraduate students as prospective MSA applicants. Photos and tweets from four events are shown below.

For other awesome geovis project examples, I recommend searching the tutorials at https://spatial.blog.ryerson.ca/ for keywords such as: acrylic, hologram, Lego, Minecraft, table-top AR, translucent maps; food aid, parking, polar ice cap, street art, and street grid. Without prejudice, these were some of the most “cool” (unusual, innovative) and/or “compelling” (high-quality) projects that I remember ad-hoc. The “comprehensive” grading criterion, which represents the scope of the project and the student’s level of investment has been very high for all students. In other words, I have been amazed by the results of this assignment year after year. They have become a display of graduate student engagement, hands-on learning, and professional development for the MSA program well beyond the cartography and geovisualization course.

Canadian News Coverage of #elxn43 – The Good, the Bad, and the Ugly Maps

Much like many economic, social, health, crime, and environmental data sets, election results have an important geospatial component. For the 2019 federal election, Canada was divided into 338 electoral districts, each of which is represented by a member of parliament. Consequently, thematic maps – usually representing the “first-past-the-post” winning party – are a typical part of news media coverage of the 43rd election. The following examples were found in select Canadian media outlets on the morning after the election.

The Good

Canada’s vast geographic expanse makes it difficult to show the entire country in a map that preserves its internal shapes and sizes as much as possible. Kudos to the Toronto Star for publishing #elxn43 results on a map with a suitable, appealing projection.

Source: https://www.thestar.com/

From the source code it appears that the Star used the D3js Javascript library with an orthographic projection.

Source: https://projects.thestar.com/federal-election-2019-results/indexstar2.html

If you zoom to your local riding results, you may notice that this projection is not ideal for local areas. In the case of Toronto, the city is presented at an awkward angle due to the projection centre being located in the east-west centre of Canada, far to the west of Toronto. Since maps are primarily useful to examine general spatial patterns, not specific data points, I find that the properly presented overview map outweighs the issue with local zooming.

Source: https://projects.thestar.com/federal-election-2019-results/indexstar2.html

The Bad

All other outlets that I checked do not live up to the Star’s standard. According to the copyright statement on the map, the Globe and Mail used the Leaflet interactive mapping library with an OpenStreetMap base layer. The provincial breakdown of riding results is helpful to illustrate the increasing divisiveness of Canadian politics, yet the use of a Mercator map projection is not just unappealing but further emphasizes the size differences between small left-leaning city ridings and large right-leaning rural ridings.

Source: https://www.theglobeandmail.com/politics/election2019/results/

The Canadian Broadcasting Corporation (CBC) uses the US-based Mapbox “location data platform” with the same projection issue. A difference is that the Globe uses the actual riding boundaries including water bodies, while the CBC clipped the ridings at the shores – both approaches have their advantages and disadvantages.

Source: https://newsinteractives.cbc.ca/elections/federal/2019/results/

The Ugly

Maybe it’s just the way it is integrated in the National Post’s, Toronto Sun’s, and Huffington Post’s web sites that makes the Canadian Press’s #elxn43 results map “ugly”. When I loaded these newspaper pages, the map defaulted to full extent including all of Ellesmere Island in the most northern reaches of Nunavut. While we normally don’t want to cut off relevant geographic areas from a map, in this case it makes the entirety of the map all the more … ugly.

Source: https://nationalpost.com/category/news/politics/election-2019

Maps can be a “centre piece” not only during election time but for many important political discussions and decisions. The following tweet by Jean Tong and the Ontario Association of Geographic and Environmental Education sums it up nicely.

https://twitter.com/OAGEEOntarioGeo/status/1186603210305425414?s=20
Source: Tweet by Esri Canada employee Jean Tong retweetet with a comment by https://twitter.com/OAGEEOntarioGeo

As I am teaching two cartography courses this semester, I was compelled to take a critical look at published #elxn43 maps. Nevertheless, I appreciate the media’s efforts to visualize geospatial data and make them navigable for their readers. In interactive mapping, some cartographic guidelines become blurred. Maybe this critique will further stimulate improved map-making and underline the value of higher education and applied skills in the field of Geography.

Geographic Analysis Explained through Pokemon GO

Hello, pokemon trainers of the World! Today, I would like to explain Geographic Analysis using the ideas of the Pokemon GO game that you know only too well. I hope that you will return to the game with a good understanding of the geographic concepts and the geospatial technology behind it.

Safe for some serious cheating, you have to move around this thing called THE REAL WORLD with your location-enabled device in order to “catch’em all”. Smartphone producers make it really difficult to manipulate GPS location, because it is such a critical function of your device. So, unless you are truly close to that poke stop, you won’t be able to access its resources: free poke balls, razz berries, etc. In Geography, we often study the location of points-of-interest or services. For example, if you live or work close to a specific shopping mall or hospital, you are likely to use their services at one point or another. Or, if you are far away from a college or university and still choose to pursue higher education, you may have to move in order to be within reach of that institution.

To use a poke stop or gym, or to catch a pokemon, you do not need to be at their exact coordinate locations, but you need them to appear within your proximity circle as you move around. In Geographic Analysis, we often examine this “reach”, or catchment area, that is defined by proximity to locations of interest. For example, when a coffee chain looks to open a new store, Geographers will examine their competitors’ locations and surrounding neighbourhood profiles to determine whether there is a gap in coverage or whether there are catchment areas that include enough people of the right demographic to support an additional cafe. In Retail Geography, we call these areas “trade areas”. That’s why you can find clusters of Tim Horton’s, Second Cup, and/or Starbucks at major intersections where the geodemographics are favourable – yes, this is likely a Geospatial Analyst’s work! And that’s also why you can find clusters of poke stops in some of your favourite busy locations.

To support business decision-making, AKA “location intelligence”, Geographers use data on population, household incomes and employment, the movement of people, and the built environment. If you have ever “watched” pokevision.com for different locations, you will have noticed great variation in the pokemon spawn density and frequency. For example, in our screenshots below you can see tons of pokemon in downtown Toronto, but not a single one in an area of rural Ontario. Similarly, there are dozens of poke stops and several gyms within walking distance in the City but a lone poke stop in rural Ontario. The Pokemon GO vendor, Niantic, seems to be using geodemographics in determining where pokemon will spawn. They make it more likely for pokemon to spawn where there are “clients”: that is, yourselves, the trainers/players.

(a)IMG_0035 (b)IMG_0042 (c)IMG_0099

Fig. 1: poke stops locations and pokemon appearances in downtown Toronto (a, b), compared to rural Ontario (c)

Geographic space is a unique dimension that critically influences our lives and societies. The spatial distribution of people and things is something that Geographers are studying. Just like the spawning of pokemon in general, the appearance of the different types of pokemon is not randomly distributed either. For example, it has been shown that water-type pokemon are more likely to appear near water bodies. See all those Magicarps near the Toronto lakefront in the screenshot below? A few types of pokemon even seem restricted to one continent such as Tauros in North-America and won’t appear on another (e.g., Europe). The instructions by “Professor Willow” upon installation of the app actually refer to this regional distribution of pokemon. I also believe that the points-of-interest, such as buildings, that serve as poke stops, determine the pokemon type spawning near them. For example, the Ontario Power Building at College St. and University Ave. in Toronto regularly spawns an Elektrabuzz, as shown in the last screenshot below.

(a)IMG_0026 (b)pokemon_cluster-of-magicarps-at-lakefront (c)algorithmic-regulation_aka-pokemon-go

Fig.2: (a), “Professor Willow” explaining his interest in studying the regional distribution of pokemon (what a great-looking Geographer he is!); screenshots of pokevision.com with (a) Magicarps at the Toronto lakefront and (b) an Elektrabuzz near the Ontario Power Building

In Environmental Geography, we often analyze (non-pokemon) species distribution, which is also not random. The availability of suitable habitat is critical, just like for pokemon. In addition, spatial interactions between species are important – remember the food chain you learned about in school. I am not sure that different pokemon types interact with one another; maybe that could be the topic of your first course project, as you enter a Geography program at university?

The techniques that we use within Geographic Information Systems (GIS) include suitability mapping, distance and buffer analysis, and distance decay. Distance decay means that it is becoming less and less likely to encounter a species as you move away from suitable habitat. Or in the business field, it is becoming less and less likely that people will shop at a specific mall the further away they live from it. A buffer is an area of a specified distance around a point, line, or polygon, just like the proximity circle around your pokemon avatar. GIS software can determine if other features are within the buffer around a location. Instead of enabling access to poke stops or gyms around your avatar, Geographers would use buffer analysis to determine which residents have access to public transit, e.g. if they are within walking distance of 500m or 1km of a transit stop.

A final thought about how Pokemon GO has brought Geography to the headlines concerns important professional and societal challenges that Geographers can tackle. These range from map design and online map functionality to crowdsourcing of geospatial data, as well as the handling of big data, privacy concerns, and ultimately the control of people’s locations and movement. The now-defunct pokevision.com Web map used Esri online mapping technology, one of the world-leading vendors of GIS software and promoters of professional Geography. Another approach, which is used by pokemonradargo.com, has trainers (users) report/upload their pokemon sightings in real-time. This geospatial crowdsourcing comes with a host of issues around the accuracy of, and bias in, the crowdsourced data as well as the use of free labour. For example, poke stops were created by players of a previous location-based game called “Ingress” and are now used by Niantic in a for-profit venture – Pokemon GO! Finally, you have all read about the use and misuse of lure to attract people to poke stops at different times of day and night. The City of Toronto recently requested the removal of poke stops near the popular island ferry terminal for reasons of pedestrian control and safety. Imagine how businesses or government could in the future control our movement in real space with more advanced games.

I hope I was able to explain how Pokemon GO is representative of the much larger impact of Geography on our everyday lives and how Geographers prepare and make very important, long-term decisions in business and government on the basis of geospatial data analysis. Check out our BA in Geographic Analysis or MSA in Spatial Analysis programs to find out more and secure a meaningful and rewarding career in Geography. And good luck hunting and training more pokemon!

3D Printed Geographies – Techniques and Examples

As a follow-up to my post on “Geospatial Data Preparation for 3D Printed Geographies” (19 Sept 2015), I am providing an update on the different approaches that I have explored with my colleague Dr. Claire Oswald for our one-year RECODE grant entitled “A 3D elevation model of Toronto watersheds to promote citizen science in urban hydrology and water resources”. The tools that we have used to turn geospatial data into 3D prints include the program heightmap2stl; direct loading of a grey scale image into the Cura 3D modeling software; the QGIS plugin DEMto3D; the script shp2stl.js; and a workflow using Esri’s ArcScene for 3D extraction, saving in VRML format, and translating this file into STL format using the MeshLab software.

The starting point: GIS and heightmap2stl

Being a GIS specialist with limited knowledge of 3D graphics or computer-aided design, all of the techniques used to make geospatial data printable rely heavily on the work of others, and my understanding of the final steps of data conversion and 3D print preparation is somewhat limited. With this in mind, the first approach to convert geospatial data, specifically a digital elevation model, used Markus Fussenegger’s Java program heightmap2stl, which can be downloaded from http://www.thingiverse.com/thing:15276/#files and used according to detailed instructions on “Converting DEMs to STL files for 3D printing” by James Dittrich of the University of Oregon. The process from QGIS or ArcGIS project to greyscale map image to printable STL file was outlined in my previous post at http://gis.blog.ryerson.ca/2015/09/19/geospatial-data-preparation-for-3d-printed-geographies/.

Quicker and not dirtier: direct import into Cura

The use of the heightmap2stl program in a Windows environment requires a somewhat cumbersome process using the Windows command line and the resulting STL files seemed exceedingly large, although I did not systematically investigate this issue. I was therefore very pleased to discover accidentally that the Cura software, which I am using with my Lulzbot Taz 5 printer, is able to load greyscale images directly.

The following screenshot shows the available parameters after clicking “Load Model” and selecting an image file (e.g. PNG format, not an STL file). The parameters include the height of the model, height of a base to be created, model width and depth within the available printer hardware limits, the direction of interpreting greyscale values as height (lighter/darker is higher), and whether to smoothen the model surface.

ormdem_oakridges_east_74m-Cura-import-settings

The most ‘popular’ model created using this workflow is our regional watershed puzzle. The puzzle consists of a baseplate with a few small watersheds that drain directly into Lake Ontario along with a set of ten separately printed watersheds, which cover the jurisdiction of the Toronto and Region Conservation Authority (TRCA).

Controlling geographic scale: QGIS plugin DEMto3D

Both of the first two approaches have a significant limitation for 3D printing of geography in that they do not support controlling geographic scale. To keep track of scale and vertical exaggeration, one has to calculate these values on the basis of geographic extent, elevation differential, and model/printer parameters. This is where the neat QGIS plugin DEMto3D comes into play.

As can be seen in the following screenshot, DEMto3D allows us to determine a print extent from the current QGIS project or layer extents; set geographic scale in conjunction with the dimension of the 3D print; specify vertical exaggeration; and set the height at the base of the model to a geographic elevation. For example, the current setting of 0m would print elevations above sea level while a setting of 73m would print elevations of the Toronto region in relation to the surface level of Lake Ontario. One shortcoming of DEMto3D is that vertical exaggeration oddly is limited to a factor of 10, which we found not always sufficient to visualize regional topography.

dem2stl-settings_150k-scale_10-exagg_0-base_humber-watershed

Using DEMto3D, we recently printed our first multi-part geography, a two-piece model of the Oak Ridges Moraine that stretches over 200km in east-west direction to the north of the City of Toronto and contains the headwaters of streams running south towards Lake Ontario and north towards Lake Simcoe and the Georgian Bay. To increase the vertical exaggeration for this print from 10x to 25x, we simply rescaled the z dimension in the Cura 3D printing software after loading the STL file.

Another Shapefile converter: shp2stl

The DEMto3D plugin strictly requires true DEM data (as far as I have found so far), thus it would not convert a Shapefile with building heights for the Ryerson University campus and surrounding City of Toronto neighbourhoods, which I wanted to print. Additionally, the approach using a greyscale image of campus building heights and one of the first two approaches above also did not work, as the 3D buildings represented in the resulting STL files had triangulated walls.

In looking for a direct converter from Shapefile geometries to STL, I found Doug McCune’s shp2stl script at https://github.com/dougmccune/shp2stl and his extensive examples and explanations in a blog post on “Using shp2stl to Convert Maps to 3D Models“. This script runs within the NodeJS platform, which needs to be installed and understood – the workflow turned out to be a tad too complicated for a time-strapped Windows user. Although I managed to convert the Ryerson campus using shp2stl, I never  printed the resulting model due to another, unrelated challenge of being unable to add a base plate to the model (for my buildings to stand on!).

Getting those walls straight: ArcScene, VMRL, and Meshlab

Another surprise find, made just a few days ago, enabled the printing of my first city model from the City of Toronto’s 3D massing (building height) dataset. This approach uses a combination of Esri’s ArcScene and the MeshLab software. Within ArcScene, I could load the 3D massing Shapefile (after clipping/editing it down to an area around campus using QGIS), define vertical extrusion on the basis of the building heights (EleZ variable), and save the 3D scene in the VRML format as a *.wrl (“world”) file. Using MeshLab, the VRML file could then be imported and immediately exported in STL format for printing.

While this is the only approach included in this post that uses a commercial tool, ArcScene, it is likely that the reader can find alternative workflow based on free/open-source software to extrude Shapefile polygons and turn them into STL, whether or not this requires the intermediate step through the VRML format.

GIS Day 2015 at Ryerson – A Showcase of Geographic Information System Research and Applications

Ryerson students, faculty, staff, and the local community are invited to explore and celebrate Geographic Information Systems (GIS) research and applications. Keynote presentations will outline the pervasive use of geospatial data analysis and mapping in business, municipal government, and environmental applications. Research posters, software demos, and course projects will further illustrate the benefits of GIS across all sectors of society.

Date: Wednesday, November 18, 2015
Time: 1:00pm-5:00pm
Location: Library Building, 4th Floor, LIB-489 (enter at 350 Victoria Street, proceed to 2nd floor, and take elevators inside the library to 4th floor)

Tentative schedule:

  • 1:00 Soft kick-off, posters & demos
  • 1:25 Welcome
  • 1:30-2:00 Dr. Namrata Shrestha, Senior Landscape Ecologist, Toronto & Region Conservation Authority
  • 2:00-2:30 posters & demos
  • 2:30-3:00 Andrew Lyszkiewicz, Program Manager, Information & Technology Division, City of Toronto
  • 3:00-3:30 posters & demos
  • 3:30-4:00 Matthew Cole, Manager, Business Geomatics, and William Davis, Cartographer and Data Analyst, The Toronto Star
  • 4:00 GIS Day cake!
  • 5:00 End

GIS Day is a global event under the motto “Discovering the World through GIS”. It takes place during National Geographic’s Geography Awareness Week, which in 2015 is themed “Explore! The Power of Maps”, and aligns with the United Nations-supported International Map Year 2015-2016.

Event co-hosted by the Department of Geography & Environmental Studies and the Geospatial Map & Data Centre. Coffee/tea and snacks provided throughout the afternoon. Contact: Dr. Claus Rinner

Geospatial Data Preparation for 3D Printed Geographies

I am collaborating with my colleague Dr. Claire Oswald on a RECODE-funded social innovation project aimed at using “A 3D elevation model of Toronto watersheds to promote citizen science in urban hydrology and water resources”. Our tweets of the first prototypes printed at the Toronto Public Library have garnered quite a bit of interest – here’s how we did it!

claire-dem-tweet_Aug21claus-popdens-tweet_Aug22

The process from geography to 3D print model includes four steps:

  1. collect geospatial data
  2. process and map the data within a geographic information system (GIS)
  3. convert the map to a 3D print format
  4. verify the resulting model in the 3D printer software

So far, we made two test prints of very different data. One is a digital elevation model (DEM) of the Don River watershed, the other represents population density by Toronto Census tracts. A DEM for Southern Ontario created by the Geological Survey of Canada was downloaded from Natural Resources Canada’s GeoGratis open data site at http://geogratis.gc.ca/. It came in a spatial resolution of 30m x 30m grid cells and a vertical accuracy of 3m.

The Don River watershed boundary from the Ontario Ministry of Natural Resources was obtained via the Ontario Council of University Libraries’ geospatial portal, as shown in the following screenshot.

Download of watershed boundary file

The population density data and Census tract boundaries from Statistics Canada were obtained via Ryerson University’s Geospatial Map and Data Centre at http://library.ryerson.ca/gmdc/ (limited to research and teaching purposes).

The Don River watershed DEM print was prepared in the ArcGIS software by clipping the DEM to the Don River watershed boundary selected from the quaternary watershed boundaries. The Don River DEM was visualized in several ways, including the “flat” greyscale map with shades stretched between actual minimum and maximum values, which is needed for conversion to 3D print format, as well as the more illustrative “hillshade” technique with semi-transparent land-use overlay (not further used in our 3D project).

DEM of Don River watershedHillshade of Don River valley at Thorncliffe Park

The population density print was prepared in the free, open-source QGIS software. A choropleth map with a greyscale symbology was created, so that the lighter shades represented the larger population density values (yes, this is against cartographic design principles but needed here). A quantile classification with seven manually rounded class breaks was used, and the first class reserved for zero population density values (Census tracts without residential population).

qgis-3D-popdens-project

In QGIS’ print composer, the map was completed with a black background, a legend, and a data source statement. The additional elements were kept in dark grey so that they would be only slightly raised over the black/lowest areas in the 3D print.

qgis-3D-popdens-composer

The key step of converting the greyscale maps from the GIS projects to 3D print-compliant STL file format was performed using a script called “heightmap2stl.jar” created by Markus Fussenegger. The script was downloaded from http://www.thingiverse.com/thing:15276/#files, and used with the help of instructions written by James Dittrich of the University of Oregon, posted at http://adv-geo-research.blogspot.ca/2013/10/converting-dems-to-stl-files-for-3d.html. Here is a sample run with zero base height and a value of 100 for the vertical extent.

Command for PNG to STL conversion

The final step of pre-print processing involves loading the STL file into the 3D printer’s proprietary software to prepare the print file and check parameters such as validity of the structure, print resolution, fill options for hollow parts, and overall print duration. At the Toronto Public Library, 3D print sessions are limited to two hours. The following screenshot shows the Don River DEM in the MakerBot Replicator 2 software, corresponding to the printer used in the Library. Note that the model shown was too large to be printed in two hours and had to be reduced below the maximum printer dimensions.

Don River watershed model in 3D printing software

The following photo by Claire Oswald shows how the MakerBot Replicator 2 in the Toronto Reference Library’s digital innovation hub prints layer upon layer of the PLA plastic filament for the DEM surface and the standard hexagonal fill of cavities.

DEM in printing process - photo by C. Oswald

The final products of our initial 3D print experiments have dimensions of approximately 10-20cm. They have made the rounds among curious-to-enthusiastic students and colleagues. We are in the process of improving model quality, developing additional models, and planning for their use in environmental education and public outreach.

The printed Don River watershed model

3D-printed Toronto population density map

Looking for a secure, laid-back, and meaningful job in a growing field? Get into Geography!

This text was first posted as a guest contribution to WhyRyerson?, the Undergraduate Admissions and Recruitment blog at Ryerson University. Images were added after the initial posting.

Geography@Ryerson is different. Atlases, globes, and Google Maps are nice pastimes, but we are more interested in OpenStreetMap, CartoDB, and GeoDA. We map global flight paths, tweets, invasive species, and shoplifters. As a student in Geographic Analysis you will gain real-world, or rather real-work, experience during your studies. This degree is unique among Geo programs in Ontario, if not in Canada, for its career focus.

thestar-24May2013_rye-student-flight-paths

Mapping global flight paths.
(Source: Toronto Star, 24 May 2013
)

The BA in Geographic Analysis has a 40-year record of placing graduates in planning and decision-making jobs across the public and private sectors. Jobs include Data Technician, Geographic Information Systems (GIS) Specialist, Geospatial Analyst, Mapping Technologist, GIS Consultant, Environmental Analyst, Market Research Analyst, Real-Estate Analyst, Crime Analyst, and many more. You name the industry or government branch, we’ll tell you what Geographers are doing for them. And these jobs are secure: Many are within government, or, if they are in the private sector, they tend to be in units that make businesses more efficient (and therefore are essential themselves!).

And these are great jobs, too. In November 2013, GIS Specialists were characterized as a low-stress job by CNN Money/PayScale. There were half a million positions in the US, with an expected 22% growth over 10 years, and a median pay of US$53,400 per year. In their previous survey, Market Research Analysts had made the top-10, with over a quarter million jobs, over 40% expected growth, and a median pay of US$63,100. The 2010 survey described GIS Analyst as a stress-free job with a median salary of US$75,000.

cdnbusiness-23April2015_best-jobs-mapping-tech

Mapping Technologist, one of Canada’s best jobs!
(Source: Canadian Business, 23 April 2015)

Closer to home, in April 2015 Canadian Business magazine put Mapping Technologists among the top-10 of all jobs in Canada! They note that “The explosion of big data and the growing need for location-aware hardware and software has led to a boom in the field of mapping”. With a median salary of CA$68,640, a 25% salary growth, and a 20% increase in jobs over five years, “this class of technology workers will pave the way”. According to Service Canada, “Mapping and related technologists and technicians gather, analyze, interpret and use geospatial information for applications in natural resources, geology, environment and land use planning. […] They are employed by all levels of government, the armed forces, utilities, mapping, computer software, forestry, architectural, engineering and consulting firms”. Based on the excellent reputation of our program in the Toronto area, you can add the many jobs in the business, real-estate, social, health, and safety fields to this list!

google-img-search_gis-application-examples

Sample applications of Geographic Analysis
(Source: Google image search)

While you may find the perspective of a well-paid, laid-back job in a growing field attractive enough, there is more to being a Ryerson-trained Geographer. Your work will help make important decisions in society. This could be with the City of Toronto or a Provincial or Federal ministry, where you turn geospatial data into maps and decision support tools in fields such as environmental assessment, social policy, parks and forestry, waste management, immigration, crime prevention, natural resources management, utilities, transportation, … . Or, you may find yourself analysing socio-economic data and crime incidents for a regional police service in order to guide their enforcement officers, as well as crime prevention and community outreach activities. Many of our graduates work for major retail or real-estate companies determining the best branch locations, efficient delivery of products and services, or mapping and forecasting population and competitors. Or you could turn your expertise into a highly profitable free-lance GIS and mapping consultancy.

Geography is one of the broadest fields of study out there, which can be intimidating. Geography@Ryerson however is different, as we provide you with a “toolkit” to turn your interest in the City, the region, and the world, and your fascination with people and the environment, into a fulfilling, secure, laid-back, yet meaningful job!