New task was created
Resolve database error when doing within lookup for specific cities
Created on Tuesday 18 May 2021, 04:51
Back to task list-
ID987470
-
ProjectMetabolism of Cities Data Hub
-
StatusOpen
-
PriorityMedium
-
TypeProgramming work
-
TagsData Hub Priority Plan 2021 General data hub improvements
-
Assigned toNo one yet
-
SubscribersPaul Hoekman
Description
There are some cities where this query creates an odd error:
country = ReferenceSpace.objects.filter(source_id=328661, geometry__contains=self.geometry)
I think it is this query, but it could also be the actual recording in the database of the result. Not totally sure yet, but it happens with three shapefiles. See this task. Good debugging steps:
- First uncomment the exception (by ID at the top)
- Then get one of the spaces:
a = ReferenceSpace.objects.get(pk=15984)
- Then try to get the country:
a.get_country
- You should now get the error attached
I would first try to pinpoint at what step this occurs - perhaps try to replicate the query in adminer. Then try and see if the three affected shapefiles share any characteristics. Take it from there...