Skip to main content
Question

Creating geometry from GeoJSON text


mattebridges
Participant
Forum|alt.badge.img+5

Hi - I’m trying to create polygon geometry from the GeoJSON in the attached file. This is a string attribute returned from an API.

I was thinking I could use a GeometryReplacer with the encoding set to GeoJSON. However when I do this the record is rejected with an ‘INVALID_PARAMETER_GEOMETRY_SOURCE’  message.

I have passed the GeoJSON attribute through a JSONValidator and this doesn’t flag up any issues.

Any suggestions for what I’m doing wrong, or alternative approaches would be very welcome.

Thanks in advance.

7 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

What version FME do you use? When I read it as text and use a GeometryReplacer in 2024.2 it just works?


jobvdnoort
Supporter
Forum|alt.badge.img+10
  • Supporter
  • April 25, 2025

Hi mattebridges,

I also have a example for you :) 

Similar to what Niels is doing he was just a minute quicker…. 

 

Edit: apperantly Niels changed his awnser… but I still have a working example for you  haha


mattebridges
Participant
Forum|alt.badge.img+5
  • Author
  • Participant
  • April 25, 2025

Thanks so much ​@nielsgerrits and ​@jobvdnoort for your suggestions.

We’re on 2023.1 - so nothing ancient.

I’ll have a go with both suggestions now - really appreciate your help here :-)

 


mattebridges
Participant
Forum|alt.badge.img+5
  • Author
  • Participant
  • April 25, 2025

Thanks again to @nielsgerrits and ​@jobvdnoort,

I was able to get this to work using serial JSONFragmenters. I’m not sure I understand why the second Fragmenter produces geometry but hey I’ll take it!

​​​​​​​Best wishes.


takashi
Influencer
  • April 25, 2025

Hi ​@mattebridges ,

We’re on 2023.1 - so nothing ancient.

Originally GeometryReplacer (Geometry Encoding: GeoJSON) only supports replacing a “geometry” object with a geometry, not support replacing full GeoJSON document.

However, GeometryReplacer in FME 2024.2 or heigher supports replacing full GeoJSON document. You can find when the enhancement has been introduced in the Change Log, linked from the FME Downloads page.

Change Log - Result of Search "GeometryReplacer"

 


danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • April 25, 2025
takashi wrote:

Hi ​@mattebridges ,

We’re on 2023.1 - so nothing ancient.

Originally GeometryReplacer (Geometry Encoding: GeoJSON) only supports replacing a “geometry” object with a geometry, not support replacing full GeoJSON document.

However, GeometryReplacer in FME 2024.2 or heigher supports replacing full GeoJSON document. You can find when the enhancement has been introduced in the Change Log, linked from the FME Downloads page.

Change Log - Result of Search "GeometryReplacer"

 

Awesome.


mattebridges
Participant
Forum|alt.badge.img+5
  • Author
  • Participant
  • April 26, 2025

Hello ​@takashi - thank you so much for taking the trouble to explain this.

I’m relieved to know there was a reason why I couldn’t get the GeometryReplacer approach to work.

Best wishes!


Reply


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