Dateiname angepasst
This commit is contained in:
parent
e86ca8e61f
commit
407aa2da34
4 changed files with 21 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
20
www/map.html
20
www/map.html
|
@ -12,11 +12,23 @@
|
|||
html, body, #map {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#search {
|
||||
pointer-events: auto;
|
||||
}
|
||||
#search input {
|
||||
margin:20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<div id="map">
|
||||
</div>
|
||||
<div class="leaflet-bottom" id="search">
|
||||
<input type="text" placeholder="Search" autocomplete="off">
|
||||
<input type="text" placeholder="Search" autocomplete="off">
|
||||
</div>
|
||||
</body>
|
||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js"
|
||||
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
||||
|
@ -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);
|
||||
|
||||
|
||||
</script>
|
||||
</html>
|
Reference in a new issue