Question

spatial relations for surrounding features


Hi

 

 

hopefully someone can answer my query. I have a sample block of polygons and i want to know the location of each of the features that touch each polygon (top, bottom, left, right etc). all my data is in a grid with an example below. So i want to know the positions of each polygon against the other features. I can use the spatial relator and list concatenator to identify all the polygons which touch each polygons, but is there a way to identify the tiles relation further as in my example table below? i've looked at the left right calculator but to no avail.

 

 

Anyone have any ideas?

 

 

 

5 replies

Badge +3
Hi,

 

 

SpatialRelatro for starters, is ok.

 

Then CenterpointReplacer, name thes C_x and C_y.

 

Explode -relationships{}. Extract coordinates.

 

Use a tester to seperate Centerpoints (C_x,C_y) form the rest.

 

Merge the outputs form the tester, Centerpoints to suplier. Proces Duplicates and explode the duplicate list.

 

Now u have all points as centerpoints connected to their surrounding points.

 

Use 2DReplacer and 2DAdder to make lines.

 

Use AzimuthCalculator to extract angels.

 

Make AttributeCreator in conditional mode to get the positional relations to create the table posted above.

 

Like for instance

 

if AcAngle = 90 then  Topright= @Value(Objectname)

 

.

 

.

 

.

 

else do nothing

 

 

Here is a pic of the workspace

 

 

 

 

 

Haves Fun!
Badge +3
I have made a slight adjustment and also added the creation of your tabel:

 

 

 

 

 

Thi is the result:

 

Badge +3
ps.

 

 

attributeRemover prior to the FeatureMerger, removes attribute "name" from "centre" features.

 

In prior pic i forgot that one, wich messed up the coupling of the "name" attribute.
Badge +3
..erhmm..

 

 

erratum

 

 

 

i accidentaly switched left and top left in the Parameter Condition Definition.

 

180 is left and 135 is top left...
Userlevel 2
Badge +17
Hi,

 

 

another approach. Assuming that every polygon has same sizes (width and height).

 

 

Step 1

 

Create 8 neighbor points for every polygon; give each point an attribute storing the direction name ("top", "top right", "right" ...).

 

Filter the points by original polygons; transfer the attribute storing overlapped polygon name to the point (e.g. "neighbor_Polygon").

 

 

 

Step 2

 

Rename the attribute ("neighbor_Polygon") with the direction name ("top", "top right", "right" ...).

 

Expose those attribute names.

 

Aggregate them grouping by original polygon name.

 

Replace <missing> attribute with <null>, if necessary.

 

 

 

Result:

 

 

 

Takashi

Reply