Colorize the buildings and roofs from its attributes.

6233
17
03-24-2015 12:46 AM
RushikeshPadsala
New Contributor II

Hi there. I have a gdb which contains, Multipatch LOD2 Buildings (in 3D), I have roof surfaces, trees, water and terrain. I want to colorize the Buildings and the roofs with the attributes stored inside it. For buildings, I want to colorize according to building type (Residential, Office etc). The field for landuse type is Land_Type. Similarly I want to color roofs, but all with the same color lets say light brown. Nothing needs to be extruded as everything is already in 3D. Please help me to write the rules, or any examples which has the similar rules. I am completely new to CityEngine. Please help. I use city engine 2014.1.

Thank You.

0 Kudos
17 Replies
by Anonymous User
Not applicable

Open a new rule file, and put this under the line with version:

attr Land_Type = ""   # This will connect to your object attribute from the GDB.

Shape --> # This is the start of a rule.

     color(getColorByLandUse(Land_Type) # This calls the function below using your attribute.

# Expand this function using your land types, with colors in "hex color" format:

getColorByLandUse(landType) =

     case landType == "Residential" : "#ff00ff"

     case landType == "Office" : "#0000ff"

     else: "#000000"

RushikeshPadsala
New Contributor II

Hi Chris Wilkins

That is really helpful. I have got two more queries if you could help me out.

1. I have a attribute field of Building Heights (Bldg_Ht) and I want to colorize it using color ramp. Is it possible in City Engine. Can you help me with an example of a rule with any random color ramp.

2. Is it possible to have a legend or any such alternative by which the person viewing this 3D scene will be able to know that this color belongs to what??? (Eg. if Residential are colored as red, then in legends, I should have a box with red color and a text saying as Residential).

Again please note that I dont have to extrude any building or any objects as I am importing everything in Multipatch 3D (LOD 2 Bldg Models) in GDB from ArcGIS.

Thank You 🙂

0 Kudos
MatthiasBuehler
Occasional Contributor III

Hi,

1] Yes, you can colorize with ramps in CGA. See here:

colorRamp

2] Legends:

Legends are not directly possible in CGA.

But I have developed custom python scripts for ourselves and a client that do exactly that. If you're interested in such a service, let me know.

--> Garsdale Design Limited

Matt

Interested in CityEngine training or services? Contact me!

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

------------------------------------

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
RushikeshPadsala
New Contributor II

Hi Matthias Buehler

Thank You for your reply and help. Ya I would like to know about the python script or any other alternative as I am a student and would like to learn it so as to include in my small test project.

Do help me

Thanx

0 Kudos
RushikeshPadsala
New Contributor II

Now I have a raster urban heat island layer which I analysed in ArcScene and I have brought into City Engine. No without legends I cannot share it within my university as no one will understand which color means what. I need to create legends in city engine. Please help if there is any way out or any alternatives for this.

Urgent Help!!!!

Thanx

0 Kudos
MatthiasBuehler
Occasional Contributor III

Hi,

the easiest way to create a legend is just to create a picture in e.g. PhotoShop and place it in the scene, as a map layer of the type 'texture' (see docs).

Ok?

m.

Interested in CityEngine training or Services? Contact me!

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

---------------------------------------

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
RushikeshPadsala
New Contributor II

Hi,

Thank You for your quick reply, I could have done that if I had one layer, i have 7 layers each showing a different theme, for example one layer is showing building colorized by its building types, second one is showing building colorized by its year of construction and so on. I would like to have legends of all seven layers and to create it with photoshop and then put 7 more layers, wont solve the problem.

Need your views on this

Rushi

0 Kudos
MatthiasBuehler
Occasional Contributor III

Well, there is just no default functionality for legends in CityEngine.

It seems you're best off creating one picture with all data of all seven layers.

To have it more dynamic, you need to dive into Python scripting. Sorry.

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-------------------------------------

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
by Anonymous User
Not applicable

Can you not put the seven legends on the seven layers?

0 Kudos