Monday, October 28, 2013

Serving a large 3D City Basemap

Urban data normally arrive from different sources. The challenge is to put them together in order to create an accurate representation of the city.

In the case study that I have been working on the challenge was to share a 3D representation of an entire city among users.

I have done a number of projects with CityEngine and considered using the 3D webscenes for this, however I found a couple of limitations:
  • CityEngine uses Python scripting to import cities with a diameter of about 13km. The city in this case study has a diameter of more than 40km.
  • The final compressed webscene (.3ws) has to be downloaded before being viewed. Best practice limits this file to 30 MB
I eventually (after a lot of research and blog reading) decided to try and host my 3D Basemap on ArcGIS Server as a Globe Service

The Workflow:

The data consisted of 3 types of building features:

  1. Photo-realistic multipatch features of buildings

  2. Digitized 2D building footprints

  3. 2D cadastral properties

Step 1: Converting the .3ds building files to multipatches is a whole blog post on its own. I will explain this in a bit more detail later. (Hint: The Import 3D files tool + Blood Sweat and Tears). As the focus of this blog is hosting a city on ArcGIS for Server, just know that the textured buildings were finally converted to multipatch features. It is also importatnt to know that the Buildings were set to their correct z-values during the conversion process. 

Step 2: The 2D Building footprints were provided with the correct z-values through the Interpolate Shape tool. The footprints were then extruded to their height attributes in ArcScene and converted to multipatches by using the  Layer 3D to Feature Class tool. 

Step3: At this point the remaining areas of the city had still had to be represented by building footprints. Due to the lack of data, generic "fictional" footprints had to be generated in order to flood the rest of the urban area.

To generate these footprints I used CityEngine. The 2D cadastral data first had to be divided into 7 regions (due to the fact that the total area of the city is too large for CE).

The properties contained attributes describing its zoning characteristics as well as restrictions. Using these attributes as  guide lines for building shapes (L-shape, O-shape and U-shape) and heights, buildings could be generated procedurally in CityEngine. The procedural rule was based (and borrowed from) on the rules found in Tutorial 8: Mass Modeling at the CityEngine Resource Center.

The result was 7 regions of procedurally generated  (fictional) buildings ( +800 000). 




The buildings were then combined before merging with the "real" digitized building footprints.

Green = Digitized footprints      Red = Procedural footprints    Pink = Photo-Realistic buildings
Step 4:  The final step was to add each of the multipatches (textured as well as extruded footprints) to ArcGlobe. I decided to create 2 globe service. The first one would show the Textured buildings and the second one would be the footprints.

Publishing a globe service was much easier than I anticipated. Once the multipatches are added to ArcGlobe simply remove all elevation and image layers (the standard ArcGlobe layers); click on File > Share As... > Service... Next fill in the relevant information in the Service Editor > Analyze and Publish your globe service.

Once the Service Publishing Result has popped up, you can open a new ArcGlobe and access the data straight from your ArcGIS Server.




The final result is two Globe services which is hosted locally and can be shared to other users, thereby creating a online 3D Basemap of the City.

City globe services

Monday, October 14, 2013

Welcome to Cape Town

I went to Cape Town last week to do some CityEngine demonstrations. So I decided that the best way to show the abilities of CityEngine is to create a quick WebScene of Table Mountain and its surroundings...

I started by importing (dragging and dropping really) a TIFF image for the Cape Town CBD area into the scene. I used a standard JPEG aerial image as the Layer texture.

  
To start with, I had some building footprint data, but not a lot. Luckily I had the entire set op parcel properties for the area. I decided to use the real building footprints where possible and fill in the rest by creating procedural buildings from the properties layer.

The building footprints did not have a height attribute, instead it had a Floor Level (FLR_LVL) attribute. I proceeded to create a procedural rule which assigns a Height attribute based on the Floor Level attribute. If a feature had 0 as a value for floor level, the rule assigns a random value between 2.1 meters and 2.4 meters to Height. If the feature has a valid floor level value, the floor level is multiplied by a random value between 2.1 and 2,4 meters and assigned to Height.

Finally the rule extrudes the feature according to Height and colors the building light grey.



The next phase was to flood the existing open spaces with  procedural buildings.
The first step of this phase was to create an offset distance for the each building from the street. The offset was set to between 5% and 25% of the property's longest side.


Two additional attributes are defined, namely Minimum_Height (5) and Maximum_Height (50). The maximum height had to be reduced from 130 meters to 50 meters after my love of skyscrapers created a city skyline resembling a pincushion... 

The property features are then divided equally and assigned a shape and finally extruded to a random value between the minimum and maximum heights.
25 % of the features generated a U - Shaped building;
25% generated O-Shaped buildings
25% generated L-Shaped buildings
and the remaining 25% kept the original feature's
shape.



 The second to last step was to add the additional city-features such as Parks, Rivers, Railway and the Ocean. The water features were given the '__water' suffix to create realistic water textures when exported to a web scene.

The final part of the scene was to add a Sketch Up model of Cape Town stadium.



The outcome was a simple representation of the city without spending too much time on building generation. By coloring the buildings grey (instead of detailed textures), the differences between built-up areas and vegetation in the city becomes clear.