LukePrior / nbn-upgrade-map

Interactive map showing premises eligible for the NBN FTTP upgrade program.
https://nbn.lukeprior.com/
MIT License
124 stars 11 forks source link

Possible issues with float-precision on location coordinates #279

Closed lyricnz closed 10 months ago

lyricnz commented 11 months ago

Lots of changes like:

    "geometry": {
     "type": "Point",
     "coordinates": [
-     145.197457,
+     145.19745699999999,
      -37.787261
     ]
    },

vs

sqlite> select * from address_principals where gnaf_pid == 'GAVIC420135795' limit 20;
GAVIC420135795|13 CONOS COURT|DONVALE|3111|VIC|-37.787261|145.197457

Hint at a problem with float-precision. Maybe we should round lat/long to 6dp, or use an arbitrary-precision type?

lyricnz commented 11 months ago

FWIW I have no idea how to override the representation of a float in json.dump(). Can't even monkeypatch it (sanely) because it uses an inner function. I tried making a custom JSONEncoder and a custom float-ish class, but only succeeded in making a string output.

lyricnz commented 11 months ago

I can't figure out how to reproduce this anymore...

lyricnz commented 10 months ago

Maaaaybe resolved by the update to running GHA with newer python?