streetscale = 1 // street width scale factorstreetWidthDefault = 5 width = getObjectAttr("rdClass")// Instead of reading a number this reads the type of road eg motorway or local street I use prefix rd to indicate where it is located attr streetWidth = // street width dependeding on "width" attributes case width == "Primary" : 55 * streetscale case width == "Secondary" : 30 * streetscale case width == "Tertiary" : 20 * streetscale case width == "Footpath" : 2.5 * streetscale case width == "" :0 *streetscale // if there is no class attribute then the width is zero else : streetWidthDefault
const lamp_asset = "lamppost.obj" // this is under your assets directory you can get a quick model from places like Google 3D Warehouse just be sure you have permission to use them! attr sidewalkHeight =0.25 attr lampDistance =25 // you could change this or add different attributes for each road class attr roadClass = "None" // attribute name declared in layer attribute Street--> // I've coloured these in simple primary colours so you can see what's happening case roadClass == "Primary" : color ("#ff0000") case roadClass == "Secondary" : color ("#00ff00") case roadClass == "Tertiary" : color ("#0000ff") // you can add more classes here else : color("#535353") Sidewalk--> set(trim.vertical,false) set(trim.horizontal,false) comp(f){ all: SidewalkPart } SidewalkPart --> case scope.sx > 5: SidewalkWithCurbs alignScopeToAxes(y) t(0,sidewalkHeight,0) SidewalkLampTest else: SidewalkWithCurbs SidewalkWithCurbs --> extrude(world.y,sidewalkHeight) comp(f) { top : split(y){ sidewalkHeight : Curbs | ~1 : Pavement } | front : Curbs } SidewalkLampTest--> // in this example only my primary and secondary classes of street get lampposts! case roadClass == "Primary" : SidewalkLamps case roadClass == "Secondary" : SidewalkLamps else : nil SidewalkLamps --> split(x){ ~lampDistance : NIL | { 0.1: Lamp | ~lampDistance : NIL }* } Pavement --> color("#C0C0C0") Lamp --> t(0,0,scope.sz-sidewalkHeight*2) s(0,5,0) r(0,90,0) i(lamp_asset) Curbs --> color("#C0C0C0") Crossing--> color("#535353") Junction--> color("#535353") JunctionEntry--> color("#535353") Island--> extrude(0.5) color("#008000") StreetMarketRoof--> // you need to select the shapes start rule manually to enable this but you could do it via road class as well extrude(10) comp(f) { bottom : marketstreet | top : marketroof } marketroof--> roofGable(22.5) marketstreet --> reverseNormals color("#008000") // I seem to need to do this so I can have a coloured street under my marketroof
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.