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 = '''
|
sql = '''
|
||||||
SELECT
|
SELECT
|
||||||
id, start, goal
|
id, start, goal
|
||||||
FROM connections_test
|
FROM connections
|
||||||
LEFT JOIN stationen ON (start = ref OR goal = ref)
|
LEFT JOIN stationen ON (start = ref OR goal = ref)
|
||||||
WHERE ref = {ref}
|
WHERE ref = {ref}
|
||||||
ORDER BY length
|
ORDER BY length
|
||||||
|
|
|
@ -44,7 +44,7 @@ for way in itertools.product(stations, repeat=2):
|
||||||
gpxNode = dom.firstChild
|
gpxNode = dom.firstChild
|
||||||
length = round(getTrackLength(gpxNode.getElementsByTagName("trk")[0]), 0) # Länge aus gpx auslesen
|
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
|
(routeID, way[0][2], way[1][2], length)) # in db eintragen
|
||||||
except subprocess.CalledProcessError as exception:
|
except subprocess.CalledProcessError as exception:
|
||||||
print() # Neue Zeile
|
print() # Neue Zeile
|
||||||
|
|
|
@ -38,5 +38,8 @@ geojsonComplete = {
|
||||||
"features": features
|
"features": features
|
||||||
}
|
}
|
||||||
# print(json.dumps(geojsonComplete, indent=4))
|
# 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)
|
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 {
|
html, body, #map {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
#search input {
|
||||||
|
margin:20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
</body>
|
||||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js"
|
<script src="https://code.jquery.com/jquery-2.2.4.min.js"
|
||||||
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
||||||
|
@ -46,7 +58,7 @@
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
url: "test.json",
|
url: "nearest.json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
lines.addData(data);
|
lines.addData(data);
|
||||||
lines.addTo(map);
|
lines.addTo(map);
|
||||||
|
@ -70,7 +82,7 @@
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
url: "stations.json",
|
url: "stationLayer.json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
stationLayer.addData(data);
|
stationLayer.addData(data);
|
||||||
stationLayer.addTo(map);
|
stationLayer.addTo(map);
|
||||||
|
@ -128,7 +140,5 @@
|
||||||
"Stationen": stationLayer
|
"Stationen": stationLayer
|
||||||
};
|
};
|
||||||
var control = L.control.layers(mapLayers, overlays, {collapsed: false}).addTo(map);
|
var control = L.control.layers(mapLayers, overlays, {collapsed: false}).addTo(map);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
Reference in a new issue