Skip to main content
Hello

 

 

I wanted to ask the FME Gurus about SpatialRelator that gives me a strange result.

 

 

I have a couple of feature sets, polygons and annotations, that are related. Both sets have the same number of features and both include an attribute SECTION_NO which has the same value for the related features.

 

For each of the polygons I need to get the text of the related annotation which is stored in an attribute named TEXTSTRING.

 

 

I added a SpatialRelator, connected the polygon set to BASE, annotation set to CANDIDATE, set "Group By:" to SECTION_NO to make sure that only features with the same value in that attribute are compared, and set "Tests to Perform" to CONTAINS and OVERLAPS. From the output I use the attributes of the polygon and _relationships{}.TEXTSTRING

 

 

Most of the polygons are large enough to contain the annotations and the result is as I expect - I have the value of TEXTSTRING in the output. But there is a few polygons that are narrower than the related annotation and the SpatialRelator does not relate them. I thought that the test OVERLAPS would relate them but it did not. In fact I tried all available tests and none of them related the few annotations to the related polygons. In each of the few cases the attribute "_related_candidates" was set to 0.

 

The polygons are just rectangles, there isn't any complexity in the shapes that may go around the annotations.

 

 

I replaced the SpatialRelator with a FeatureMerger, connected the polygon features to REQUESTOR, annotation features to SUPPLIER, configured it to merge the sets on the attribute SECTION_NO, and get polygons with related TEXTSTRING through the output COMPLETE. So my problem is solved. However, I would like to understand why the SpatialRelator did not relate the few features where the annotations were wider than the polygons.

 

 

I use FME Desktop 2013 SP1

 

 

Thanks

 

 

Witold
Hi Witold,

 

 

It seems that FME treats a text geometry as a point representing the location (left-bottom of the text string in general) when computing spatial relationships.

 

I think it is the reason for the unexpected result which you got with the SpatialRelator.

 

 

Takashi
Thanks Takashi

 

 

That would make sense, the left-bottom point of the text is outside of the polygon. In fact all four corner points are outside the related polygon in the few cases.

 

 

ArcMap shows that the features in the annotation layer have the shape type "Polygon" and the values of MinX, MaxX, MinY, and MaxY represent the rectangle surrounding the text. It made me thinking that SpatialRelator may/should relate the two sets.

 

 

Thanks for the explanation

 

 

Witold 

Reply