mgastner / cartogram-cpp

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

Bugfix: Upscaling Near-Zero Population Geodivs #152

Closed edliau closed 10 months ago

edliau commented 2 years ago

The code already has something similar to our desired outcome of rescaling area < total_inset_area * epsilon to total_inset_area * epsilon under the replace_missing_and_zero_target_areas() function under cartogram_info.cpp. I believe the bug with Singapore occurs because the code calls small_area_threshold_frac as epsilon. I believe this defaults to ~0.00001 (0.001% of target inset areas), which results in negligibly small rescalings. I've amended this to be 0.001 (0.1%) of total_inset_area, allowing and cartogram to return something which looks more reasonable.

I've left the geojson and csv of Singapore in the sandbox for review.