dcfemtech / hackforgood-waba-map

DCFemTech Hack for Good 2016 - WABA Bike Map Project
MIT License
10 stars 9 forks source link

[WIP] Admin script to generate buffers #74

Closed alulsh closed 8 years ago

alulsh commented 8 years ago

Initial stab at writing an admin function to generate buffers for geojson bike lane files.

To run the admin script, from the root directory of the repo, run npm run buffers.

Seeing several errors here that we'll need to fix as a team (hence why this is a Work in Progress) PR, including:

/Users/alexandraulsh/hackforgood-waba-map/node_modules/turf-buffer/index.js:40
    var buffered = normalize(featureCollection(fc.features.map(function (f) {
                                                 ^

TypeError: Cannot read property 'features' of null
    at module.exports (/Users/alexandraulsh/hackforgood-waba-map/node_modules/turf-buffer/index.js:40:50)
    at end (/Users/alexandraulsh/hackforgood-waba-map/scripts/generate-buffers.js:29:28)
    at Queue._call (/Users/alexandraulsh/hackforgood-waba-map/node_modules/d3-queue/build/d3-queue.js:42:56)
    at maybeNotify (/Users/alexandraulsh/hackforgood-waba-map/node_modules/d3-queue/build/d3-queue.js:108:34)
    at Queue.queue.await (/Users/alexandraulsh/hackforgood-waba-map/node_modules/d3-queue/build/d3-queue.js:43:7)
    at Object.<anonymous> (/Users/alexandraulsh/hackforgood-waba-map/scripts/generate-buffers.js:34:3)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)

Refs https://github.com/dcfemtech/hackforgood-waba-map/issues/65.

/cc @NealHumphrey

alongthepike commented 8 years ago

Just made a commit seems to successfully create 1mile buffers for both Arlington & DC for me, though it takes a really long time.

tcql commented 8 years ago

though it takes a really long time

👋 @alongthepike just chiming in real quick; we're aware of buffer issues in turf (including speed). We're currently using JSTS inside turf, and we'd love to get away from it, as it's something of a black box in terms of performance and behavior. We always welcome contributions too, if you ever want to dive into what makes turf tick 😁

alongthepike commented 8 years ago

Merged with master, resolved package.json conflict.

alulsh commented 8 years ago

Awesome! Merging.