I want to download the input from an app to reuse it in another instance or other application, possibly outside of Viktor.
In the downloaded data the accuracy of GeoPoints is reduced to three decimals, with an unnecessary scientific e+00 or e+01. The result is that my geometries are about ~100 m off their location (see Accuracy of decimal places in LatLon
I would like the accuracy to be increased to 6 decimals (~0.1 m) and the numbers could be changed to standard float format.
Hi Thomas, can you elaborate on where you download this data from?
Hi Kevin,
I use the lastsavedparams in the API.
In the mean time I did find a solution, but did not find time to report it yet.
For future reference:
With DownloadResult(json.dumps(export, default=vars), "file_name.json")
the GeoPoints are reduced to dictionaries with lat and lon as keys and enough decimal places. These can then later be strung together to a GeoPolyline.
Ah I see what you mean. The params (or last_saved_params) may contain objects, for example:
- ColorField →
Color
object in the params - DateField →
datetime.date
object in the params - GeoPointField →
GeoPoint
object in the params - etc.
If you print the params, you will see a “representation” of the params, so something like “GeoPoint(lat=5.192e+01, lon=4.476e+00)”. To get the actual lon or lat value you could call params.geo_point.lat
.
I am curious about your example, what is vars
in your case?