Report Generation

Another of our most frequently requested features is the ability to generate summary reports. The tools we are creating already make urban planning related datasets instantly accessible in standardized formats, reducing time searching for datasets spread across various local municipal and provincial websites. The current data in some cases is only available as difficult to interpret PDFs, slow and limited web maps, and web based tables. We know that having the various datasets in one location, in a geospatial format where they can be overlaid in a map and quickly compared and queried provides valuable and new insights to our users. However, due to the collaborative nature of the industry and planning process, we recognize the value in being able to easily summarize, export and share with colleagues.

Over the past few months we have been building a reporting service to allow our users to instantly summarize outputs, save to PDF or directly print directly from the browser. We are excited to announce that you can now generate reports for printing and saving to PDF for the following tools:

RATIO.CITY - Dev Policy.png

Planning Policy Summary:

Single page report providing an instant summary of all policy layers intersecting a site, including two maps of Zoning By-Law Categories and Official Plan Land Use Layers.

RATIO.CITY - Dev Potential.png

Development Potential:

Multi-page report providing an instant summary of site analysis and built form evaluation, including a customizable view of the 3D Massing Model, list of parcels in land assembly, total site area, GCA, GFA, NSA, density. A second page records the assumptions and inputs (setbacks, angular planes) and provides a detailed floor by floor breakdown of areas.

RATIO.CITY - sample sun shadow.png

Shadow Studies:

Multi-page report based on Development Potential 3D Massing Model, with built in checks if net new shadows intersect with over 2,000 public green areas within the City of Toronto, a summary map of the shadow spread for all hours, and 8-10 hourly maps (depending on month), displaying hour by hour shadow spread, neighbourhood shadows and net new shadows.


The technical nuts and bolts:

Based on the recommendation and demonstration of its ability to print Mapbox GL maps by the team at New York Planning Labs (https://planninglabs.nyc), we are using Paper.CSS (https://github.com/cognitom/paper-css) to design and layout reports for the user to review directly in the website front-end and adjust map views before generating a PDF or directly printing. 

A benefit of this system is that we are using the browsers built in ‘Print’ feature to instantly allow users to export reports, without requiring sending information back to a backend server. Modern browsers on PC and Mac allow users to export to PDF through their Print feature, in the case of Chrome and Safari we are able to also maintain URL links to policy documents in the exported PDFs (unfortunately Firefox does not maintain links). 

Shadow report generation was one feature however that has presented an interesting challenge that we have had fun exploring and resolving. With shadow reports we want to ensure that we are clearly communicating net new shadows for each hour, requiring up to 10 individual maps per report, so that each potential shadow spread and net new shadow per hour can be viewed and assessed individually. While we include interactive maps for the Policy Summary and Development Potential reports page, 10 Mapbox GL maps is simply too much for a modern computer to render all at the same time. We could require the user to manually load each hours layers then manually print, however we want to get our users to answers as quickly and efficiently as possible. Fortunately, we have devised a system to generate images from a Mapbox GL map, triggered by a combination of events returned by the Mapbox GL API, allowing us to consistently capture images of maps containing specific layers, and display images of as many maps in a report as necessary. 

With shadow reports we use an interactive 'All Hours’ map that contains the hourly massing shadow spread to act as controls for the user to position the map over the area that they want to generate additional hourly maps for. Once a map has been positioned, clicking the 'Generate Neighbourhood Shadows' button makes requests for 10 neighbourhood shadows and 10 net new shadows to our backend server. The challenge then is with 20 responses of neighbourhood shadows and net new shadows geometries, we need to ensure that we are able to consistently generate 10 individual maps, each map with 3 different layers loaded depending on the time that the map is being generated for. Each of the images we generate consists of 3 unique layers corresponding to the hour the image is being produced for: 

  • Hourly Development Potential Massing Model

  • Neighbourhood shadows (shadows generated by neighbouring buildings)

  • Net new (colour coded based on if existing shadow (black), net new shadow (blue) or net new shadow intersecting with a park (red))

In the frontend, users view a progress bar during this process letting them know the progress of data downloads and image generation. Behind the scenes, map layers are being loaded into a Mapbox GL map formatted to the size of the final image, the 3 layers corresponding to a time are loaded, which then requires us to wait for them to be completely loaded and rendered by the Mapbox GL API triggering API events that allow us to trigger image creation and saving, then move on to the next hour, loading map layers, ensuring all map layers are loaded and rendered, generate and save an image and move on to the next, etc. 

While these reports are extremely valuable additions to the Ratio.City platform, we are also excited for what we can do with our print service going forward. At the same time we are providing users with access to data to view and interact with in the Ratio.City website, we also provide the ability to create sharable URLs that load saved Development Potential 3D Massing Models for anyone regardless of having an account, and now the ability to instantly generate single or multi-page reports at any time including high quality images of maps, and going forward other forms of data visualizations that can be saved to PDF or printed.