diff --git a/nearest.py b/nearest.py index cb26cd0..c86693b 100755 --- a/nearest.py +++ b/nearest.py @@ -21,7 +21,7 @@ for station in stationList: sql = ''' SELECT id, start, goal -FROM connections_test +FROM connections LEFT JOIN stationen ON (start = ref OR goal = ref) WHERE ref = {ref} ORDER BY length diff --git a/routing.py b/routing.py index 3fb444d..79c0ac9 100755 --- a/routing.py +++ b/routing.py @@ -44,7 +44,7 @@ for way in itertools.product(stations, repeat=2): gpxNode = dom.firstChild length = round(getTrackLength(gpxNode.getElementsByTagName("trk")[0]), 0) # Länge aus gpx auslesen - cursor.execute("REPLACE INTO connections_test (id, start, goal, length) VALUES (%s,%s,%s,%s)", + cursor.execute("REPLACE INTO connections (id, start, goal, length) VALUES (%s,%s,%s,%s)", (routeID, way[0][2], way[1][2], length)) # in db eintragen except subprocess.CalledProcessError as exception: print() # Neue Zeile diff --git a/stationExport.py b/stationExport.py index 1c5a451..573a10e 100644 --- a/stationExport.py +++ b/stationExport.py @@ -38,5 +38,8 @@ geojsonComplete = { "features": features } # print(json.dumps(geojsonComplete, indent=4)) -with open('stationLayer.json', 'w') as outfile: +with open('www/stationLayer.json', 'w') as outfile: json.dump(geojsonComplete, outfile, indent=4) + +# with open('www/station.json', 'w') as outfile: +# json.dump(stations, outfile, indent=4) diff --git a/www/map.html b/www/map.html index c65e540..b0a20c7 100644 --- a/www/map.html +++ b/www/map.html @@ -12,11 +12,23 @@ html, body, #map { height: 100%; } + + #search { + pointer-events: auto; + } + #search input { + margin:20px; + } -
+
+
+ @@ -46,7 +58,7 @@ $.ajax({ dataType: "json", - url: "test.json", + url: "nearest.json", success: function (data) { lines.addData(data); lines.addTo(map); @@ -70,7 +82,7 @@ $.ajax({ dataType: "json", - url: "stations.json", + url: "stationLayer.json", success: function (data) { stationLayer.addData(data); stationLayer.addTo(map); @@ -128,7 +140,5 @@ "Stationen": stationLayer }; var control = L.control.layers(mapLayers, overlays, {collapsed: false}).addTo(map); - - \ No newline at end of file