Skip to main content
Solved

CoordinateExtractor vs @XValue()/@YValue() for multi(line/surface)

  • April 22, 2020
  • 7 replies
  • 142 views

p.jeremie
Contributor
Forum|alt.badge.img+6

Hi,

 

I noticed the following behavior.

I created two shapefiles for this test : line.shp and surface.shp

Both contain several feature including one with multiparts (multiline and multisurface).

 

When using CoordinateExtractor with mode Specify Coordinate + index=0, I get in the _x and _y attributes the first point of the first part of line/surface.

I assumed I would get the same with @XValue() and @YValue() but it is not the case for the multiparts features.

For those I get a point far far away from the feature, with integer values for X and Y.

 

Anybody knows why ? Is it a normal behavior ?

 

Tested on FME 2018.1 and 2019.0, see enclosed test workspace on FME 2019.

Best answer by fmelizard

Hi @p.jeremie The CoordinateExtractor is hiding the first coordinate for aggregates. I don't know why the @XValue() and @YValue() don't also skip the first vertex. Y is the number of coordinates in the first element. For multipart polygons, X=4; for lines, X =2.

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.

7 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • April 22, 2020

It doesn't seem like normal behaviour to me (it's also happening in FME 2020 by the way). I would recommend sending this in to Safe's support team.

The easy workaround is to use the CooridnateExtractor of course.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • April 22, 2020

@Evaluate(@Coordinate(x,0)) & @Evaluate(@Coordinate(y,0) give the same integer figures for the multiparts.

Interestingly @Evaluate(@Coordinate(x,1)) & @Evaluate(@Coordinate(y,1)) return the correct first coordinate for the multipart features


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • 1442 replies
  • April 22, 2020

Apparently de-aggregating the multi feature helps....


p.jeremie
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 53 replies
  • April 22, 2020

It doesn't seem like normal behaviour to me (it's also happening in FME 2020 by the way). I would recommend sending this in to Safe's support team.

The easy workaround is to use the CooridnateExtractor of course.

I filed a report. Case number C153869.

In the meantime yes I will use CoordinateExtractor.


p.jeremie
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 53 replies
  • April 22, 2020

@Evaluate(@Coordinate(x,0)) & @Evaluate(@Coordinate(y,0) give the same integer figures for the multiparts.

Interestingly @Evaluate(@Coordinate(x,1)) & @Evaluate(@Coordinate(y,1)) return the correct first coordinate for the multipart features

Indeed, it's weird...


fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • Best Answer
  • April 23, 2020

Hi @p.jeremie The CoordinateExtractor is hiding the first coordinate for aggregates. I don't know why the @XValue() and @YValue() don't also skip the first vertex. Y is the number of coordinates in the first element. For multipart polygons, X=4; for lines, X =2.


p.jeremie
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 53 replies
  • April 23, 2020

Hi @p.jeremie The CoordinateExtractor is hiding the first coordinate for aggregates. I don't know why the @XValue() and @YValue() don't also skip the first vertex. Y is the number of coordinates in the first element. For multipart polygons, X=4; for lines, X =2.

Hi @danatsafe. Indeed, it makes sense now.

FYI I filed a report. Case number C153869.

In the meantime yes I will use CoordinateExtractor.