r/DatabaseHelp • u/jankovic92 • Dec 26 '15
Help with spatial database design
Hello, I am currently working on a student project in spatial databases, gis and web gis and i need some help with designing a database for agricultural parcels. I am using the current LPIS model from MARS and IACS and i need to think how to expand this model to include data that will be changed yearly (crops, net area etc...) without redundant data or unnecessary tables.
Thanks in advance!
2
Upvotes
View all comments
Show parent comment
2
u/muchargh Dec 29 '15
So what you're looking for is a table for each attribute that can change over time, and an appropriate primary key that incorporates a temporal element (date or datetime).
If you're trying to track the acreage of a parcel (something that probably doesn't change that often) you'll have a table with ParcelId, Date, Acreage where the primary key is (ParcelId, Date). Only insert values when the acreage changes.
If you're tracking crop yield, a table with ParcelId, Crop, Date, and Yield will suffice. The primary key would be (ParcelId, Crop, Date). In this instance you would always insert values as they are measurements, not attributes.