Using satellite imagery as roof textures in CityEngine
Before we start the code I used here came from a GIS mapping tutorial from CityEngine, I can’t seem to find the original page after them being merged with ESRI but you can see a cached copy of the page here.
First let us get some satellite imagery, I suggest you use an extract from an existing satellite imagery from your GIS. If you are taking the imagery from elsewhere you don’t need to follow all these steps…
- In ArcGIS — Draw a box using the Draw toolbar

- In ArcGIS – Select the underlying imagery in the Table of Contents right-click and select “Data –> Export Data”. Depending on what your are doing and the size of imagery you want you may want to use JPG and the settings below have worked for me. I suggest you experiment for the best results. I also suggest you export straight to the maps directory in your CityEngine project

- In CityEngine — Drag and drop from your maps directory into your CityEngine scene, it should come in under any data you already have. If it doesn’t check that in the Scene window the map layer does not have the eye crossed out also ensure that the show/hide map layers button is clicked.

- In CityEngine – Create a new rule file and copy this code in (be sure to change the relevant parts to your settings).
# dimension of the satellite map const mapdimension_x = 1134.181 #change this to satellite image details const mapdimension_z = 939.650 #change this to satellite image details # offset of the satellite map const mapoffset_x = 597694.521 #change this to satellite image details const mapoffset_z = -3560369.907 #change this to satellite image details Lot--> extrude(rand(3,15)) Mass Mass --> # split building mass into roof and side faces comp(f){top : Roof | side : Facade} Roof --> Rooftex Rooftex --> setupProjection(0, world.xz, mapdimension_x, mapdimension_z) set(material.colormap, "maps/SATELLITEIMAGENAME.jpg") #change this projectUV(0) translateUV(0, -mapoffset_x/mapdimension_x, -mapoffset_z/mapdimension_z) scaleUV(0,1,-1) - In CityEngine – To get the x-size and x-offset numbers select the map layer in the Scene window (default location bottom left) and look at the Layer tab in the Inspector window (default right), copy these numbers to the const variables at the beginning of the rule file.

- In CityEngine – Now apply that rule (after changes to your shapes/lots) and generate your model!

Thunderbird is a no go… Folder Pane empty – Solved! – Corrupt folderTree.json
Okay a specific post for those who use Thunderbird as an email client. Basically I had some issues with my brand new PC where it BSOD (Blue Screen Of Death) almost immediately (turned out to be a loose fan in the tower!). Upon fixing the PC I could open Thunderbird but not see any folders in the Folder Pane on the left.
So here’s the solution (I used the error console in Thunderbird to search for a possible solution):
- Navigate in Windows to the your Thunderbird profile folder (e.g. “C:\Users\YOURUSERNAME\AppData\Roaming\Thunderbird\Profiles\SOMETHINGHERE.default)
- Find the file “folderTree.json” back it up first and then delete it (or just rename it OLDfolderTree.json)
- Now load up Thunderbird, your problem should have been fixed (it seems to create a new file)!
SOURCES (this conservation helped me) : https://bugzilla.mozilla.org/show_bug.cgi?id=707329
ArcGIS and CityEngine : careful when you smooth!
Interesting issue I’ve come across going back and forth from CityEngine to ArcGIS. Importing a file geodatabase (GDB) CityEngine doesn’t see my results from smoothing edits.
- Draw a feature in ArcGIS in a File Geodatabase (GDB), then run the smooth tool on the Advanced Editing toolbar.
- Import the File GeoDatabase into CityEngine (when doing an import it seems you have to click back and then forward to refresh the GDB contents…).
- Now look at the same feature in CityEngine, it’s not straight is it?
- So export the feature as a shapefile instead and import into CityEngine, the feature retains its smoothness.
Not sure whether its a bug or my misunderstanding of a feature… I guess a smooth is described in a GDB rather than drawn, whereas shapefiles just draw the feature via vertices. Either way it’s a good example of knowing the limitations of your file formats!
ArcGIS – CityEngine – SketchUp – Lumion3D – A workflow
I’m quite partial to a good workflow, so here’s the result of one I’ve posted on GeoPlanIT’s YouTube channel:
Lumion3D is a great rendering/visualisation tool I hope to be using much more in the future. It might not give you full control over everything but if you want quick and easy renderings of your models it’s brilliant. A word of caution though, you might want to upgrade your graphics card… (or like me your entire PC). You can download a free (limited feature) trial now from here.



