Skip to content

Import data from various formats into GeoKey

License

Notifications You must be signed in to change notification settings

ExCiteS/geokey-dataimports

Repository files navigation

PyPI Package Travis CI Build Status Coveralls Test Coverage

geokey-dataimports

Import data from various formats (GeoJSON, KML, CSV) into GeoKey.

Install

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-dataimports

Or 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_dataimports

Copy static files:

python manage.py collectstatic

You're now ready to go!

Run within Docker container

If you're cloning the repository and have GeoKey running within a Docker container, configure it like such:

  1. Make sure repositories are cloned next to each other, e.g. file structure is:
/MyProjects/geokey/
/MyProjects/geokey-dataimports/
  1. 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
  1. 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_dataimports

Update

Update the geokey-dataimports from PyPI:

pip install -U geokey-dataimports

Migrate the new models into the database:

python manage.py migrate geokey_dataimports

Copy new static files:

python manage.py collectstatic

Test

Run tests:

python manage.py test geokey_dataimports

Check code coverage:

coverage run --source=geokey_dataimports manage.py test geokey_dataimports
coverage report -m --omit=*/tests/*,*/migrations/*