Import data from various formats (GeoJSON, KML, CSV) into GeoKey.
geokey-dataimports requires:
- Python version 2.7 or 3.6
- GeoKey version 1.6 or greater
Install the geokey-dataimports from PyPI:
pip install geokey-dataimportsOr from cloned repository:
cd geokey-dataimports
pip install -e .Add the package to installed apps:
INSTALLED_APPS += (
...
'geokey_dataimports',
)Migrate the models into the database:
python manage.py migrate geokey_dataimportsCopy static files:
python manage.py collectstaticYou're now ready to go!
If you're cloning the repository and have GeoKey running within a Docker container, configure it like such:
- Make sure repositories are cloned next to each other, e.g. file structure is:
/MyProjects/geokey/
/MyProjects/geokey-dataimports/- Modify Dockerfile (within "geokey" repository) so that it looks similar to:
...
ADD /geokey /app
ADD /geokey-dataimports /extensions/geokey-dataimports
...
RUN pip install -e /app
RUN pip install -e /extensions/geokey-dataimports- Modify docker-compose.yml and add a new volume:
...
volumes:
- ./geokey:/app/geokey
- ../geokey-dataimports/geokey_dataimports:/extensions/geokey-dataimports/geokey_dataimports
...You can also run migrations, make new ones, etc. using geokey container. For example, to run only geokey-dataimports tests:
docker-compose exec geokey python manage.py test geokey_dataimportsUpdate the geokey-dataimports from PyPI:
pip install -U geokey-dataimportsMigrate the new models into the database:
python manage.py migrate geokey_dataimportsCopy new static files:
python manage.py collectstaticRun tests:
python manage.py test geokey_dataimportsCheck code coverage:
coverage run --source=geokey_dataimports manage.py test geokey_dataimports
coverage report -m --omit=*/tests/*,*/migrations/*