AnsweredAssumed Answered

Field Calculator (RegEx?) to remove portion of JSON syntax

Question asked by tonguecutsparrow on Nov 10, 2014
Latest reply on Nov 20, 2014 by tonguecutsparrow

I have the following output in my browser when I perform a json (get) query:

 

jQuery2112012970359064638615_1415645296091({"success": true, "vehicles": [{"agency_id": 563, "apc_status": "not_installed", "call_name": "1969", "current_stop_id": 8064840, "heading": 12, "id": 8014243, "load": null, "position": [30.549453, -87.219218], "route_id": 8002908, "segment_id": 8033424, "speed": 0.0, "timestamp": 1415654632000}]});

 

This is information about our school's trolley location, which we are trying to simulate in our GeoEvent Processor. When GEP accepts this information and tries to make a GeoEvent Definition out of it, I simply get "Success" and "Vehicles", with the latter having a drop-down menu style in the GED. From there, I can give the "id" value the "TRACK_ID" tag, but the "GEOMETRY" tag is nowhere to be found for "position". I figure it's the JSON's initial formatting that is causing the hiccup, and I am not sure what sort of field calculation I am supposed to perform so that I get, basically, this:

 

"agency_id": 563, "apc_status": "not_installed", "call_name": "1969", "current_stop_id": 8064840, "heading": 12, "id": 8014243, "load": null, "position": [30.549453, -87.219218], "route_id": 8002908, "segment_id": 8033424, "speed": 0.0, "timestamp": 1415654632000

 

I am hoping that GEP can understand this much easier, as it seems more logical, and create a GED with each item in " " getting its own field automatically. I have a hunch that this isn't going to happen, so what can I do to make it so that my output (eventually a constantly-updating feature service) will remove all the excess nonsense?

Outcomes