Solved

Area list on point from PointOnAreaOverlayer: how loop through list and compare point with each area in turn in a SurfaceDraper?

  • 17 August 2021
  • 2 replies
  • 30 views

Badge +1

The scenario: I have a set of 2000+ 3D polygons and a set of 2+ million(!) 3D points (with all Z's equal 0 at the start). The polygons are essentially surfaces. (I will call them that.) These surfaces massively overlap and have widely varying footprints but are at all sorts of different heights above ground. In fact, most are sloped, and many change elevation position realtive to each other as one moves horizontally through the field of surfaces.

The need: For each point (XY location), I need to determine the surface elevation at that location for each surface that the point falls within and to choose the lowest elevation and put that value in an attribute on the point.

So far: I have run the points and polygons through a PointOnAreaOverlayer with list building. This conveniently gives me points with a list of containing areas, where the lists are not too long, maybe 5 to 30 elements.

The question: How do I loop through the area list and then compare the point to each of the actual surfaces--the geometry--to get a surface elevation and then choose among the elevation results?

A SurfaceDraper will do nicely to get the elevations, but I have to be able to send in particular pairs of point and surface and to process all point/surface pairs for a particular point before moving on to the next point. This will all require looping or some clever alternative thereto (Mike Ireland's Cloner-Loop thing maybe?), which I just cannot figure out in FME. I have a long but quite narrow history with FME, where list processing and looping in custom transformers is mostly outside my breadth. I could easily do all of this in Python, which I do know well, except for the fact that one cannot use transformers, in this case the SurfaceDraper, from within Python. Any help with all of this would be much appreciated. I am lost in the weeds and need some perspective and learnin'. Thanks, all.

 

 

icon

Best answer by caracadrian 17 August 2021, 19:40

View original

2 replies

Badge +20

You don't loop.

Presuming both your points and polygons have unique ID's (if not just create some with different attribute names) you generate lists on output points AND area in PointOnAreaOverlayer.

Connect ListExploder transformers to each of the output ports of the PointOnAreaOverlayer. This creates duplicates of points and areas for each corresponding area or point.

Connect the exploded list from points to the DrapeFeatures port and the exploded list from area to Points/Lines OR Brakelines port of the SurfaceDraper transformer.

Check Group Processing in SurfaceDraper and select the unique ID attribute of the points as GroupBy.

You will now have a point draped on every polygon that contains it. This generates multiple points (x,y) with different elevations that you can further process.

Badge +1

You don't loop.

Presuming both your points and polygons have unique ID's (if not just create some with different attribute names) you generate lists on output points AND area in PointOnAreaOverlayer.

Connect ListExploder transformers to each of the output ports of the PointOnAreaOverlayer. This creates duplicates of points and areas for each corresponding area or point.

Connect the exploded list from points to the DrapeFeatures port and the exploded list from area to Points/Lines OR Brakelines port of the SurfaceDraper transformer.

Check Group Processing in SurfaceDraper and select the unique ID attribute of the points as GroupBy.

You will now have a point draped on every polygon that contains it. This generates multiple points (x,y) with different elevations that you can further process.

@caracadrian--Thank you so very much. That is exactly the solution that was coalescing in my head over the last couple of hours. I am glad that I am not heading down a rabbit hole. I wasn't sure: the massive expansion of number of features to process was giving me pause. Maybe I am getting the hang of this.

Reply