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

Convert watersheds to GeoJSON ahead of time #69

Open
kdeloach opened this issue Mar 21, 2017 · 0 comments
Open

Convert watersheds to GeoJSON ahead of time #69

kdeloach opened this issue Mar 21, 2017 · 0 comments

Comments

@kdeloach
Copy link

Overview

The biggest performance bottleneck of the RWD API is converting watersheds to GeoJSON. By converting subwatersheds to GeoJSON ahead of time, we can skip the most time consuming part of the watershed delineation process.

Instead of merging 1 or more subwatersheds into a single shapefile, and serializing that-- we could pass subwatershed IDs to the client, fetch the precomputed GeoJSON files there, and merge them client-side.

Plan

  1. Convert subwatersheds to GeoJSON and upload to S3
  2. Modify RWD to return subwatershed IDs instead of a shapefile
  3. Load subwatershed features from S3 client-side
  4. Merge features client-side using turf(?)

Questions

  1. Is the output from RWD always the dissolved result of 1 or more static subwatersheds?
  2. Are subwatersheds used in any calculations, or do they exist purely to generate output?
  3. Are the Main_Watershed files used in the output?

Notes

This doesn't change our strategy to simplify shapes since there is still a speed vs. size trade off to consider.

Since we don't need to produce a shapefile from dissolving subwatersheds, we may be able to eliminate the subwatershed shapefiles from our Worker instances which may result in less disk space usage.

Someone with greater RWD knowledge would have to decide how feasible this is.

@ajrobbins ajrobbins added the 1 label Mar 23, 2017
@ajrobbins ajrobbins removed the 1 label Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants