Skip to main content
Solved

Tile Neighbour

  • July 23, 2020
  • 3 replies
  • 18 views

I have this Geometry and these Numbers:

I want in my Attributes:

ID | Right | Left | Up | Down

13 | 14 | | | 19

14 | 15 | 13 | | 20

 

How can i get the neighbors?

Best answer by david_r

Here's another possible solution using the NeighborFinder: directional_neighborfinder.fmwt

Comments and explanations inside.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

oscard
Influencer
Forum|alt.badge.img+22
  • Influencer
  • 344 replies
  • July 23, 2020

It seems all the the tiles are equal, so you could take the centroid of each one to create a point geometry. Then you could offset that point to move its X as much as the width of the tile and get the up (positive offset) or the down (negative). Once you have performed the Offset you just have to make a Spatial Relator to see in which tile it has fallen.

For right and left you would take the same centroid and use the Offset transformer to change its Y coordinate using the height of the tile.


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • July 23, 2020

Get the coordinates of the centerpoint of each tile (CenterPointExtractor), they'll be stored in a pair of attributes. Since you know how big each tile is you can use VertexCreators to generate new points, based on the centerpoint coordinates, that fall inside the tiles to the right, left, top and bottom. Do a PointOnAreaOverlayers with those points and the tiles, copying the tile number to the points (create new attributes for that) and then merge that all back to the original tiles:

get_tile_numbers.fmw


david_r
Celebrity
  • 8392 replies
  • Best Answer
  • July 23, 2020

Here's another possible solution using the NeighborFinder: directional_neighborfinder.fmwt

Comments and explanations inside.