Map behaviour

520
1
07-16-2012 02:49 PM
RobertHexter
New Contributor III
[ATTACH=CONFIG]16141[/ATTACH]


So in this case we are determining the Asset_Height by using a control map(the white foggy hard line).
Yet we have a hard line where the buildings are flattened to the floor with an Asset_Height of 0.. now these flattened buildings are off the control map i know, however this makes no sense to me as I would have expected the height to default to the else statement and assign an Asset_Height of 100 as the map layer rule details.


attr Asset_Height =
 case map_01(brightness,0,255) > 200:
  150.0
 case map_01(brightness,0,255) > 100:
  50.0
 case map_01(brightness,0,255) > 60:
  70.0
 else:
  100.0




I find this behaviour odd, am i correct in the assessment of what is happening here?
0 Kudos
1 Reply
MatthiasBuehler1
Frequent Contributor
I've confirmed your find. This is indeed not so beautiful. The heuristic used here seems to just map 0 outside the map layer and evaluate the function only within the actual layer's extent.


here's a way to make it work, by defining an attr to distinguish 'inside' and 'outside'.

in the same spot, create an other attr :
attr insideMap = true


initialize it also in the rule file.

example of th the main rule :

attr insideMap = true
attr extrVal = 50

Lot -->
 case insideMap :
  extrude(extrVal)
 else:
  extrude(100) # default value 


don't forget to point the attr sources to the layer.

that way, you can distinguish between the 2 states and still map the full range of values, including zero from black areas of the map.

let me know if it works too in your case.
0 Kudos