Skip to main content

Hello Friends!

My current setup:

  • FME(R) 2024.0.1.0 (20240328 - Build 24202 - WIN64)

  • ...from ArcGIS Pro Data Interoperability Extension

I am attempting to use the GeoJSON Reader to capture information from api.weather.gov/alerts/active (Weather.gov API).  I am not having any problems getting data.  The problem I am having is populating all of the available fields within the API - in case I ever do get them from the API.  The first time I connected to the URL from the Reader, I got most of the attributes, missing maybe 10 fields.  Adding another GeoJSON Reader and connecting to the URL an hour later, I get a different set of attributes.  I do understand that the data is changing and their API is not delivering any unnecessary nested attributes.

When opening the Reader’s Properties and then User Attributes - there is no way to add attributes.  Am I missing something?  Is there another way to add attributes?

Thank you,

--Adam

I had a thought:
I could take the GeoJSON from a pull and edit one of the events in a text editor - and then load that file into a new GeoJSON Reader.  Then I could switch the source to the URL.
Trying this.


I had a thought:
I could take the GeoJSON from a pull and edit one of the events in a text editor - and then load that file into a new GeoJSON Reader.  Then I could switch the source to the URL.
Trying this.

I did this - and got this as a result…
 

I don’t think I can go on from this message.  Since I changed the input path to my URL, it is not making any of the data available….
Back to the drawing board.


Okay - I found this blog post:  Unexpected Input - The Toll Booth Model - FME by Safe Software

My answer was just renaming the geojson file to match the name of the Reader when just initially connected to the URL.  In my case the url https://api.weather.gov/alerts/active ends in “active”.  This was the title of my Reader.  When I changed the file’s name to “active.geojson” and loaded it into the GeoJSON Reader, I was then able to change the source to the URL - and then my data loaded without problems.


Hello!
If I understand correctly, you are trying to capture all possible attributes from the Weather.gov API using FME's GeoJSON reader and experiencing inconsistency with capturing data?

I would recommend using the FeatureReader transformer instead of the GeoJSON Reader. The FeatureReader is generally better at retaining more of the nested attributes compared to the GeoJSON reader, which is particularly useful for APIs with varying response structures like the Weather.gov API.

Here's a suggested workflow to address your issue:

  1. Use the FeatureReader transformer (be sure to add a Creator transformer as the initiator) to retrieve data from the API. You can further detect all possible attributes by exposing all the unexposed attributes (though this may be unnecessary) by modifying the “Schema Attributes” within the Parameter .
  2. Implement a SchemaScanner transformer to detect all possible attributes across multiple API responses. This will help you identify the full range of potential fields.
  3. Use a ChangeDetector transformer to monitor for changes in the attribute schema between API calls. This will help you track when new attributes appear or existing ones disappear.

Hope this helps!

 


Reply