mgastner / cartogram-cpp

Cartogram generator in C++
MIT License
8 stars 4 forks source link

Reduce decimal precision in output to minimize file size #215

Open atima opened 3 weeks ago

atima commented 3 weeks ago

The output contains an excessive number of decimal points (e.g., 170.86789491627363), which is unnecessary and increases the file size of both GeoJSON and SVG. Should we limit the precision to 1-4 decimal points?

Related article: https://css-tricks.com/understanding-and-manually-improving-svg-optimization/

adisidev commented 3 weeks ago

@nihalzp is this something viable? I remember you mentioning that there is some sort of rounding that we do that has been helpful in removing intersections, and we need some degree of precision to not have intersections, but could we reduce the number of decimal places in the output without any problems?