FieldStudiesCouncil / QGIS-Biological-Recording-Tools

QGIS plugin for biological recorders. Created with the FSC Tomorrow's Biodiversity project.
GNU General Public License v3.0
10 stars 4 forks source link

Biological records tool not dealing properly with all invalid GRs #49

Closed burkmarr closed 3 years ago

burkmarr commented 3 years ago

GRs containing a slash (sometimes used to denote several GRs), e.g. ND1069/1070, lead to python errors.

Until this fixed a workaround is to search for such GRs in Excel and either remove them or split into several records.

charlesroper commented 3 years ago

Interesting case @burkmarr. This is a good example of a "weird" grid ref someone might use, @andrewmfsc.

Rich, do you by any chance have a list somewhere of the various forms people use for OS grid refs (that you know of)? With the Atlas work we're doing, we want to handle as many edge cases as we can automatically without requiring users to wrangle the data themselves.

Some context: First step in the Atlas work is data cleansing and aggregation to prepare data for Atlas use (possibly going to use Danfo.js, which looks good). Essentially the same thing as the aggregation tool in the plugin. We could potentially wrap a UI around and users could use it to find and perhaps clean invalid grid refs.

burkmarr commented 3 years ago

I don't have such a list @charlesroper @andrewmfsc . It would be rather useful (and probably quite long!) It's a while since we spoke about atlas work. Since then I've been given the task of developing the BSBI's 2020 online atlas which is due to go online at the back end of next year. To that end I've worked on a number of libraries etc that may be useful to you including these two:

The brc-atlas-bigr library is a general purpose library for dealing with British, Irish and Channel Island grid references and converting backwards and forwards with WGS84. You may find it useful. The brc-atlas library is a work in progress but it is usable and largely documented, it provides an easy interface to producing 'static' atlas maps using D3 and SVG and 'slippy' maps using Leaflet. I've packaged this independently of the work specific to the BSBI atlas because we can potentially use it for lots of BRC work. Both libraries are open source available to all.

charlesroper commented 3 years ago

Wow, I think these could be just what we need. Will investigate. Thanks Rich!

burkmarr commented 3 years ago

Problem was wrong regular expression to ignore whitespace (was also ignoring some other characters).