StoXProject / RstoxData

R library for reading various biotic and acoustic data formats
https://stoxproject.github.io/RstoxData/
GNU Lesser General Public License v3.0
0 stars 1 forks source link

unsupported variants landingerv2 #315

Open edvinf opened 1 year ago

edvinf commented 1 year ago

There seems to be some deviations from standard keying of the xml-landing format. TV provides an example for S. mentella i 2006, where the 13 key fields does not uniquely identify the data fields. Need to catch in parsing, and possibly report to data providers. May also have implications for conversion functions in other libraries (RstoxFDA).

edvinf commented 1 year ago

Another example may be found in 2011.

edvinf commented 1 year ago

I have checked some of the deliveries from Fdir in the LSS format, which is also the source for the landings API which provides the xml files. The assumption that Dokumentnummer and Linjenummer identifies a row is occasionally violated. Most violations include rows where weights are zero, but in some cases it involves positive weights. In 2014 two sales-note-lines are repeated with only the weight differing (among the fields parsed by RstoxData). In general the issue is more prevalent in older data, and it is likely to hit some of the stocks we use ECA for, when time-series are extended backwards.

In the StoX-pipeline the issue is detected when converting to StoXLanding, but this is too late for script-usage, which may use the data directly from readXmlFile or ReadLanding. We are also not providing any means in the StoX pipeline to deal with the issue. We are only detecting and providing an error. I will consider the following fixes: