Geocode Coop addresses to lat & long for map

This commit is contained in:
James Mead 2018-11-30 16:56:07 +00:00
parent 8780eca301
commit 3c80693d67
12 changed files with 41 additions and 16 deletions

View File

@ -4,3 +4,5 @@ gem 'jekyll'
# Fixes deprecation warning - see https://github.com/jekyll/jekyll-sass-converter/pull/75
gem 'jekyll-sass-converter', git: 'https://github.com/jekyll/jekyll-sass-converter.git', branch: 'sassc'
gem 'geocoder'

View File

@ -19,6 +19,7 @@ GEM
eventmachine (1.2.7)
ffi (1.9.25)
forwardable-extended (2.6.0)
geocoder (1.5.0)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
@ -62,6 +63,7 @@ PLATFORMS
ruby
DEPENDENCIES
geocoder
jekyll
jekyll-sass-converter!

View File

@ -6,7 +6,7 @@ website: http://alpha.coop/
email: info@alpha.coop
twitter: alpha.coop
github: AlphaCo_op
telephone: '+441912111938'
telephone: "+441912111938"
address: 6 Charlotte Square,Newcastle upon Tyne,United Kingdom,NE1 4XF
latitude: 54.97101
longitude: -1.61974
@ -43,4 +43,4 @@ We deliver on time and within budget.
KNOWING
After 30 years, we know what were doing.
We help you engage with the people you need to reach.
We help you engage with the people you need to reach.

View File

@ -25,4 +25,4 @@ technologies:
Cetis is a cooperative Limited Liability Partnership and an independent Strategic IT consultancy, specialising in learning, education and training.
We offer impartial strategic and technical advice and guidance in educational technology and process innovation, and we provide discovery services, technology solutions and training services. Our Partners and Associates are globally recognised as leading experts on educational technology innovation, interoperability and technology standards. Cetis LLP was established in 2015 by members of the Jisc Innovation Centres Cetis and OSS Watch. As the Centre for Educational Technology, Interoperability and Standards, Cetis has provided, for nearly two decades, impartial, strategic, technical and pedagogical advice on educational technology innovation, collaboration and standards to funding bodies, standards agencies, government, international organisations, institutions and commercial partners.
We offer impartial strategic and technical advice and guidance in educational technology and process innovation, and we provide discovery services, technology solutions and training services. Our Partners and Associates are globally recognised as leading experts on educational technology innovation, interoperability and technology standards. Cetis LLP was established in 2015 by members of the Jisc Innovation Centres Cetis and OSS Watch. As the Centre for Educational Technology, Interoperability and Standards, Cetis has provided, for nearly two decades, impartial, strategic, technical and pedagogical advice on educational technology innovation, collaboration and standards to funding bodies, standards agencies, government, international organisations, institutions and commercial partners.

View File

@ -8,8 +8,8 @@ twitter:
github:
telephone: '07908 592 835'
address: 44 Arkwright Road,London,NW3 6BH
latitude:
longitude:
latitude: 51.5509322
longitude: -0.1833781
clients:
- labour-party
- nesta

View File

@ -8,8 +8,8 @@ twitter: dtc-innovation
github:
telephone: 447455921569
address: London,United Kingdom
latitude:
longitude:
latitude: 51.5073219
longitude: -0.1276474
clients:
- bbc
- data-gouv-fr

View File

@ -8,8 +8,8 @@ twitter: index.html
github:
telephone: "+44 7793650013"
address: Virtual
latitude:
longitude:
latitude: -26.9041798
longitude: -49.0924112
clients:
services:
- branding-and-identity

View File

@ -8,8 +8,8 @@ twitter:
github:
telephone:
address: London
latitude:
longitude:
latitude: 51.5073219
longitude: -0.1276474
clients:
- creating-freedom
- participatory-economics-uk

View File

@ -8,8 +8,8 @@ twitter:
github:
telephone: "+44 1484 846231"
address: Huddersfield
latitude:
longitude:
latitude: 53.6466645
longitude: -1.7822482
clients:
services:
- business-analysis

View File

@ -80,4 +80,4 @@ We are a design co-operative specialising in creative print and web design for t
Our services range from brand and identity development, campaign material, print publications and exhibitions to photography, illustration, web design and development, animation, interactive applications and games!
Please see case studies for some **recent work**.
Please see case studies for some **recent work**.

View File

@ -8,8 +8,8 @@ twitter: weareopen
github: hello%40weareopen.html
telephone: N/A
address: the Internet
latitude:
longitude:
latitude: 19.37218875
longitude: -72.3346544510523
clients:
- creative-commons
- london-clc

View File

@ -0,0 +1,21 @@
require 'bundler/setup'
require 'yaml'
require 'geocoder'
Geocoder.configure(lookup: :nominatim)
root_path = Pathname.new(__dir__).join('..')
Dir[root_path.join('_coops/*.md')].each do |path|
content = File.read(path)
body = content.split("\n").reverse.take_while { |l| l != "---" }.reverse.join("\n")
metadata = YAML.safe_load(content)
address = metadata['address']
latitude, longitude = Geocoder.coordinates(address, params: { region: 'uk' })
metadata['latitude'] ||= latitude
metadata['longitude'] ||= longitude
frontmatter = YAML.dump(metadata)
File.write(path, frontmatter + "---" + "\n" + body)
end