Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only run ARA Analysis if within ARA Perimeter #3218

Merged
merged 3 commits into from Dec 30, 2019
Merged

Conversation

@rajadain
Copy link
Member

rajadain commented Dec 27, 2019

Overview

Adds a hand-drawn perimeter of the ARA raster to check the area of interest against when deciding if it should be queried or not. If it is not within the perimeter, nulls are returned. The shape was drawn by hand as it was the most expedient way to do it:

image

The perimeter is conservative, which is to say that it is smaller than the actual boundary. This is done in the hopes of preempting any edge cases that may query non-existing tiles:

image

This is done without precision. If there is a better way of generating this perimeter from a raster, I'd be up for trying that.

Connects #3209

Demo

image

Testing Instructions

  • Check out this branch
  • Debug Celery $ ./scripts/debugcelery.sh
  • Go to a place in the map other than the Mid Atlantic or North East, select an area of interest
    • Ensure that all analyses complete successfully, including Land
  • Select an area of interest within the Mid Atlantic or North East region
    • Ensure that all analyses complete successfully, including Land
The ARA Raster does not have data outside the North
East and Mid Atlantic regions, and when requests for
outside that area go through they cause exceptions
in the geoprocessing service.

This perimieter, drawn by hand using GeoJSON.io, is
a rough approximation of the outline of the raster.
It errs on the side of conservatism, i.e. it is smaller
than the true perimeter.
@rajadain rajadain added the OSI label Dec 27, 2019
@rajadain rajadain requested a review from mmcfarland Dec 27, 2019
@rajadain

This comment has been minimized.

Copy link
Member Author

rajadain commented Dec 27, 2019

To test the perimeter on https://geojson.io/, use this shape and add this custom map layer:

https://{s}.tiles.azavea.com/ara-30m/{z}/{x}/{y}.png
Copy link
Member

mmcfarland left a comment

Working well. I understand the bounds are a little rough, but I agree that it's a reasonable effort and the lack of precision is likely not problematic. Verified that the Land values match production in non-ARA eligible areas.

src/mmw/apps/geoprocessing_api/tasks.py Outdated Show resolved Hide resolved
@mmcfarland mmcfarland assigned rajadain and unassigned mmcfarland Dec 30, 2019
rajadain added 2 commits Dec 26, 2019
Previously, we would always run the NLCD+ARA request,
which ended up failing when outside the ARA region.
Now we check if the AoI is wholly contained within the
ARA Perimeter and only run NLCD+ARA in that case.
Otherwise we run only NLCD.

The analyze_nlcd task is similarly updated to behave
differently when receiving a tuple of values (indicating
the presence of ARA results) vs not, sending back nulls
instead.

We use null vs 0 here to differentiate absence of ARA
values within the raster with querying outside the bounds.
@rajadain rajadain force-pushed the tt/gatekeep-ara-raster branch from a435072 to 82ae629 Dec 30, 2019
@rajadain rajadain merged commit 1f8f53e into develop Dec 30, 2019
2 checks passed
2 checks passed
default Build finished.
Details
model-my-watershed-pull-requests Build #4132 succeeded in 9 min 31 sec
Details
@rajadain rajadain deleted the tt/gatekeep-ara-raster branch Dec 30, 2019
@rajadain

This comment has been minimized.

Copy link
Member Author

rajadain commented Dec 30, 2019

Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.