Archived
1
0
Fork 0

Dateiname angepasst

This commit is contained in:
Lukas Winkler 2016-10-01 20:41:29 +02:00
parent e86ca8e61f
commit 407aa2da34
4 changed files with 21 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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>