I have a HTTP feed using this open endpoint.
When I use the option to flatten the schema, I always end up with lots of records and the incidentid for Tracking field seems to be ignored.
If I then leave it and write out to a table without flattening, it just creates the neccessary records that correspond to the packets in the feed.
I then attempted to use the Field Calculator - Construct an Esri Geometry object, but struggled to get it to work with the nested values.
The location field has values like this:
{"lon":150.81224,"lat":-34.01287}
Arcade attempts:
@SimonGIS are you specifying a Root node when deriving the schema? Ex:
You should then be able to create geometry from the location_lon and location_lat fields:
Hi @SimonGIS thanks for posting!
You will need to specify on the Configure HTTP Poller > Confirm Schema page:
Additional documentation on flattening and root nodes available here
Then, click next and proceed to Identify Key Fields and specify the geometry fields:
The above is the expected way to configure geometry from this source provided.
Regarding your query about Arcade, Arcade is evaluating that value of "{"lon":150.81224,"lat":-34.01287}" as a string rather than a dictionary. Therefore when you call "$feature.location[0]" it is calling for the 0 index value of the string which is the { character that starts the string. To convert a string to a dictionary in Arcade use the dictionary function.
Thanks Jake and @PeterNasuti - I should have elaborated and provided more workings.
I can confirm I initially followed the exact same steps as above, but in this workflow I get duplicate records being recorded and the Track_ID seems to fail. Starting from scratch:
Note below I am using the incidentID as the Track_ID
Schedule every minute and output to a feature service for testing:
At time of writing, there are 9 unique records in the feed. The feed has initialised 4 times, and I have 4 duplicate sets of records:
If I repeat and ignore the date field entirely - same result.
If I remove the flatten option and don't enable geometry = works fine and no duplicate geometries in the table service. Everything syncs up.
I would prefer to get it working all within the feed before resulting to using Arcade. Am I missing something before going down that path?
Hi @SimonGIS thanks for the additional details - send me an email at pnasuti@esri.com and we will get a product engineer assigned to help investigate what you have reported. Please also log a support ticket for tracking purposes.