Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed Aug 11, 2023
1 parent 4b1f1b0 commit de24254
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ from the following sources:
* [IS 50V Örnefni](https://opingogn.is/dataset/is-50v-ornefni-isn93) from the [National Land Survey of Iceland](https://www.lmi.is) (*Landmælingar Íslands*)
* The postcode table provided by [Postur.is](https://www.postur.is/gogn/Gotuskra/postnumer.txt), with supplementary data from [Icelandic Wikipedia](https://is.wikipedia.org/wiki/Listi_yfir_%C3%ADslensk_p%C3%B3stn%C3%BAmer)

Since no networking takes place, lookups are fast and can be performed offline. The package is
useful for geocoding and reverse geocoding of Icelandic addresses and placenames, as well as for
validating addresses and postcodes.

## Installation

`iceaddr` is available via [PyPI](https://pypi.org/project/iceaddr/).
The latest version of `iceaddr` is available via [PyPI](https://pypi.org/project/iceaddr/).

```
```bash
pip install iceaddr
```

Expand Down Expand Up @@ -237,6 +241,32 @@ placenames in the database:
Landakotsvöllur
```

## Build process

To build your own version of the package, you need to have Python 3.7+ installed.
Then, after optionally creating a virtual environment, run the following command
from the repository root to install dependencies:

```bash
pip install -r requirements.txt
```

Then, run the following command to build the database:

```bash
$ python build_db.py
...
$ python add_placename_data.py
...
```

This creates an SQLite3 database in the repo root named `iceaddr.db`. Move this file to
`iceaddr/resources/` and you can now install your own version of the package:

```bash
python setup.py install
```

## Version History

* 0.5.5: Updated address and placename data. Removed ISN93 coords. Now requires Python 3.7+ (11/12/2022)
Expand Down
1 change: 1 addition & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

TODO for iceaddr

* Provide placenames and street names in all cases (nf, þf, þgf, ef)
* Verify that GPS coordinates are rational in DB build process
* Better automation of geo data processing in db build scripts, should not be a separate step
* iceaddr_suggest relies on comma separator to separate street address and place name. Could be made smarter.
Expand Down
4 changes: 2 additions & 2 deletions build_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def insert_address_entry(e: Dict, conn: sqlite3.Connection) -> None:
print(qargs)
c = conn.cursor()
c.execute("INSERT INTO stadfong VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", qargs)
except Exception as e:
print(e)
except Exception as exc:
print(exc)


def main() -> None:
Expand Down

0 comments on commit de24254

Please sign in to comment.