SimonJinaphant / Discovr

A personalized UBC companion app
0 stars 2 forks source link

BuildingID Collision in SQL Table #132

Closed ValRat closed 7 years ago

ValRat commented 7 years ago

When no Building SQL Table exist, we parse geojson file and each building get's assigned and ID starting from 0. When the app is ran again, the dbh gets recreated and numBuilding is initialized to zero. (as per the constructor). The app attempts to read the geojson file and add the buildings found to the database. Database throws error since the buildings have already been added with the same ID.

Possible fixes:

  1. initialize numBuilding to size of buildings table
  2. have a flag to check whether the building sql table exists and only parse buildings.geojson if it doesn't