AtlasOfLivingAustralia / sds

Sensitive species rules API
https://sds.ala.org.au
0 stars 7 forks source link

Processed `coordinateUncertaintyInMeters` value should not be less than the raw/provided value #65

Open nickdos opened 1 month ago

nickdos commented 1 month ago

Summary

When SDS is processing records for sensitive species from iNaturalist, it is taking values, such as:

decimalLatitude decimalLongitude coordinateUncertaintyInMeters
-36.6381056263 149.5302313127 28505

and processing these to (actual output):

decimalLatitude decimalLongitude coordinateUncertaintyInMeters
-36.64 149.53 1000

In this case (catalog number: 107523407 - record link) the value of 1,000 for the processed record in incorrect, as the data is already provided with a larger value of 28,505.

Expected output is

decimalLatitude decimalLongitude coordinateUncertaintyInMeters
-36.64 149.53 28505

Background

The reason this is tripping up SDS, is the data is already generalised by iNaturalist but it uses an unorthodox method of generalising the coordinates. Instead of rounding the values, it uses an area of 28 km2 around the raw location and then radomly generates a new position inside that 28 km2 area.

SDS takes a conservative approach and does not just "trust" the already generalised flag on these records, as the data provider may use a generalisation method that is not as strict as the rules provided for SDS. So it performs its own generalisation on the coordinates, as seen above.

However, it should respect the provided coordinateUncertaintyInMeters and not use its own calculated value in this case, if the calculated values is less than the provided value.