Skip to main content

Im having trouble with something that seems extremely trivial. I'm trying to convert the GeoJSON output from an Arcgis REST API call into geometry using the GeometryReplacer.

FMENothing too fancy is going on, but for some reason I get  INVALID_PARAMETER_GEOMETRY_SOURCE out of the rejected port. I feel like I've done this countless number of times without issue.

 

If I save the API output to a GeoJSON file and read it using the GeoJSON reader, FME reads it fine.

 

I'm bewildered 😣

How it works for me: JSONExtractor after HTTPCaller with JSON Query

json<"features"]
  • t"geometry"]
  • to attribute "geometry". Then GeometryReplacer GeoJSON attribute "geometry".

     

    Tip: Finding the right JSON Query can be challenging, but FME really helps:

    • Save the json sample to a file.
    • In the JSONExtractor choose File/URL and select the sample file.
    • Click the ... button in JSON Query an select the element you are looking for.

    SelectJSONQuery


    Ah yes! Thanks so much @nielsgerrits​ . I forgot that the GeometryReplacer is expecting GEOMETRY! Not the whole GeoJSON feature, which is why it's invalid. 😅


    How it works for me: JSONExtractor after HTTPCaller with JSON Query

    json<"features"]
  • t"geometry"]
  • to attribute "geometry". Then GeometryReplacer GeoJSON attribute "geometry".

     

    Tip: Finding the right JSON Query can be challenging, but FME really helps:

    • Save the json sample to a file.
    • In the JSONExtractor choose File/URL and select the sample file.
    • Click the ... button in JSON Query an select the element you are looking for.

    SelectJSONQuery

    I'm hoping that the next evolution of featurecaching allows you to build queries in this way within the JSON transformers from the cached JSON (Maybe it does already? I've not tried in 2020)


    I'm hoping that the next evolution of featurecaching allows you to build queries in this way within the JSON transformers from the cached JSON (Maybe it does already? I've not tried in 2020)

    yeah, this would be a nice optimization. Is not working this way in 2020.2.0.0.


    Reply