Skip to main content
Solved

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


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.

View original
Did this help you find an answer to your question?

7 replies

redgeographics
Celebrity
Forum|alt.badge.img+56

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+41
  • Influencer
  • 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+17
  • Supporter
  • April 22, 2020

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


p.jeremie
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 22, 2020
redgeographics wrote:

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
  • April 22, 2020
ebygomm wrote:

@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
  • 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
  • April 23, 2020
fmelizard wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings