https://github.com/connectedsystems/rdl-mid-to-gpkg
MapInfo .mid to .gpkg convertor
https://github.com/connectedsystems/rdl-mid-to-gpkg
Last synced: over 1 year ago
JSON representation
MapInfo .mid to .gpkg convertor
- Host: GitHub
- URL: https://github.com/connectedsystems/rdl-mid-to-gpkg
- Owner: ConnectedSystems
- License: mit
- Created: 2021-05-25T09:33:52.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-09T11:25:18.000Z (almost 5 years ago)
- Last Synced: 2024-10-12T10:30:23.232Z (over 1 year ago)
- Language: Python
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
rdl-mid-to-gpkg
A utility program for GFDRR RDL to convert MapInfo files inside a 7z file or folder to geopackage.
Currently only tested on Windows.
This script assumes you have [7zip](https://www.7-zip.org/download.html) installed and available in PATH.
If unsure, see if this command returns an output with no error message.
```bash
$ 7z --help
```
# Usage
If the file is encrypted, set password as environment variable.
In a Windows terminal
```bash
$ set rdl_pw=SOME_PASSWORD
```
If using powershell:
```bash
$ $env:rdl_pw = 'SOME_PASSWORD'
```
Use with the `convert-to-gpkg` command
```bash
# WARNING: Temporary file will be created in current location.
$ python mid2gpkg.py convert-to-gpkg [PATH TO 7z FILE] --outdir [DESTINATION FOLDER]
```
If `--outdir` is not specified, then the files are placed in a `gpkgs` directory created in the
current location.
## Dev notes
**Environment setup**
Highly recommend using [`mamba`](https://mamba.readthedocs.io/en/latest/).
```bash
# Creating the environment
$ conda install -c conda-forge mamba
$ mamba env create -f environment.yml
```
**pip only approach**
```bash
$ pip install typer py7zr
```
Download and install python binaries
Download the files for your python version and pip install each in the order shown below
* https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
* https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyproj
* https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely
* https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona
* https://www.lfd.uci.edu/~gohlke/pythonlibs/#geopandas
```bash
# Example:
$ pip install GDAL-3.2.3-cp39-cp39-win_amd64.whl
```