Project

General

Profile

Actions

Bug #19017

open

Error occured while calculating the union of bounding boxes

Added by Yannis Marketakis about 5 years ago. Updated about 5 years ago.

Status:
In Progress
Priority:
High
Target version:
Start date:
Apr 06, 2020
Due date:
% Done:

10%

Estimated time:

Description

An error occurred while calculating the union of the bounding boxes of the following records:

The geometries are:

The result reports that the geometries are invalid. Find attached the detailed log.


Files


Related issues

Related to StocksAndFisheriesKB - Task #18313: Approve-Merge-Annotate GRSF records (RAM vs FishSource)ClosedAureliano GentileDec 17, 2019

Actions
Actions #1

Updated by Yannis Marketakis about 5 years ago

  • Related to Task #18313: Approve-Merge-Annotate GRSF records (RAM vs FishSource) added
Actions #2

Updated by Emmanuel Blondel about 5 years ago

Not sure which geoservice you used for that, but if you used the simple one (with geometry strings as inputs), it doesn't expect a geojson string but a simple string "minx,miny,maxx,maxy" eg -180,-90,180,90

If you can send me the inputs you used for the algorithm i'll start from there.

Thanks

Actions #4

Updated by Emmanuel Blondel about 5 years ago

Ok i was looking at intersect service, sorry. Indeed this service has nothing special and should work. I look at it right now.

Actions #5

Updated by Emmanuel Blondel about 5 years ago

  • % Done changed from 0 to 10

The log is clear: isFALSE R function is not available, which is normal because from the logs Dataminer runs in R 3.4.4 and isFALSE function is only available from R 3.5.0

I had a check of R package functions used in the algorithm and based on recent package versions, none is using isFALSE. I'm waiting for https://support.d4science.org/issues/19018 to be solved Once I can repackage the algorithm I will further inspect package versions in use and see if isFALSE is used, although I doubt of that, since in general R package developers know that using isFALSE is not recommended for backward compatibility with R < 3.5.x

In the meantime, I'd suggest to CNR team to have a look to R algorithm wrappers (SAI/Dataminer) and see if isFALSE was somehow introduced (maybe to deal with algorithm inputs check/control). If it's the case, it should be substituted by !isTRUE (safe), or R should be upgrade at least to 3.5

Actions #6

Updated by Aureliano Gentile about 5 years ago

Dear colleagues, let me step in as I feel I miss some knowledge here.
Let's take the case a FIRMS (sourced) stock record is asked to be merged with a FishSource stock record.
FIRMS record is "dominant" therefore the species and area codes are retained in the new merged records.

If the above is clear, why do we need to compute union of bounding boxes?

(I am surely missing something for which I say thank you in advance for your clarifications.)

Actions #7

Updated by Yannis Marketakis about 5 years ago

Your comment is correct, However I see that is is part of the agreed merging workflow (documented in https://support.d4science.org/projects/stocksandfisherieskb/wiki/18-11-16-GRSF_validation#Union-of-Polygons-bboxes-in-case-of-merge-records).

Let me know if you wish to change that and stick to the polygon of the dominant record.

Actions #8

Updated by Emmanuel Blondel about 5 years ago

  • Priority changed from Normal to High

@marketak@ics.forth.gr i've further checked the algorithm and package versions.

The responsible of this bug (isFALSE function) is called in a dependent R package geojsonio (or depends of it). I confirm it's not an issue with Dataminer/e-infra, but likely a bad use of isFALSE in some package. Somehow the package was upgraded (logically) on the e-infra while we sticked using R 3.4.4, leading to the incompatibility.

I'm investigating further the issue source, and see if I can apply a patch for us.


Package versions

  • sp: 1.4.1
  • jsonlite: 1.6.1
  • geojsonio: 0.9.0
  • rgeos: 0.5.2
Actions #9

Updated by Aureliano Gentile about 5 years ago

Thanks @marketak@ics.forth.gr , and thanks for having found the relevant discussion on this matter.

I suspect that both replies (combine/not combine bboxes) will raise issues in any case.
But I think you are already applying the logic of the dominant record for building the semantic identifiers and other identity metadata in the GRSF record.
So it would make sense to apply the same logic to the geospatial coordinates, i.e. inherit only those from the dominant record and ignore the others.

As we do not know today if for any case it is better to join, do you think is viable to keep both and for the time being return to the record only the dominant one and not the combination?
Do you see any issue or overwhelming complexity?

Actions #10

Updated by Emmanuel Blondel about 5 years ago

  • Status changed from New to In Progress

Tracking deep in R, issue was in sf package. For this we need to wait it's fixed and published on CRAN, hopefully soon, afterwhat the fix will be transparently applied by e-infra nightly R package installs.

See FYI: https://github.com/r-spatial/sf/commit/f8f52beb82262eb74a907c158513e604d7a47328

Actions #11

Updated by Yannis Marketakis about 5 years ago

Thank you both for your answers.

@aureliano.gentile@fao.org the rationale behind the union of polygons was decided before proposing the dominant record, and that's the reason for having it in place in the merging workflow. I am OK with your suggestion (about using the polygon of the dominant record (if it exists). I'll just have to do some small modifications in the workflow.

Actions #12

Updated by Aureliano Gentile about 5 years ago

With many thanks, we keep going learning in this process...

Actions #13

Updated by Yannis Marketakis about 5 years ago

So, @emmanuel.blondel1@gmail.com feel free to close this issue and postpone the updates. We'll move on using the polygon of the dominant record instead of calculating the union.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 8.91 MB)