cityjson / cjio

CityJSON/io: Python CLI to process and manipulate CityJSON files
MIT License
119 stars 31 forks source link

Fix convertion to lat lon #174

Closed GinaStavropoulou closed 1 year ago

GinaStavropoulou commented 1 year ago

Fixed the projection from projected to geographic CRS. There were 2 problems:

  1. When a file was reprojected, the same number of important digits was used as in the original file. I fixed this to keep the original number only if both CRS are projected or if both are geographic. Otherwise for geographic I keep 6 important digits and 3 for projected. :

    image
  2. Even though the scale was float, if we had more that 3 important digits the json.dumps would convert the float to its scientific form. This would cause the city.json to have the scale in scientific form. I had to tweak the encoder to do that. Found the answer here: https://stackoverflow.com/a/70154903/3709062

This is how a 3DBAG tile looked like when transformed to 4979 before(pink) and after (blue):

image