Unique Building Identification (UBID)
Website: https://buildingid.pnnl.gov/
Documentation
Install
Add this line to your application's Gemfile:
gem 'pnnl-building_id'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pnnl-building_id
Usage
The pnnl-building_id
package supports one usage:
- Application programming interface (API)
The API
UBID codecs are encapsulated in separate modules:
PNNL::BuildingId::V3
(format: "C-n-e-s-w")
Modules export the same API:
decode(String) ~> PNNL::BuildingId::CodeArea
encode(Float, Float, Float, Float, Float, Float, Integer) ~> String
encode_code_area(PNNL::BuildingId::CodeArea) ~> String
valid?(String) ~> Boolean
In the following example, a UBID code is decoded and then re-encoded:
require 'pnnl/building_id'
code = '849VQJH6+95J-51-58-42-50'
$stdout.puts(code)
code_area = PNNL::BuildingId::V3.decode(code)
$stdout.puts(code_area)
new_code_area = code_area.resize
$stdout.puts(new_code_area)
new_code = PNNL::BuildingId::V3.encode_code_area(new_code_area)
$stdout.puts(new_code)
$stdout.puts(code == newCode)
License
The gem is available as open source under the terms of The 2-Clause BSD License.
Contributions
Contributions are accepted on GitHub via the fork and pull request workflow. See here for more information.