Public-Tree-Map / public-tree-map

Public Tree Map documents all ~35,000 public street and park trees in Santa Monica's urban forest. The map includes contextual information collected from open datasets and digitized city records. To reflect tree plantings and removals, the map updates every day. We're also working to add tree data from other cities in LA county. Work in progress:
https://publictreemap.org
MIT License
43 stars 44 forks source link

Add Species Data to Database (DB Normalization) #16

Closed Reltre closed 5 years ago

Reltre commented 6 years ago

Current all tree data is stored in a trees table, where each row has all information related to a single tree that is publicly owned and tracked in the city of Santa Monica. This is fine, but managing this data, and updating it may be a bit cumbersome.

One other issue is we don't need all this information depending on what we're trying to display. For instance, let's say we just want to show all trees within a 1 mile radius on the map. All we need for that is the tree location (longitude and latitude). Here is my recommendation for database normalization:

Trees Table

id, species_id, diameter, height, longitude, latitude, street number, street name, side

Species Table

id, common name, botanical name, plant family - botanical, plant family - common, native, EOL_ID

This is just a start. We'll want to add additional data as we develop ways to filter more information about our lovely urban forest in the city of Santa Monica.

carl-14 commented 6 years ago

I want to help you with the normalization.

Reltre commented 6 years ago

Great. I think Emily is working on this as well. At the moment we only track individual trees where each tree is a relation in a trees table.

We also want to have a species table as well, and possibly a family table.

Any necessary table and column constraints should also be set as well. On that note, I noticed that the trees table has an index column which seems to be a mapping from an array of trees perhaps? Maybe we should call this id and make it a primary key.

Reltre commented 6 years ago

@ian-r-rose @carl-14 @emillipede What do you think of the proposal above?

ian-r-rose commented 6 years ago

I think that makes good sense!

emillipede commented 6 years ago

Hi @Reltre - thank you for planning out these tables. The fields I have in mind are below. Please let me know what you think.

Family Table

Trees Table (all data from SM trees inventory dataset)

On deck (data source - google)

Species Table

For relevant non-native species:

On deck:

emillipede commented 6 years ago

The new CSV is called irrigation_requirements.csv (https://github.com/emillipede/public-tree-map/blob/master/irrigation_requirements.csv)

Some species in the watering CSV aren't planted anywhere in the city as public trees. In the watering requirements PDFs from the city, not all public trees are represented. Looks like there are guidelines for 170 of the 289 total tree species and varieties.

emillipede commented 5 years ago

we still have some pending data, but the specified datasets are in the DB