Robojane

A Python and CGA pipeline to mass produce zoning.

 

Robojane is a pipeline for CityEngine written in Python and CGA. The pipeline automates generating all the zoning options for a given parcel in any city.


Project Specs:

Duration: 6 months

Development Stage: In Production

Tools:

  • Python

  • CityEngine

  • CGA


Deliverables

  • 3D Multipatch

  • Code Base


Roles

  • Python and CGA Developer

Overview

I had solved the problem of representing a city's zoning code using CGA in CityEngine, but a problem remained. As we started translating multiple cities with multiple zoning districts, the ability to automate the generation of all possible solutions within a zoning district became difficult. Manual variations using CityEngine UI were cumbersome and error-prone. I designed and coded a Python pipeline to consume the zoning translations produced by Vivacity's zoning translator. The pipeline ingests a JSON, applies the values to a collection of parcels, manipulates extra variables depending on conditions, and outputs a 3D multipatch with all the information generated on the scene. We called this script Robojane in honor of Jane Jacobs.


Problems

1. Vivacity needed a method to automate producing zoning for millions of parcels.

2. The old method of generating zoning using CityEngine's UI was vulnerable to human error..

Solution

1. I built a script that interpreted standardized zoning and applied the values to each parcel in CityEngine

2. The script automated the selection, application, generation, and output of a 3D Multipatch.

 

Research & Development

 

Before building the pipeline, I double-checked that the JSON we were generating on the Zoning Translator aligned with a new version of the CGA code that programmatically generated the 3D geometries for the zoning envelope. A code review of the original CGA code revealed that specific steps could be simplified, and new advances in WebGL and 3D GIS web APIs allowed for simple geometries. This research led me to refactor the CGA code before writing the Python pipeline. For example, since the new zoning translator had clear conditions, we no longer needed the Python pipeline and CGA to do matrix calculations of all the solutions for the zoning area.

Make it stand out

It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more. Or maybe you have a creative project to share with the world. Whatever it is, the way you tell your story online can make all the difference.

Standardizing zoning in Python and CGA.

The Python and CGA pipeline had to be generic enough to handle any city’s zoning code.

CGA in City Engine was refactored to accommodate generalities.

I developed the original codebase with one city in mind: NYC.

Robojane takes care of manually changing all variables and exporting.

Scaling Tests

To understand the total capacity of Robojane, we conducted some tests to see how Robojane could scale. We found issues around memory leakage after a certain number of parcels are selected and graphic card limitations when exporting large geometries.

Code Base

I wrote the code base in Python for CityEngine and CGA. The original CGA code, built around an NYC zoning template, was refactored to handle a general understanding of zoning in the US. The 3D geometry attributes also had to follow a generic schema for data meant to be in production. Robojane generates 3D zoning envelopes programmatically and checks before outputting the 3D geometries for compliance with the Vivacity data schema.


 

A view of the full Robojane Pipeline.

 

Summary

 

Vivacity needed an automated method to produce zoning envelopes in 3D for production. I built Robojane as a solution to this problem.

Lessons

1. I learned that refactoring could lead to better code writing and optimization.

2. Since the pipeline takes extra time when handling large cities, I built a time estimate for completion inside the Python interpreter of CityEngine