Skip to main content
Question

GeoemtryReplacer - Invalid GeoJSON not rejected

  • March 22, 2023
  • 5 replies
  • 50 views

ebygomm
Influencer
Forum|alt.badge.img+44

Not sure if this is a known issue or not, this is in FME 2020.2

 

GeoJSON processed by the GeometryReplacer results in a line with 0 coordinates, it is not rejected which is what i would expect to happen

 

e.g. 

{"type":"LineString","coordinates":[[[0,0],[100,0]]]}

Processing this with the GeometryReplacer, results in this geometry

 

image

5 replies

hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1620 replies
  • March 22, 2023

Your coordinates array has one too many pairs of square brackets

{"type":"LineString","coordinates":[[0,0],[100,0]]}

 


ebygomm
Influencer
Forum|alt.badge.img+44
  • Author
  • Influencer
  • 3422 replies
  • March 22, 2023

Your coordinates array has one too many pairs of square brackets

{"type":"LineString","coordinates":[[0,0],[100,0]]}

 

Yes, that's the point. It's invalid geojson and I would expect it to be rejected by the geometry replacer but instead a line with zero coordinates is created, it is not rejected.


hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1620 replies
  • March 22, 2023

Ah, I follow. Yes, as its specified as a line, I'd expect it to fail... as you can't have a line with 1 coordinate. It also "passes" if you just specify

    {"type":"LineString","coordinates":[[0,0]]}

It seems it might not be validating the geom type vs the output geom.

 

This is also happening in 2022.1


DanAtSafe
Safer
Forum|alt.badge.img+19
  • Safer
  • 344 replies
  • March 24, 2023

Yes, that's the point. It's invalid geojson and I would expect it to be rejected by the geometry replacer but instead a line with zero coordinates is created, it is not rejected.

@ebygomm​ @hkingsbury​ FYI I've filed FMEENGINE-77079 about this issue.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Author
  • Influencer
  • 3422 replies
  • March 24, 2023

Yes, that's the point. It's invalid geojson and I would expect it to be rejected by the geometry replacer but instead a line with zero coordinates is created, it is not rejected.

Thanks, I wasn't 100% sure whether this would be expected behaviour or not.