-
Notifications
You must be signed in to change notification settings - Fork 1
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
Shattering #13
Comments
Reflecting on this and the paint by county functionality- I think it would be worth testing precomputing vtd and county membership of blocks on ingestion / tile creation so that we can paint by county and shatter based on IDs instead of using turf in the browser. If we were to use turf to shatter, I imagine we would:
If we used an ID, I'd image we'd:
Thoughts? Is this silly? It's a bit less elegant maybe but I'd rather do spatial operations once upon ingestion and then lookup on attributes instead of repeated spatial lookups. I imagine that if this is performant we could also test in on the PaintByCounty (although the actual paint part does seem snippy!) |
I think we should 100% compute block -> parent memberships via the CLI and do no heavy geometry operations like calculating intersections in the browser (i.e. not shatter in browser). I'm 50/50 on adding county membership to tiles. TLDR / train-of-thought thoughts: We should weigh the benefits of a simpler implementation (+1 for adding the county FIPS attribute to tiles) vs. more flexible† (+1 for computing in browser) and perf–the tile rendering is already getting a tad slow on the initial load, esp. for block layers, though you could easily imagine that a fullproof implementation with turf in the browser would get much hairier and less performant, not to mention bundle size concerns. Re: implementation if we add county FIPS to tilesets:
A much simpler implementation is to do what Districtr v1 does and use † More flexible because the function is actually intersection layer agnostic. We could paint by Places, VTDs (e.g. if we had a block layer), arbitrary geo etc. using this implementation. |
Draft proposal for how to do this (and will be my first attempt at this feature). Lmk what you think @mariogiampieri @bailliekova Generating the GerryDB view table and tilesIn general I think it makes sense for shatterable maps to tightly couple the child layer to the parent layer. As such, I'd recommend the GerryDB view in the DB be a union of the child and parent layer with an identical schema. Advantages:
Disadvantages:
Implementation:
Shattering a parentNote Un-shattering is a pretty different feature and not covered here, On document change, add layers:
User splits parent: (from map context menu?)
|
Some adjustments to the above based on a discussion with @bailliekova:
|
Since we don't expect the UNION'ed tables to be changing at all, we can materialize them and create indices over path. |
No description provided.
The text was updated successfully, but these errors were encountered: