You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Calculate Geometry stores area_km2 and perimeter_km rounded to 2 decimals, so small polygons get 0.0 #513
I searched the existing issues and did not find a duplicate.
This is a bug report, not a usage question.
What happened?
calculateGeometry writes area_km2 and perimeter_km as Double fields, but the values are rounded to two decimals, i.e. to 0.01 km² (1 ha) and 0.01 km (10 m). Any polygon smaller than about half a hectare gets area_km2 = 0.0. This affects many building footprints and small parcels.
The rounding is explicit in the code (tools.rs#L780-L795), also for length_km of lines:
*v = Value::Float((a / 1e4).round() / 100.0);
Steps to reproduce
Save as squares.csv (three squares of 50 m, 100 m and 1 km in EPSG:25832):
Store the computed values without explicit rounding; apply display formatting only in the UI. For the 50 m square, the unrounded value from RustGIS's formula is about 0.0024927 km². Alternatively m² / m fields, or a units or precision option.
How are you running RustGIS?
Command line (rustgis-cli)
Version
main @ a38ad43 (built from source, 2026-10-18). Also reproduced with the Python package rustgis 0.3.0 from PyPI. Also reproduced on Windows with RustGIS 0.3.0 via its MCP server (same values for an EPSG:4647 version of the file).
Activity
Analysis: Calculate Geometry keeps full-precision values (#520)