From 28ecbc21695dd38da3c841075aa0dfbf9b8d164f Mon Sep 17 00:00:00 2001 From: joak Date: Wed, 20 Jul 2022 16:47:10 +0200 Subject: added script --- script.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 script.py diff --git a/script.py b/script.py new file mode 100644 index 0000000..9e01e0b --- /dev/null +++ b/script.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +import os +import geojson + +features = [] + + +folder = "html/files" +for file in os.listdir(folder): + print(file) + data=file.rsplit('-',3) + print(data[1], data[2],data[3]) + typ = "" + if data[3].endswith(".ogg"): + typ = "sound" + if data[3].endswith(".jpeg"): + typ = "image" + features.append(geojson.Feature(geometry=geojson.Point((float(data[2]), float(data[1]))), properties={"type": typ,"file": file})) + +#dump = geojson.dumps(geojson.FeatureCollection(features), sort_keys=True) +dump = geojson.dumps(features, sort_keys=True) +print(dump) +f = open('html/data.geojson', 'w') +f.write(dump) +f.close() + -- cgit v1.2.3