Monday, April 7, 2014

More 3D Maps and Tips Using QGIS2threejs

After last week's popular post, here are few more maps and tips using the QGIS2threejs plugin.

The Maps
  1. 3D Chloropleth Map of Crime Counts by Police Beats in Chicago, 2013
  2. Visualization of Mt. Rainier, Seattle
  3. Groundwater Depths in Three Counties in Nevada
Data sources and references:
Open Data Chicago
Chicago: Official Police Maps (CLEARMAP)
National Map Viewer
Nevada Bureau of Mines and Geology

When viewing the maps, if a black box appears instead of a basemap, try refreshing/reloading your browser and the basemap should display properly.

The Tips

3D Chloropleth Map:  Here is a trick to create a 3D chloropleth map on a flat surface.  The plugin won't run without a digital elevation model (or DEM) raster, but you can 'trick' it into using a flat raster.
  • Updated(12/9/2015): The plugin now allows users to select a flat surface/no DEM used
  • Take the raster calculator and exponentiate/raise all cell values to the power of 0 (rastervariable^0). The resulting raster will be flat with a value of 1.  Alternatively, multiply by zero.  (You may also have to symbolize null values as well.)
  • Classify and symbolize the polygons using your desired color scheme--before using the plugin
  • In addition, I changed the color of the raster file in QGIS to match the background in the *.html file (#ccccff). 
  • I added HTML code for a basic legend using frames (90% for the map, 10% for the legend)
Basic HTML code sourcing the two frames.  The "Chicago" frame was generated from QGIS.
The "Legend" frame was a simple piece of code directed to a JPG of the Legend.
Screenshot of the final map and legend.
Mt Rainier:  Instead of using a web service, I download imagery and used the Build Virtual Raster in QGIS.   I used a detailed DEM and imagery from the USGS's National Map Viewer.  You can download files from USGS by using a bounding box, for example.  I used a vertical exaggeration of 1.1 in the plugin.  Click the screenshot below to enlarge a comparison of between Google Earth and the plugin's version of Mt. Rainier.
Left: Google Earth, Right: Plugin result using files from USGS

3D Groundwater Depths / Underground:  Using point data with depths, you can either select a negative multiplier in the plugin or create a new variable and multiply your depths by -1.

If your depths are positive values, select a negative multiplier in the plugin.
An overhead and underground view of the map.
The orange boundary represents three counties of interest.

1 comment: