No need to write cast positions back to the map object. json seems to store real numbers.
replace all try-int tests with a method call.
wrap json access in a MapConfig object.
Save the output file in the same directory as the input file