camaraproject / PopulationDensityData

Repository to describe, develop, document and test the Population Density Data API family
Apache License 2.0
3 stars 5 forks source link

Change maxPplDensity, minPplDensity and pplDensity datatype #58

Open bigludo7 opened 1 week ago

bigludo7 commented 1 week ago

Problem description In current API specification we specified that maxPplDensity, minPplDensity or pplDensity are defined as number with format Double.

It means that result could look like:

          "populationDensityData": {
            "dataType": "DENSITY_ESTIMATION",
            "maxPplDensity": 1717.986420914645,
            "minPplDensity": 447.54571167219166,
            "pplDensity": 1717.986420914645
          }

This is a bit odd to project to have 1717.986420914645 people. 1718 is probably better. Should we change this 3 attributes 'format' to integer?

Possible evolution

Alternative solution

Additional context

sachinvodafone commented 1 week ago

Thanks @bigludo7 for bringing this up. I also aligned with you , for most users, understanding 'people per square kilometer' does not require precision beyond whole numbers, as fractional people are not meaningful in our API context .So yes, better to have integer in this case.

gregory1g commented 1 week ago

Technically, "double" does not enforce anyone to return exact math result like "1717.986420914645" in the API. One still can return "1717" or even "1700" if the accuracy is +/- 50ppl/km2 (rounding must also match accuracy). But, yes, integer would be a better type here.