Closed jyucsiro closed 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.
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.
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"
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).
The functionality has been added and is being used
enable gnaf querying in /location/overlaps