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

Fix running MapShed on AoIs with no streams #2546

Merged
merged 1 commit into from
Dec 5, 2017
Merged

Conversation

rajadain
Copy link
Member

@rajadain rajadain commented Dec 4, 2017

Overview

Previously, if no streams intersected the area of interest, instead of an array of stringified GeoJSON MultiLines, a singleton array would be sent with the only value being null. This caused parse issues in the geoprocessing service.

Now this case is caught on the Celery task itself, and if so we return an empty object immediately, and do not invoke the geoprocessing service at all. This short circuit makes the feedback faster and removes unnecessary communication.

Connects #2518

Demo

2017-12-04 11 57 17

Testing Instructions

  • Check out this branch and restart Celery

    vagrant ssh worker -c 'sudo service celeryd restart'
    
  • Go to :8000/ and turn on the streams overlay

  • Draw a shape deliberately avoiding streams

  • Model with MapShed. Ensure that it works successfully.

  • Download and run this file: mmw-cli.py.txt, which has the test shape from the original issue.

Previously, if no streams intersected the area of interest,
instead of an array of stringified GeoJSON MultiLines, a
singleton array would be sent with the only value being
null. This caused parse issues in the geoprocessing service.

Now this case is caught on the Celery task itself, and if
so we return an empty object immediately, and do not invoke
the geoprocessing service at all. This short circuit makes
the feedback faster and removes unnecessary communication.

Refs #2518 🐛
@arottersman
Copy link

Taking a look now.

Copy link

@arottersman arottersman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, tested!

@arottersman arottersman assigned rajadain and unassigned arottersman Dec 5, 2017
@rajadain rajadain merged commit 611e308 into develop Dec 5, 2017
@rajadain rajadain deleted the tt/fix-null-streams branch December 5, 2017 15:47
@rajadain
Copy link
Member Author

rajadain commented Dec 5, 2017

Thanks for taking a look!

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

Successfully merging this pull request may close these issues.

None yet

3 participants