https://github.com/renuo/swiss_village_directory
Provides a wrapper around the geo admin data set of the Ortschaftenverzeichnis
https://github.com/renuo/swiss_village_directory
postleitzahl r-josuaschmid switzerland zip-code
Last synced: about 1 year ago
JSON representation
Provides a wrapper around the geo admin data set of the Ortschaftenverzeichnis
- Host: GitHub
- URL: https://github.com/renuo/swiss_village_directory
- Owner: renuo
- License: mit
- Created: 2016-07-06T08:09:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2025-03-31T19:03:12.000Z (about 1 year ago)
- Last Synced: 2025-04-20T10:09:45.374Z (about 1 year ago)
- Topics: postleitzahl, r-josuaschmid, switzerland, zip-code
- Language: Ruby
- Size: 345 KB
- Stars: 5
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://travis-ci.org/renuo/swiss_village_directory)
# Swiss Village Directory
This gem provides a data set of all swiss villages taken out of the
"Ortschaftenverzeichnis" ([ch.swisstopo-vd.ortschaftenverzeichnis_plz][4])
The data set made available through a ruby object called [`Village`](https://github.com/renuo/swiss-village-directory/blob/master/lib/swiss_village_directory/village.rb) 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][5]
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'swiss_village_directory'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install swiss_village_directory
## Usage
Require the library
```ruby
require 'swiss_village_directory'
```
Find by attributes:
```ruby
SwissVillageDirectory.repository.find_all_by(name: 'Riedt b. Erlen')
```
or implement your own search logic
```ruby
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:
* [Contributing][1]
* [Code of Conduct][2]
## License
Copyright (c) 2016 [Renuo AG]
[MIT License][3]
[1]: CONTRIBUTING.md
[2]: CODE_OF_CONDUCT.md
[3]: LICENSE
[4]: https://data.geo.admin.ch/ch.swisstopo-vd.ortschaftenverzeichnis_plz/
[5]: https://data.geo.admin.ch/ch.swisstopo-vd.ortschaftenverzeichnis_plz/ortschaftenverzeichnis_plz/ortschaftenverzeichnis_plz_4326.csv.zip
[Renuo AG]: https://www.renuo.ch