City Engine and Network Analyst

2806
7
Jump to solution
09-11-2014 04:36 AM
IonutAlixandroae
Occasional Contributor

Hello,

I have a question: can I use symbology ( like in ArcMap) -> graduated colors for some routes in City Engine?

Actually, I need to represent some parts of some routes with a color depending on their attributes.

Also, I need more information about using network analyst in CE?

Thanks !

0 Kudos
1 Solution

Accepted Solutions
MatthiasBuehler
Regular Contributor

attr congestion = 0

Sidewalk -->

     Street

Street-->

     case congestion >= 6:

          color(0,1,0)

     case congestion >= 3:

          color(1,1,0)

     else:

          color(1,0,0)

NOTES:

-----------

  • don't use string (""), use float (0) when initializing the attr
  • check the name (case sensitivity) of the attr
  • check the attr souce in the Inspector's attr source editor (point to the object attr)
  • Use more StartRules that point to the 'Street' rule

Ok ?

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

+44 (0) 15396 20875
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

View solution in original post

7 Replies
MatthiasBuehler
Regular Contributor

Hi,

What is the data you are trying to represent in colors?

CityEngine can not run network analyst. For this, you'd have to export the street segments as polyline features to ArcGIS, then do the network analysis there. Note that the current graph exporter only supports linear street center lines, not curved ones.

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

+44 (0) 15396 20875
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
IonutAlixandroae
Occasional Contributor

HI,

I saw this : CityEngine Feature: Street Sketching & Network Analysis - YouTube and I want to know how are those streets in multipe colors?

I have some streets and in the attribute table there is a field that represent the congestion . I want to represent them in gradient colors ( like in the picture I attached from ArcMap).

streets.jpg

It is possible to use in CE that specific attribute field to practically simbolize my streets with different colors?

Thanks !!

0 Kudos
MatthiasBuehler
Regular Contributor

Hi again,

Yes, the network analysis within CityEngine is a cool thing. The tool calculates the 'integration' value and stores this information as object attributes, then assigns the a rule that does that color-coding.

If you have GIS data, the workflow would be very similar: When you import GIS data (streets) with attributes, the GIS attributes are also imported and inherited to the dynamic street shapes.

You then can create a rule to colorize each shape based on your attribute.

I assume you don't have a lot experience in CGA yet, right ?

Hope this helped a bit so far ?

Cheers !

Matt

  

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

+44 (0) 15396 20875
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
IonutAlixandroae
Occasional Contributor

Hi,

Yes, you`re right. I only managed to create a few buildings and houses on my own imaginations and with some textures from the city I wanted to look alike.

So, that field has numeric values , and I`m thinking of creating a rule where I should involve 3 colors and depending of that congestion values is bigger that "a-value" or smaller than "a-value" it will get a color. And this rule will apply again for one of the 3 colors right?

e.g. - red is for value between 1-3

     blue for value between 4-6

     green for value between 6-10

Am I right?

Thanks!

0 Kudos
IonutAlixandroae
Occasional Contributor

So I decided that I want to color my routes with 3 colors : green, yellow and red depending of the value of congestion. The field type is double

So here is something I tried but I keep getting errors:

# color declarations

red = "#ffaaaa"

green = "#aaffaa"

yellow = "#ffff73"

attr Congestion = ""

colorCongestion -->

  case Congestion == range(1, 1.18) : green (for values between 1 and 1.18 the color is green)

  case Congestion == range(1.18, 1.28) : yellow (for values between 1.18 and 1.28 the color is yellow)

  else : red ( for any other values the color is red)

Can you help me please?

Thanks!!

0 Kudos
MatthiasBuehler
Regular Contributor

attr congestion = 0

Sidewalk -->

     Street

Street-->

     case congestion >= 6:

          color(0,1,0)

     case congestion >= 3:

          color(1,1,0)

     else:

          color(1,0,0)

NOTES:

-----------

  • don't use string (""), use float (0) when initializing the attr
  • check the name (case sensitivity) of the attr
  • check the attr souce in the Inspector's attr source editor (point to the object attr)
  • Use more StartRules that point to the 'Street' rule

Ok ?

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

+44 (0) 15396 20875
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

IonutAlixandroae
Occasional Contributor

Thanks!!

0 Kudos