JSON to Points
We currenlty have a program that uses a text file to create an XY Event Layer which is displays events in a viewer. Is there an equivalent funcionality in workflow? We are conceptualizing a workflow to take coordinates from a JSON url and display the coordinates as points in a GE viewer. What workflow activity or activities would be used to take these coordinates once converted to a dictionary/list to a graphic or feature to make them visible in the viewer?
Anyone have experience with this or are trying to do the same thing?
Stephanie Patterson
0
-
Use the WebRequest module to grab the JSON. Import the Newtonsoft JSON libraries and parse the webrequest into a list. Iterate the JSON creating graphics and display in the viewer or use the List to FeatureSet module to do it also. 0 -
Tom,
We are still fairly new to workflows so we have some follow on questions to get some specifics on your instructions. How exactly do we use the Newtonsoft JSON libraries to parse the webrequest into the list? What are the pros and cons of creating graphics vs using the List to FeatureSet activity? Ultimately we are trying to virtually add these points to the viewer, and no really write them to a geodatabase. Any further guidance you can add would be helpful!
Stephanie0 -
Within the Workflow Designer you can import additional libraries for a variety of purposes. The NewtonSoft JSON library just makes parsing JSON easier (http://www.newtonsoft.com/json/help/html/Introduction.htm), however, I have been know to deserialize the JSON and extract out what I need using String functions.
Honestly, I have never used the List to FeatureSet activity. It wasn't around when we first started using Geocortex and we've have our own code that we've used over the years that we know. If I were starting out, I would probably try the List to FeatureSet activity first before creating graphics and appending them to a FeatureSet.
What I would recommend is to look through the Code Gallery, there are several examples in there.0
Please sign in to leave a comment.
Comments
3 comments