Skip to content

Provides a wrapper around the geo admin data set of the Ortschaftenverzeichnis

License

Notifications You must be signed in to change notification settings

renuo/swiss_village_directory

Repository files navigation

Build Status

Swiss Village Directory

This gem provides a data set of all swiss villages taken out of the "Ortschaftenverzeichnis" (ch.swisstopo-vd.ortschaftenverzeichnis_plz) The data set made available through a ruby object called Village contains the following fields.

  • name
  • zip_code
  • one_digit_spare
  • commune
  • canton
  • latitude (WGS84)
  • longitude (WGS84)

The data source can be downloaded as CSV here: PLZO_CSV_WGS84.zip

Installation

Add this line to your application's Gemfile:

gem 'swiss-village-directory'

And then execute:

$ bundle

Or install it yourself as:

$ gem install swiss-village-directory

Usage

Require the library

require 'swiss_village_directory'

Find by attributes:

SwissVillageDirectory.repository.find_all_by(name: 'Riedt b. Erlen')

or implement your own search logic

SwissVillageDirectory.villages.find { |v| v.name == 'Riedt b. Erlen' }

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

If you would like to contribute, you're very welcome to.

Please follow these instructions:

License

Copyright (c) 2016 Renuo AG

MIT License

About

Provides a wrapper around the geo admin data set of the Ortschaftenverzeichnis

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •