Skip to main content

Hello

 

I'm currently transforming a GeoTiff in a point raster using centerpointreplacer. I have a grid of points every 100m.

The next step is to add 8 attributes for the 8 neighbours (or less if the point is on a border) and in each attribute set the slope from this point to the neighbor in %].

I have z values for each point, I don't know how to get the distance between 2 points and how to add the attributes according to the neighbors.

Maximum distance for neighbors: @sqrt($(Resolution)^2 + $(Resolution)^2) * 1.1

 

20231212_110110 

Thanks,

Antoine

I'm not entirely sure if I understand your question correctly but I think you could use the NeighborFinder for this. Set it to Candidates Only mode.

 

You could set maximum distance to 100m (or 101, not sure) and generate a list attribute on each point, in which you gather the attributes of interest of the 8 (or less) surrounding points.

 

You can explode the list attribute using the ListExploder for further analysis/ease of visualisation.

 

Hope this helps.


It may be easier to do your calculations on the original raster. Have you looked at the Raster transformers?


It may be easier to do your calculations on the original raster. Have you looked at the Raster transformers?

Thank you for your reply. I have looked on how to do this with raster transformers, like the RasterSlopeCalculator, but it "only" gives the maximum rate of change in z in the cell, and I need to hav the slope for all 8 directions

 


I'm not entirely sure if I understand your question correctly but I think you could use the NeighborFinder for this. Set it to Candidates Only mode.

 

You could set maximum distance to 100m (or 101, not sure) and generate a list attribute on each point, in which you gather the attributes of interest of the 8 (or less) surrounding points.

 

You can explode the list attribute using the ListExploder for further analysis/ease of visualisation.

 

Hope this helps.

Thank you fot your reply.

I'm not very familiar with lists. I know the values are like stored and can be called with {} but I don't really know how to retrieve them.

I had already tried the NeighborFinder (Candidates Only mode somhow only returns unmatched elements) but it's not very clear to me what happens


I'm not entirely sure if I understand your question correctly but I think you could use the NeighborFinder for this. Set it to Candidates Only mode.

 

You could set maximum distance to 100m (or 101, not sure) and generate a list attribute on each point, in which you gather the attributes of interest of the 8 (or less) surrounding points.

 

You can explode the list attribute using the ListExploder for further analysis/ease of visualisation.

 

Hope this helps.

It now seems to work, thank you. I had an error in my formula @sqrt($(Resolution)^2 + $(Resolution)^2) * 1.1, as FME Arimthmetic Editor doesn't understand ^ as power, I have to write @sqrt(@pow($(Resolution),2) + @pow($(Resolution),2)) * 1.1 and everything works fine


Thank you fot your reply.

I'm not very familiar with lists. I know the values are like stored and can be called with {} but I don't really know how to retrieve them.

I had already tried the NeighborFinder (Candidates Only mode somhow only returns unmatched elements) but it's not very clear to me what happens

Glad to see the NeighborFinder approach works for you. Below is some more explanation about the lists.

 

This is my dummy workspace:

imageThese are the settings of my NeighborFinder:

imageAs you can see under Attribute Accumulation, I collect all values from the Z attribute to the list called _NeighborList.

You can explode the list with the ListExploder, which results in this:imageimageThe ListExploder basically multiplies your input features with the amount of list elements. I have prefixed the neighbor attributes with nb_ to avoid confusion. 'Z' and 'ID' are from the original point and 'nb_Z' and 'nb_ID' are from the neighboring points.

As you can see, ID 1 has three neighbors, so three points are generated. These points have the attributes of ID 1 (Z = 3.9) and of the neighbor points ID 2, ID 11, ID 12 (nb_Z = 2.6, nb_Z = 3.2 and nb_Z = 1.3).

 

You can do further calculations with these exploded features and e.g. merge it back together based on the original ID.

 

Have fun!


Thank you fot your reply.

I'm not very familiar with lists. I know the values are like stored and can be called with {} but I don't really know how to retrieve them.

I had already tried the NeighborFinder (Candidates Only mode somhow only returns unmatched elements) but it's not very clear to me what happens

Worked perfectly for me, thanks!


Reply