Question about current data model: building_id / geometry_id #1095
-
Hello everyone, @matkoniecz @polly64 we have the following database tables (selection): geometries
building_properties
buildings
also tables 'building_user_attributes' and 'building_user_likes' uses the 'building_id' for the internal reference within the database. Why there is no 'building_id' column in 'geometries' table, but instead a 'geometry_id'? Thanks in advance :-) best, traveller195 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 12 replies
-
The intention is that one building may have multiple geometries - in the building table we have: colouring-core/migrations/001.core.up.sql Line 28 in 1292876 so we can for example model multiple footprints of the same building changing over time. |
Beta Was this translation helpful? Give feedback.
-
Hi @tomalrussell Two different cases came in my mind: the reference between table 'geometries' and 'buildings' is currently implemented by an foreign key 'geometry_id' within the 'buildings' table (like your given example). How is the link to 'older' building footprings modelled and linked with the buildings table? One option could be a foreign key placed in 'geometries' table for 'building_id'. Plus two further attributes 'lifecycle_start' and 'lifecycle_end' (datetime) for each buliding footprint. Or it could also stored in an additional join table, including lifecycle dates of the geometry. just to share some quick ideas (it is not important now to change it here, I guess) |
Beta Was this translation helpful? Give feedback.
-
Data schema draft visual that Mateusz helped me on so I could understand database more. Currently on Technical page of open manual. Might be useful in discussions. let me know if you'd like me to share slide so you can/add/edit - can't seem to drag and drop |
Beta Was this translation helpful? Give feedback.
-
if this is helpful we should look to doing it together and making available in manual too |
Beta Was this translation helpful? Give feedback.
-
great- yes we need something non-technical PI's like me can clearly understand |
Beta Was this translation helpful? Give feedback.
-
additional note: |
Beta Was this translation helpful? Give feedback.
Hi @traveller195
The intention is that one building may have multiple geometries - in the building table we have:
colouring-core/migrations/001.core.up.sql
Line 28 in 1292876
so we can for example model multiple footprints of the same building changing over time.