Git Product home page Git Product logo

static-distance's Introduction

To generate outcodes:

awk -F, -f split_outcodes.awk ukpostcodes.csv

To select 200k postcodes at random

shuf -n 200000 ukpostcodes.csv > target/pubs.csv

To create a list of random pub names

paste -d "," <(paste -d " " <(shuf -r animal_names.txt) <(yes "and") <(shuf -r animal_names.txt) | head -200000) target/pubs.csv > target/named_pubs.csv

Explanation:

  • shuf -r animal_names.txt creates a list of randomly selected animal names.
  • yes "and" just repeats "and" over and over
  • the past -d " " ... concatenates all those, so we get a good combination of fake establishment names
$ paste -d " " <(shuf -r animal_names.txt) <(yes "and") <(shuf -r animal_names.txt) | head -10
Flameback and Asiatic leopard
Guillemot and Magpie
Zebra and White ibis
Wallaby and Rabbit
Polecat and Mole
Towhee and Petrel
Wader and Quetzal
Kākāriki and Condor
Piping shrike and Recurvebill
Badger and Zebra
  • the outer paste, just merges the fake pub names with the previously selected 200k postcodes to derive a list of establishments.

Finding the minimum lat/lon:

$ gunzip -dc ukpostcodes.csv.gz | grep -v 99.9999990 | cut -f3 -d, | awk -F, 'BEGIN { max = -999; min = +999; } /[0-9.-]+/ { if ($1 > max) max = $1; if ($1 < min) min = $1; } END { print min, max; }'
49.181941000000000 60.800793046799900
$ gunzip -dc ukpostcodes.csv.gz | grep -v 99.9999990 | cut -f4 -d, | awk -F, 'BEGIN { max = -999; min = +999; } /[0-9.-]+/ { if ($1 > max) max = $1; if ($1 < min) min = $1; } END { print min, max; }'
-8.163139000000000 1.760443184261870

Village names pulled from http://download.geonames.org/export/dump/

static-distance's People

Contributors

beny23 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.