Skip to content

Commit

Permalink
Merge pull request #52 from ropable/master
Browse files Browse the repository at this point in the history
Drop cddp application, implement import_cpt_cadastre_scdb function
  • Loading branch information
ropable authored Oct 2, 2023
2 parents 86b7d60 + f1795a5 commit e180c6d
Show file tree
Hide file tree
Showing 13 changed files with 513 additions and 441 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ RUN poetry config virtualenvs.create false \
# Install the project.
COPY geocoder.py gunicorn.py manage.py ./
COPY caddy ./caddy
COPY cddp ./cddp
COPY shack ./shack

# Run the application as the www-data user.
Expand Down
4 changes: 0 additions & 4 deletions caddy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
'django_extensions',
'tastypie',
'shack',
'cddp',
)
MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
Expand Down Expand Up @@ -69,9 +68,6 @@
# Defined in the DATABASE_URL env variable.
'default': dj_database_url.config(),
}
if env('CDDP_DATABASE_URL', None):
DATABASES['cddp'] = dj_database_url.parse(env('CDDP_DATABASE_URL'))
DATABASE_ROUTERS = ['cddp.router.CddpDBRouter']


# Internationalization
Expand Down
Empty file removed cddp/__init__.py
Empty file.
5 changes: 0 additions & 5 deletions cddp/apps.py

This file was deleted.

51 changes: 0 additions & 51 deletions cddp/models.py

This file was deleted.

12 changes: 0 additions & 12 deletions cddp/router.py

This file was deleted.

218 changes: 171 additions & 47 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[tool.poetry]
name = "caddy"
version = "2.2.12"
version = "2.3.0"
description = "Lightweight application service to harvest and index the cadastre dataset, and expose an API endpoint to allow full-text searching of addresses."
authors = ["Ashley Felton <[email protected]>"]
license = "Apache License 2.0"

[tool.poetry.dependencies]
python = "^3.10"
django = "3.2.20"
psycopg2 = "2.9.5"
django = "3.2.21"
psycopg2 = "2.9.6"
python-dotenv = "1.0.0"
dj-database-url = "1.0.0"
SQLAlchemy = "2.0.20"
Expand All @@ -20,6 +20,7 @@ bottle = "0.12.25"
gunicorn = "21.2.0"
mixer = "7.2.2"
WebTest = "3.0.0"
fudgeo = "0.7.0"

[tool.poetry.group.dev.dependencies]
ipython = "^8.14.0"
Expand Down
31 changes: 0 additions & 31 deletions shack/management/commands/copy_cadastre.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.management.base import BaseCommand, CommandError
import logging
from shack.utils import harvest_state_cadastre
from shack.utils import harvest_cadastre_wfs

logger = logging.getLogger('caddy')

Expand All @@ -24,7 +24,7 @@ def handle(self, *args, **options):

self.stdout.write('Starting harvest of cadastre addresses')
logger.info('Starting harvest of cadastre addresses')
harvest_state_cadastre(limit)
harvest_cadastre_wfs(limit)
self.stdout.write('Finished harvest of cadastre addresses')
logger.info('Finished harvest of cadastre addresses')

Expand Down
27 changes: 27 additions & 0 deletions shack/management/commands/import_cpt_cadastre_scdb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from django.core.management.base import BaseCommand, CommandError
import logging
from shack.utils import import_cpt_cadastre_scdb

logger = logging.getLogger('caddy')


class Command(BaseCommand):
help = 'Undertakes harvest of address data from CPT_CADASTRE_SCDB.gpkg'

def add_arguments(self, parser):
parser.add_argument(
'--path', action='store', dest='path', default=None,
help='File path to the Geopackage file',
)

def handle(self, *args, **options):
if options['path']:
path = options['path']
else:
path = None

logger.info('Starting harvest of cadastre addresses')
import_cpt_cadastre_scdb(path)
self.stdout.write('Finished harvest of cadastre addresses')

return
13 changes: 0 additions & 13 deletions shack/management/commands/prune_addresses.py

This file was deleted.

Loading

0 comments on commit e180c6d

Please sign in to comment.