CSIRO-enviro-informatics / loci-integration-api

This application provides a convenient interface for executing common functions across the whole LOCI system.
0 stars 3 forks source link

turn on gnaf dataset in /location/overlaps #33

Closed jyucsiro closed 4 years ago

jyucsiro commented 4 years ago

enable gnaf querying in /location/overlaps

benjaminleighton commented 4 years ago

The current overlaps endpoint doesn't do GNAF area based logic. So when areas and/or proportions are specified to be included the logic will return an error indicating areas are unavailable for GNAF.

The overlaps endpoint with crosswalks enabled reuses the overlaps endpoint logic. In its current implementation it expects to be distributing an area from the specified query "uri" to targets across the related U shape. That is the area is distributed to things within it, things overlapping, and things that contain the overlapping things (the other side of the U).

Adapting this needs to account for two broad cases. One is when we are asking for the crosswalk overlaps for a GNAF uri.

Perhaps in this case the logic should:

The other case is when we are asking for a crosswalk overlap from some object with area e.g an SA2 to a GNAF entity.

In this case the logic might:

I'm not sure but in any case the logic for crosswalks overlaps will need to be carefully modified, probably adding a bunch of conditionals, to deal with this case.

benjaminleighton commented 4 years ago

I've implemented half of the functionality that I think is required. crosswalk overlaps queries now will return gnaf hierarchy objects on the "to" side of the query if they overlap with the "from" uri. No amount of overlap is provided. No area for the objects in the gnaf hierarchy are returned. There isn't logic yet to deal with crosswalk overlaps queries from something in the gnaf hierarchy.

benjaminleighton commented 4 years ago

for GNAF "from something with no area to things with area and report "nan" for reversePercentage but "100%" for forwardPercentage and set the intersection area to 0"

benjaminleighton commented 4 years ago

Probably for point to polygon and other use cases would be good to switch back on isContains / isWithin functionality (like in the non overlaps cache).

jyucsiro commented 4 years ago

The functionality has been added and is being used