Send Close Add comments: (status displays here)
Got it!  This site "www.robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
Location text data conversion
by RS  admin@robinsnyder.com : 1024 x 640


1. Location text data conversion
This page shows an example of converting a list of locations and geographic coordinates in text form to JSON form as in intermediate representation for a clustering application.

The cities are located in Pennsylvania.

Source: https://www.mapsofworld.com/usa/states/pennsylvania/lat-long.html (2020-02-05)

2. Data flow
Data flow of dataIn this case, the "used data" is the data is used in some application for analysis and/or decision-making.

Note that as one develops a (data flow) system for processing and analyzing data, one may need to return to part of the data flow to redo or change how that data is processed.

3. Text to JSON
The following program takes the raw text data and converts it to JSON. I have found that even if one only wants a list of data, it is best to always create the JSON as a dictionary and make the data list part of that dictionary.

One almost always finds a later need for additional parts of the data that need added and a dictionary makes it easy to add those other parts. Here is the Python code [#1]

The JSON is then saved to a file to be used by other programs.

Here is the output of the Python code.


4. Summary
The above is one way to get text data into a desired form.

5. End of page

by RS  admin@robinsnyder.com : 1024 x 640