Closed shaunanoordin closed 3 years ago
Oh, duh! Dockerfile: RUN pip install csvs-to-sqlite sqlite-utils geojson plpygis
. I was searching for the string 'python' throughout the project to find the pattern when I should have been looking for pip.
New issue: the If conditions aren't triggering.
if hasattr(row, 'longitude') and hasattr(row, 'latitude'): # always returns false and false
if 'longitude' in row and 'latitude' in row: # always returns false and false
Gotta dig into the Python docs for this. Maybe the Row object is negating the standard member checking methods.
This PR is now ready for review! My only concern now is that the fix to the 'in' check was to change if 'the_geom' in row:
to if 'the_geom' in row.keys():
... which works but I suspect may be more resource-intensive due to calling a function.
To test this, try:
Both should return a feature collection with various data points. Data is showing up fine on local Zooniverse Classrooms instance.
👍
PR Overview
Context: for reasons that evade me, the old Carto database sometimes encodes its geographical data into a "the_geom" field. This field contains the GeoJSON feature, but encoded as a string in the well known binary format.
This PR expands the GeoJSON renderer to read the old "the_geom" field and translate it into a proper JSON-ified object that can be read by some JavaScript.
Status
WIP - I need to figure out how to install the
plpygis
Python library to Docker, since I'm gettingModuleNotFoundError: No module named 'plpygis'
when runningdocker-compose up
.