2 |
3 |
5 | UN/LOCODE database for ForstFS 6 |
7 | 8 | --- 9 |  10 |  11 | 12 | # Overview 13 | 14 | This repository contains instructions to generate UN/LOCODE database for FrostFS 15 | and raw representation of it. FrostFS uses UN/LOCODE in storage node attributes 16 | and storage policies. Inner ring nodes converts UN/LOCODE into human-readable 17 | set of attributes such as continent, country name, etc. 18 | 19 | # Build 20 | 21 | ## Prerequisites 22 | 23 | - Latest [frost] tool(https://github.com/TrueCloudLab/frostfs-node) 24 | - [UN/LOCODE](https://unece.org/trade/cefact/UNLOCODE-Download) 25 | database in CSV format 26 | - [OpenFlight Airports](https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat) 27 | database 28 | - [OpenFlight Countries](https://raw.githubusercontent.com/jpatokal/openflights/master/data/countries.dat) 29 | database 30 | 31 | ## Quick start 32 | 33 | Just run `make` to generate `locode_db` file for use with FrostFS InnerRing nodes. 34 | 35 | ``` shell 36 | $ make 37 | ... 38 | --out locode_db 39 | ``` 40 | 41 | ## Building 42 | 43 | First unzip file with GeoJSON continents from this repository. 44 | ``` 45 | $ gunzip continents.geojson 46 | ``` 47 | 48 | Then run frost command to generate boltDB file. 49 | ``` 50 | $ frost util locode generate --help 51 | generate UN/LOCODE database for FrostFS 52 | 53 | Usage: 54 | frost util locode generate [flags] 55 | 56 | Flags: 57 | --airports string Path to OpenFlights airport database (csv) 58 | --continents string Path to continent polygons (GeoJSON) 59 | --countries string Path to OpenFlights country database (csv) 60 | -h, --help help for generate 61 | --in strings List of paths to UN/LOCODE tables (csv) 62 | --out string Target path for generated database 63 | --subdiv string Path to UN/LOCODE subdivision database (csv) 64 | 65 | $ ./frost util locode generate \ 66 | --airports airports.dat \ 67 | --continents continents.geojson \ 68 | --countries countries.dat \ 69 | --in 2022-1\ UNLOCODE\ CodeListPart1.csv,2022-1\ UNLOCODE\ CodeListPart2.csv,2022-1\ UNLOCODE\CodeListPart3.csv \ 70 | --subdiv 2020-2\ SubdivisionCodes.csv \ 71 | --out locode_db 72 | ``` 73 | 74 | **Database generation might take some time!** 75 | 76 | You can test generated database with `frost`. 77 | ``` 78 | $ frost util locode info --db locode_db --locode 'RU LED' 79 | Country: Russia 80 | Location: Saint Petersburg (ex Leningrad) 81 | Continent: Europe 82 | Subdivision: [SPE] Sankt-Peterburg 83 | Coordinates: 59.88, 30.25 84 | ``` 85 | 86 | # Building Debian package 87 | 88 | The most simple way is to run a make target 89 | 90 | ```shell 91 | $ make debpackage 92 | ``` 93 | 94 | When packages are built, you can clean up the leftover with 95 | 96 | ```shell 97 | $ dh clean 98 | ``` 99 | or 100 | ```shell 101 | $ make debclean 102 | ``` 103 | 104 | 105 | ## License 106 | 107 | This project is licensed under the CC Attribution-ShareAlike 4.0 International - 108 | see the [LICENSE](LICENSE) file for details 109 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | v0.3.1 2 | -------------------------------------------------------------------------------- /continents.geojson.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-locode-db/57e3883160e19a3522ad9b8c3f1f39047fc9a421/continents.geojson.gz -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | frostfs-locode-db (0.3.0) stable; urgency=medium 2 | 3 | * Initial change. 4 | 5 | -- TrueCloudLab