|
1 | | -# Introduction |
2 | | -TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project. |
| 1 | +# NGI KOF Parser |
| 2 | + |
| 3 | +This is the NGI Python package for parsing kof files. |
| 4 | + |
| 5 | +References: |
| 6 | + |
| 7 | +NORWEGIAN GEOTECHNICAL SOCIETY |
| 8 | +- [NGF - VEILEDNING FOR |
| 9 | +SYMBOLER OG DEFINISJONER I GEOTEKNIKK](http://ngf.no/wp-content/uploads/2015/03/2_NGF-ny-melding-2-endelig-utgave-2011-12-04-med-topp-og-bunntekst-Alt-3.pdf) |
| 10 | +- [Norkart KOF specification](http://www.anleggsdata.no/wp-content/uploads/2018/04/KOF-BESKRIVELSE-Oppdatert2005.pdf) |
| 11 | + |
| 12 | +Latest releases see [CHANGES.md](CHANGES.md) |
| 13 | + |
| 14 | +# Installation (end user) |
| 15 | + |
| 16 | +```bash |
| 17 | + |
| 18 | +pip install ngi-kof-parser |
| 19 | + |
| 20 | +``` |
| 21 | + |
| 22 | +## Basic usage |
| 23 | + |
| 24 | +```python |
| 25 | +from ngi_kof_parser import KOFParser |
| 26 | + |
| 27 | +parser = KOFParser() |
| 28 | + |
| 29 | +# ETRS89/NTM10: |
| 30 | +srid = 5110 |
| 31 | +locations = parser.parse('tests/data/test.kof', srid) |
| 32 | + |
| 33 | +for location in locations: |
| 34 | + print(location) |
| 35 | + |
| 36 | +# Output: |
| 37 | +# name='SMPLOC1' point_easting=112892.81 point_northing=1217083.64 point_z=1.0 srid=5110 methods=[] |
| 38 | +# name='SMPLOC2' point_easting=112893.15 point_northing=1217079.46 point_z=2.0 srid=5110 methods=['TOT'] |
| 39 | +# name='SMPLOC3' point_easting=112891.88 point_northing=1217073.01 point_z=0.0 srid=5110 methods=['CPT'] |
| 40 | +# name='SMPLOC4' point_easting=112891.9 point_northing=1217067.54 point_z=0.0 srid=5110 methods=['RP'] |
| 41 | +# name='SMPLOC5' point_easting=112902.92 point_northing=1217074.73 point_z=0.0 srid=5110 methods=['SA'] |
| 42 | +# name='SMPLOC6' point_easting=112901.11 point_northing=1217069.56 point_z=0.0 srid=5110 methods=['PZ'] |
| 43 | +# name='SMPLOC7' point_easting=1217069.56 point_northing=112901.11 point_z=0.0 srid=5110 methods=['PZ'] |
| 44 | + |
| 45 | +``` |
| 46 | + |
| 47 | +# Getting Started developing |
| 48 | + |
| 49 | +1. Software dependencies |
| 50 | + |
| 51 | + - Python 3.9 or higher |
| 52 | + - Poetry |
| 53 | + - black code formatter |
| 54 | + |
| 55 | +2. Clone this repository |
| 56 | + |
| 57 | +3. Install |
| 58 | + |
| 59 | + `poetry install` |
| 60 | + |
3 | 61 |
|
4 | | -# Getting Started |
5 | | -TODO: Guide users through getting your code up and running on their own system. In this section you can talk about: |
6 | | -1. Installation process |
7 | | -2. Software dependencies |
8 | | -3. Latest releases |
9 | | -4. API references |
10 | 62 |
|
11 | 63 | # Build and Test |
12 | | -TODO: Describe and show how to build your code and run the tests. |
13 | 64 |
|
14 | | -# Contribute |
15 | | -TODO: Explain how other users and developers can contribute to make your code better. |
| 65 | +Run in the project root folder: |
| 66 | + |
| 67 | + poetry install |
| 68 | + pytest |
| 69 | + |
| 70 | +Build the package wheel: |
| 71 | + |
| 72 | + poetry build |
| 73 | + |
| 74 | + |
| 75 | +# Publish |
| 76 | + |
| 77 | +To publish the package to NGI's private Azure Artifacts repository set the following configuration: |
| 78 | + |
| 79 | + poetry config repositories.ngi https://pkgs.dev.azure.com/ngi001/277b2f77-691a-4d92-bd89-8e7cac121676/_packaging/fieldmanager/pypi/upload |
| 80 | + |
| 81 | +To publish the package to Azure Artifacts, make sure you have set up your NGI credentials. |
| 82 | + |
| 83 | +You need to generate Personal Access Token (PAT). Follow |
| 84 | +[this guide](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate) |
| 85 | +for how to get a PAT via the Azure DevOps GUI. `Packaging (Read, write, & manage)` access is sufficient. |
| 86 | + |
| 87 | +If you want to publish your newly built package you need to set your NGI credentials: |
| 88 | + |
| 89 | + poetry config pypi-token.ngi <PAT> |
| 90 | + |
| 91 | + poetry publish -r ngi |
| 92 | + |
| 93 | +# TODOs |
16 | 94 |
|
17 | | -If you want to learn more about creating good readme files then refer the following [guidelines](https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops). You can also seek inspiration from the below readme files: |
18 | | -- [ASP.NET Core](https://github.com/aspnet/Home) |
19 | | -- [Visual Studio Code](https://github.com/Microsoft/vscode) |
20 | | -- [Chakra Core](https://github.com/Microsoft/ChakraCore) |
| 95 | +- Add tests |
| 96 | +- Extend with position transformation from file data srid (input) to project srid (output) |
| 97 | +- Extend with position transformation from file srid (input) to new output fields in wgs84 |
0 commit comments