Skip to content

Instantly share code, notes, and snippets.

@kaaloo
Last active January 29, 2019 22:05
Show Gist options
  • Save kaaloo/c83cac2ca8a9e278bf08afacb64d57f7 to your computer and use it in GitHub Desktop.
Save kaaloo/c83cac2ca8a9e278bf08afacb64d57f7 to your computer and use it in GitHub Desktop.
js I ported
const fs = require('fs')
const path = require('path')
const { featureCollection } = require('@turf/helpers')
const Fuse = require('fuse.js')
const streetAddressesGeoJSON = featureCollection(JSON.parse(fs.readFileSync(path.join(__dirname, 'adresses.json'))))
const streetAddressesFuse = new Fuse(streetAddressesGeoJSON.features.features, {
shouldSort: true,
keys: [
"properties.adresse"
]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment