WIP: Source of UN/LOCODE database generated by FrostFS CLI.
Find a file
Stanislav Bogatyrev 87d9df1de1 [#2] Update DB
Update to version 2022-2

Signed-off-by: Stanislav Bogatyrev <s.bogatyrev@yadro.com>
2023-01-12 17:26:17 +03:00
.github Change logo 2023-01-07 18:09:08 +03:00
debian [#1] frostfs-cli dependency fixed 2023-01-12 15:12:41 +03:00
.gitignore [#11] Fix lintian warnings 2022-10-28 09:05:48 +03:00
CHANGELOG.md Rebranding 2022-12-22 16:28:24 +03:00
continents.geojson.gz Initial commit 2021-02-10 15:04:51 +03:00
LICENSE Initial commit 2021-02-10 15:04:51 +03:00
Makefile [#2] Update DB 2023-01-12 17:26:17 +03:00
README.md Rebranding 2022-12-22 16:28:24 +03:00
VERSION Rebranding 2022-12-22 16:28:24 +03:00

NeoFS

UN/LOCODE database for ForstFS


GitHub release GitHub license

Overview

This repository contains instructions to generate UN/LOCODE database for FrostFS and raw representation of it. FrostFS uses UN/LOCODE in storage node attributes and storage policies. Inner ring nodes converts UN/LOCODE into human-readable set of attributes such as continent, country name, etc.

Build

Prerequisites

Quick start

Just run make to generate locode_db file for use with FrostFS InnerRing nodes.

$ make
...
--out locode_db

Building

First unzip file with GeoJSON continents from this repository.

$ gunzip continents.geojson

Then run frost command to generate boltDB file.

$ frost util locode generate --help
generate UN/LOCODE database for FrostFS

Usage:
  frost util locode generate [flags]

Flags:
      --airports string     Path to OpenFlights airport database (csv)
      --continents string   Path to continent polygons (GeoJSON)
      --countries string    Path to OpenFlights country database (csv)
  -h, --help                help for generate
      --in strings          List of paths to UN/LOCODE tables (csv)
      --out string          Target path for generated database
      --subdiv string       Path to UN/LOCODE subdivision database (csv)

$ ./frost util locode generate \
  --airports airports.dat \
  --continents continents.geojson \
  --countries countries.dat \
  --in 2022-1\ UNLOCODE\ CodeListPart1.csv,2022-1\ UNLOCODE\ CodeListPart2.csv,2022-1\ UNLOCODE\CodeListPart3.csv \
  --subdiv 2020-2\ SubdivisionCodes.csv \
  --out locode_db

Database generation might take some time!

You can test generated database with frost.

$ frost util locode info --db locode_db --locode 'RU LED'
Country: Russia
Location: Saint Petersburg (ex Leningrad)
Continent: Europe
Subdivision: [SPE] Sankt-Peterburg
Coordinates: 59.88, 30.25

Building Debian package

The most simple way is to run a make target

$ make debpackage

When packages are built, you can clean up the leftover with

$ dh clean

or

$ make debclean

License

This project is licensed under the CC Attribution-ShareAlike 4.0 International - see the LICENSE file for details