Skip to content
James McKinney edited this page Feb 12, 2017 · 10 revisions

represent-canada

Load time dependencies

When running a management command, you get this error:

OSError: dlopen(/usr/local/lib/libgdal.dylib, 6): Symbol not found: _GEOSArea

Add these lines to represent/settings.py:

import ctypes

GDAL_LIBRARY_PATH = '/usr/local/lib/libgdal.dylib'
ctypes.CDLL(GDAL_LIBRARY_PATH)

Source

Missing gettext binaries

When running the makemessages or compilemessages management commands, you get an error like:

CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.

Link some binaries:

brew info gettext
cd /usr/local/Cellar/gettext/VERSION/bin
ln -ns msgattrib msgfmt msgmerge msguniq xgettext /usr/local/bin

represent-canada-data

3D features

When running python manage.py loadshapefiles, you get this error:

django.db.utils.IntegrityError: new row for relation "boundaries_boundary" violates check constraint "enforce_dims_shape"

Shapefiles with 3D features cause this error. To correct it, run:

ogr2ogr -f "ESRI Shapefile" -overwrite . SHAPEFILE.shp -nlt POLYGON

replacing SHAPEFILE with the name of your shapefile.

Missing projection file

When running python manage.py loadshapefiles, you get this error:

TypeError: source and target must be of type SpatialReference

It's because you are missing a .prj file.

scrapers-ca and scrapers_ca_app

Database conflict

When running pupa update MODULE_NAME, you get this an error like:

pupa.exceptions.UnresolvedIdError: multiple objects returned for Organization pseudo id ~{"classification": "legislature"}: {'ocd-organization/e2e60bfc-d58a-4fcb-829f-f33c1855a29f', 'ocd-organization/976d17d7-4866-4c58-9c70-643564459c74'}

Changing the name property in __init__.py will cause this error. From scrapers_ca_app, run ./manage.py flush MODULE_NAME to clear that jurisdiction from the database.

Missing divisions

When running pupa update MODULE_NAME, you get this an error like:

DETAIL:  Key (division_id)=(ocd-division/country:ca/csd:3519049/ward:1) is not present in table "opencivicdata_division".

Run heroku run "OCD_DIVISION_CSV='scrapers/country-ca.csv' pupa dbinit ca" to load the missing divisions.