Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datasette-leaflet-freedraw causes 'no such table: geometry_columns' when enrichment uses spatialite #39

Open
hcarter333 opened this issue Dec 8, 2023 · 0 comments

Comments

@hcarter333
Copy link

hcarter333 commented Dec 8, 2023

tldr; the geocoding enrichment still works although the error messages discussed below is created, so this isn't critical.

I forked and then modified the datasette-enrichments-opencage package to use the google maps API instaed of opencage. The new repository is called enrichments-gmap-geocode.

When the datasette-leaflet-freedraw plugin is installed, this same issue from the datasette-leaflet-freedraw is caused.

Uninstalling the plugin resolves the issue, but... my larger datasette ecosystem will need both the enrichment and the plugin in the following use case:

Use Case

One table stores ham radio QSO (contact) logs including the location of the transmitting and receiving ham radio stations (lat and lng.) This table will is used along with the freedraw to search for QSOs at different transmit or receive locations (click through for video use case demo).

IMAGE ALT TEXT HERE

or statically:
image

Another table (perhaps just the first one mentioned above?) will contain callsigns for new QSOs. These callsigns will be passed through two enrichments in turn, one that uses qrz.com to lookup the callsign address, and then enrichments-gmap-geocode to geocode the station locations.

Is there a resolution other than uninstalling the freedraw plugin?

To recreate:

Clone and install the gmaps API enrichment. To install I used
pip install -e '.[test]'

at the top level of the cloned repo

Then, create an addresses table:

Club_Station,Address
ARRL,"connecticut,USA"
W6BB,"Berkeley,CA,USA"
W6YX,"Palo Alto,CA,USA"

that is loaded into a sqlite db in any manner you like. (I used csvs-to-sqlite ../test_addr.csv gm_test.db)

Then, start datasette with the following command line:
python3 -m datasette gm_test.db --metadata qso_loc.yml --load-extension=/usr/lib/x86_64-linux-gnu/mod_spatialite.so --template-dir plugins/templates --root

Go through the normal flow to enrich the address data and the error will appear.

Also!? The data will still be enriched, so maybe it doesn't matter? (It does make development a bit more difficult because of the time to isolate the above mentioned error message vs. actual error issues.)

Here's the error:
image

But the geocoding actually still worked:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant