Respected Professor,
Thank you for your very good advice. You are completely right with everything:
a) EPSG:4326 stored in JSON: Done!
Instead of hardcoding them directly in the Python script, the string variables 'EPSG: 4326' are now in the JSON (config) file.
b) Avoid the redundant config_data dictionary: Done! The hardcoded lines were unnecessary and are now removed, since the config_data is also read from the JSON file.
The JSON file is created if it does not yet exist (first start of the software)
The configuration is always read from the JSON file
The redundant hardcoded dictionary is removed
c) Naming is not matching: Done! The watershed_analysis.py will always create and read the corresponding watershed_analysis.json, leading to a perfectly logical relationship between Python file and JSON config.
This in fact created a clean, professional, and maintainable codebase !!
Thank you for these great tips that have strongly improved the code structure.
- Bhuwan