Powerline rule

4639
8
Jump to solution
01-07-2016 08:05 AM
JørnKristiansen
Esri Contributor

Hi

I am making a rule of some powerlines (which should be used as a .rpk to symbolize a polygon (powerline path) in ArcGIS Pro) I am having some issues with the rule file/best practice in ArcGIS Pro, and hope that some of you could help me out here

Here is what I do:

  • I have created a simpel .cga script:

version "2015.2"

attr avstand         = 200           // gap between the poles

attr hoyde           = 30            // hight

attr bredde          = 20            // width

attr farge           = "#808080"     // color

hatta                          = "assets/Sketchup/LyseMastNormal5.dae" //asset (both powerline and pole merged)

@InPolygon

@StartRule

trase -->

      alignScopeToGeometry(yUp, any, longest)

      split(x){~avstand: alignScopeToGeometry(yUp,0) lagHoyspent}*

              

lagHoyspent -->

      alignScopeToGeometry(yUp, world.lowest, longest)

      r(90,90,90)

      #t(0,0,0)

      s(bredde, hoyde, avstand) center(x)

      i(hatta)

      color (farge)

     

  • Which results in this in city engine:

The rule in a tilted direction

Just the asset, a collada file .dae

  • I export the rule as a .rpk file
  • Open arcgis Pro and creates a polygon on a flat surface (water)
  • I then assign the. rpk as a procedural layer to the symbology of my polygon feature class
  • And voila, everything works like a charm:

Unfortunately, the terrain here in Norway is not as flat as shown in the picture, we got steep hills and mountains where the powerline’s are going, and here is where the problems are starting.

  • Here is what happens when I create a polygon in an area with some relief (the elevation of the feature class is set to “on the ground”):

The Powerline is floating in the air

  • My questions:

    • How can you “snap” the symbols /powerlines to the polygon when not flat?

    • How can you aligne the polygon to the surface (in arc scene the function floating on a custom surface) in arcgis Pro?

      • Interpolate surface won’t do it

      • And since I am presenting procedural symbols the feature class must be visualized as a polygon in the 3d Layers.

Regards

Jørn

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi Jørn,

Reordering the vertices might be painful, unless there is a GP tool for that.

I'm thinking it would be much easier to add an attribute to the CGA rule that would use the rotateScope command seen in your start rule.

attr rotateThis = 90  # the default value you have now

Then in your start rule change that one line to:

rotateScope(0, rotateThis, 0)

And you put a field on the feature class to match the RPK attr (whatever you name it in the rule). Populate the field initially with 90 for all shapes, and then go to the ones that are backwards, and edit the attribute to be -90. Also, if the first vertex behaved differently, like if it was on the south side, you might need a 0 or 180, to rotate it correctly.

Does this make sense for your situation?

Chris

View solution in original post

8 Replies
CherylLau
Esri Regular Contributor

I'm not sure why the power line is floating in the air.  I don't think it's the code because it seems to work in CityEngine.  However, the code does have some scope changes that could be avoided.  Here is a shorter version that you could try out to see if the power line still floats.

version "2015.2"

attr avstand         = 200           // gap between the poles

attr hoyde           = 30            // hight

attr bredde          = 20            // width

attr farge           = "#808080"     // color

hatta                          = "assets/Sketchup/LyseMastNormal5.dae" //asset (both powerline and pole merged)

@InPolygon

@StartRule

trase -->

      alignScopeToGeometry(yUp, any, longest)

   rotateScope(0, 90, 0)

      split(z){~avstand: lagHoyspent}*

             

lagHoyspent -->

      s(bredde, hoyde, avstand) center(x)

      i(hatta)

      color (farge)

JørnKristiansen
Esri Contributor

Thanks Cheryl, this has no effect on the results, but always better with a cleaner script

0 Kudos
CherylLau
Esri Regular Contributor

As for Pro, aligning a single 4-vertex polygon to the terrain is not possible (except when you drape it onto the terrain, but this doesn't actually change the polygon, so the rule won't work as desired in this case).  You would have to add more vertices to the polygon and align those to the terrain.  But, if you apply your cga rule to the non-flat polygon, then it probably won't work as intended.

So, if you can break up the polygon into several smaller polygons and align each of those to the terrain, this would get you closer to aligning your geometry to the terrain.

We are working on similar problems, and I know this is a tricky issue.  We are glad to have your feedback as it gives us a valid use case, so thank you for sharing it.

JørnKristiansen
Esri Contributor

Again, thank you for the answer Cheryl!

What has happened since my last post:

I managed to get the poles to follow the terrain by actually using interpolate shape tool.

But ass you predicted this wont work as intended.

I have isolated it down to perhaps have something to do with the drawingorder of the start- and endpoint of the underlying polygon.

Ass you see here the orientation of the vertices on the polygon is not following the same drawingorder. It seems to me that they are following "a north-south rule" (the northrn vertex is always the start- and endpoint)

This is important, because the rule is telling that the non-start-/endside of a polygon should start with a power pole and the other side should end with a power cable.

Do you got any ideas how I could have a concise drawingorder of the vertices (same for all the polygon pieces)?

0 Kudos
by Anonymous User
Not applicable

Hi Jørn,

Reordering the vertices might be painful, unless there is a GP tool for that.

I'm thinking it would be much easier to add an attribute to the CGA rule that would use the rotateScope command seen in your start rule.

attr rotateThis = 90  # the default value you have now

Then in your start rule change that one line to:

rotateScope(0, rotateThis, 0)

And you put a field on the feature class to match the RPK attr (whatever you name it in the rule). Populate the field initially with 90 for all shapes, and then go to the ones that are backwards, and edit the attribute to be -90. Also, if the first vertex behaved differently, like if it was on the south side, you might need a 0 or 180, to rotate it correctly.

Does this make sense for your situation?

Chris

JørnKristiansen
Esri Contributor

Thank's for the help guys, the powerline rule now works like a charm

NigelBerjak
Occasional Contributor II

Hi

Your powerlines look great. Unfortunately I do not have CityEngine and cannot create rule files. I was wondering whether you would be willing to publish your rule set or send it to me, which I could then use in ArcGIS Pro. I'm doing a viewshed and 3D layout, which I am using to learn with.

Many thanks,

Nigel

0 Kudos
mfresali
New Contributor II

Hi @JørnKristiansen 

 May I know this is solved with using only interpolate shape tool? I have similar issue that i need to generate tower and lines from the point using rpk rules. but the elevation for the model generated keep not align with the ground

0 Kudos