supply tidy -xml -iq fountains.xml as fountains.db

This commit is contained in:
Daniel afx 2020-09-29 18:45:44 +03:00
parent fd20e4cc82
commit d5e101e8bc
7 changed files with 14581 additions and 3 deletions

File diff suppressed because it is too large Load diff

BIN
databases/fountains.db Normal file

Binary file not shown.

2
databases/populatedb.py Normal file → Executable file
View file

@ -31,5 +31,5 @@ def iterate_kml(filepath):
if __name__ == "__main__": if __name__ == "__main__":
db = sqlite_utils.Database("trees.db") db = sqlite_utils.Database("fountains.db")
db["locations"].insert_all(iterate_kml(sys.argv[-1])) db["locations"].insert_all(iterate_kml(sys.argv[-1]))

Binary file not shown.

View file

@ -19,7 +19,7 @@ class ForestMapView(MapView):
app = App.get_running_app() app = App.get_running_app()
print(self.get_bbox()) # debug gps position print(self.get_bbox()) # debug gps position
min_lat, min_lon, max_lat, max_lon = self.get_bbox() min_lat, min_lon, max_lat, max_lon = self.get_bbox()
sql_statement = "SELECT * FROM trees WHERE x > %s AND x < %s and y> %s AND Y < %s" % (min_lon, max_lon, min_lat, max_lat) sql_statement = "SELECT * FROM locations WHERE x > %s AND x < %s and y> %s AND Y < %s" % (min_lon, max_lon, min_lat, max_lat)
app.cursor.execute(sql_statement) app.cursor.execute(sql_statement)
trees = app.cursor.fetchall() trees = app.cursor.fetchall()
print(trees) print(trees)

View file

@ -66,7 +66,7 @@ class MainApp(App):
GpsHelper().run() GpsHelper().run()
# Connect to database # Connect to database
self.connection = sqlite3.connect("forest.db") self.connection = sqlite3.connect("databases/fountains.db")
self.cursor = self.connection.cursor() self.cursor = self.connection.cursor()
# Instantiate SearchPopupMenu # Instantiate SearchPopupMenu