Roof type by shapefile attribute

1088
3
Jump to solution
07-11-2018 06:38 AM
NavidMoghadam
New Contributor II

Hi everyone, 

I have the roof type as an attribute in my footprint (shapefile attribute table) and I want to assign the roof type directly in the CGA rule, not in the inspector. For example, all my gable roof footprints have ''41'' as the value in that field and I want the CGA rule to generate gable roof for any building footprint with the same value without doing it manually in the inspector.

Thank you 

0 Kudos
1 Solution

Accepted Solutions
LR
by
Occasional Contributor III

Use a case. This should work..

attr RoofValue = 0

@StartRule
Lot -->
   case RoofValue == 41: generateRoofGable
   else: generatePyramid

generateRoofGable -->
   roofGable(30)
   color(1,0,0)

generatePyramid -->
   roofPyramid(30)
   color(1,0,1)

View solution in original post

3 Replies
Luiz_AmadeuCoutinho
Occasional Contributor III

Hi Navid

Check here : GIS Diven Building.cga and building footprints 

Or

You have to create or to modify a cga file. To see some samples get the Tutorial https://www.arcgis.com/home/item.html?id=1746ca6086dd41a49549541438a50531 

You will need to choose one attribute on your shapefile to put the information about the roof type and use something like :

attr Roof_Form = "hip"

Roof -->
    case Roof_Form == "shed"        : ShedRoof
    case Roof_Form == "pyramid"        : PyramidRoof
    case Roof_Form == "gable"        : GableRoof
    case Roof_Form == "hip"            : HipRoof
    case Roof_Form == "half-hip"    : HalfHipRoof
    case Roof_Form == "gablet"        : GabletRoof
    case Roof_Form == "gambrel"        : GambrelRoof
    case Roof_Form == "mansard"        : MansardRoof
    case Roof_Form == "gambrel-flat": GambrelFlatRoof
    case Roof_Form == "mansard-flat": MansardFlatRoof
    case Roof_Form == "vault"        : VaultRoof
    case Roof_Form == "dome"        : DomeRoof
    case Roof_Form == "saltbox"        : SaltboxRoof
    case Roof_Form == "butterfly"    : ButterflyRoof
    else                            : FlatRoof 

0 Kudos
LR
by
Occasional Contributor III

Use a case. This should work..

attr RoofValue = 0

@StartRule
Lot -->
   case RoofValue == 41: generateRoofGable
   else: generatePyramid

generateRoofGable -->
   roofGable(30)
   color(1,0,0)

generatePyramid -->
   roofPyramid(30)
   color(1,0,1)
NavidMoghadam
New Contributor II

Thank you so much!

Cheers 

0 Kudos