Closed NealHumphrey closed 8 years ago
Add an admin function that can be called to generate buffers based on the currently loaded lanes
This is great - I'm assuming we'd use turf-buffer for this and it would be added to either the bin or as a script in the package.json
? People could run this locally in their terminal with node.
If so, we should initialize a package.json
for this project, even though the demo will still be client-side and not run on a server. I'd like to add a linter that can be run via npm test
anyway and hook this up to Travis CI.
Yes on turf-buffer and a couple other turf functions.
I'm not that advanced - I'm not familiar with how to set up the rest of that stuff you mention. I was thinking of just making a function called updateBuffer(distance)
that we can call from an /admin.html page. No need to run in the terminal, can just do it in browser.
Just uploaded some filter functionality for selecting region (DC, MoCo, Alex...) and setting buffer size for selected regions. (Changes on my forked version at https://github.com/tomBeach/_hackforgood-waba-map.) Region selection works well but no "reset/clear" option for buffers yet. I'm hoping to post a viewable version to check online... maybe by noon? Will keep you posted!
Here's a link to a "working" version to check out (bugs in the buffers selection...!) but it shows a crude design and basic interactivity... link on my portfolio site: https://tombeach.github.io/hackforgood-waba-map/
@tomBeach this looks good! I haven't checked out the code yet. I'll ping you before I do anything to make sure I'm building on your stuff (won't have a chance to do much until this weekend)
As discussed in https://github.com/dcfemtech/hackforgood-waba-map/issues/65#issuecomment-236662899, I created an initial package.json
in https://github.com/dcfemtech/hackforgood-waba-map/pull/70.
@alulsh sorry but I'm giving up on this for now. I struggled with the nvm-windows tool for a couple hours before falling back to a regular node install, and now I've spent several more hours fighting turf and geojson data structures. I had things working fine in the browser world when the code was using the Mapbox featureLayers to get the geoJSON into the needed format, but now when I try to call turf functions on the loaded json data it returns blank feature collections. This was happening in the starter branch you set up and I couldn't figure out how to fix it.
If you're open to doing it browser side I can make that work - it's easier to see what's going on with the data in the Chrome console instead of command prompts. Otherwise I need to pass this on to someone who knows this stuff better than me.
If you're open to doing it browser side I can make that work
Unfortunately creating the buffers client side is not a great option:
Creating the buffers locally using Node allows for the easy generation of all of the buffers to file/disk. It's also considerably quicker than client-side generation and won't allow a user to crash their own browser. While we could host the admin button on a separate admin page, this still has the core problem of difficult copying and pasting from the console into various files.
Otherwise I need to pass this on to someone who knows this stuff better than me.
In https://github.com/dcfemtech/hackforgood-waba-map/pull/76 @alongthepike mentions that their script "currently supports only Montgomery County, but can be expanded using various strategies to the other jurisdictions". May be worth closing this PR and instead expanding on https://github.com/dcfemtech/hackforgood-waba-map/pull/76 as an admin script to create all the buffer files.
To be clear #76 has nothing to do with generating buffers (it is pulling live bikeway data from MoCo's ArcGIS server).
I DID commit some working code into turf-buffer-admin-function though. Easily expandable to all of the jurisdictions, though it could use some TLC from someone with a better grasp of turf.js than I have. It is really, really slow on my machine and sometimes dies with an out of memory exception.
Thanks Chris! I can probably clean up the turf part, I'll give it a shot.
On Aug 15, 2016 11:39 PM, "Chris Slatt" notifications@github.com wrote:
To be clear #76 https://github.com/dcfemtech/hackforgood-waba-map/pull/76 has nothing to do with generating buffers (it is pulling live bikeway data from MoCo's ArcGIS server).
I DID commit some working code into turf-buffer-admin-function though. Easily expandable to all of the jurisdictions, though it could use some TLC from someone with a better grasp of turf.js than I have. It is really, really slow on my machine and sometimes dies with an out of memory exception.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dcfemtech/hackforgood-waba-map/issues/65#issuecomment-239993269, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYZRtmCJ7Zrs6iCBlOAN5MDgGnBBr-jks5qgTD1gaJpZM4JZtTw .
I believe this is done!
Add an admin function that can be called to generate buffers based on the currently loaded lanes, so that new buffers can be easily created when needed.
Add a percent completed indicator for the user to see progress.