Living-with-machines / lwmdb

A django-based library for managing the Living with Machines newspapers metadata database schema
https://living-with-machines.github.io/lwmdb/
MIT License
2 stars 0 forks source link

Finalise initial GeoDjango fields #70

Closed griff-rees closed 1 year ago

griff-rees commented 1 year ago

Pull request #69 includes adding a coordinates GeoDjango Point field to gazetteer.Place as an option for spatial queries.

What may be a better fit is a Polygon or MultiPolygon field.

We could then replace the latitude and longitude attributes with methods which return coordinates of acentroid, and the current coordinates could serve that purpose for now. This would provide options for future flexibility in application for other, more complex Place cases. There may be a need for a temporal element for that though (more below).

Other potential options for MultiPolygon fields include:

Note: the list above is comparatively easy to switch on for potential use. But: a more robust long-term solution would need temporal elements on how these potentially change over time. One solution for that might be adding a data year or census (etc.) field, and/or another table in between to manage querying with respect to geographic changes over time.

kallewesterling commented 1 year ago

Yeah, this reflects the conversations we had in the summer re: precision about places. Polygon variants = good idea.. Looks like we could even do that server-side (see ST_Centroid) and it would benefit computation-wise?

griff-rees commented 1 year ago

Yeah: GeoDjango just calls the respective SQL operation (see the postgis link under Centroid).

griff-rees commented 1 year ago

Shifting the census side into a separate ticket: #81

griff-rees commented 1 year ago

Closing this given: f52ca9fab89e0a776830deac48833fa2ccd5a9a0