ncss-tech / soilDB

soilDB: Simplified Access to National Cooperative Soil Survey Databases
http://ncss-tech.github.io/soilDB/
GNU General Public License v3.0
81 stars 20 forks source link

.pickBestEcosite() consideration of record_when_last_updated #295

Open natearoe opened 1 year ago

natearoe commented 1 year ago

In the absence of Correlation Date being populated in the Site > Site Ecological Site History table, the .pickBestEcosite() function would benefit from considering the record_when_last_updated field to determine the best ecosite.

brownag commented 1 year ago

Thanks for pointing this out Nate. All NA correlation date (for example) seems to lead to instability in sort order depending on data source (e.g. NASIS v.s. SQLite). I've added a correction to use recwlupdated in lieu of ecositecorrdate.

There are several other instances where this kind of non-deterministic sorting sneaks into child tables: taxmoistscl, landform, landscape. You also mentioned transect ID. I will leave this issue open until I have a chance to investigate and resolve the other related issues.