Skip to content

Commit

Permalink
Changed datastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
Dabendorf committed Sep 5, 2020
1 parent d9de636 commit 8003668
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 83,784 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
screenshot.png
*.ndjson
71,397 changes: 0 additions & 71,397 deletions edges.ndjson

This file was deleted.

Binary file added examples/Dabendorf1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/Dabendorf2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/Dabendorf3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12,383 changes: 0 additions & 12,383 deletions nodes.ndjson

This file was deleted.

Binary file removed screenshot.png
Binary file not shown.
12 changes: 8 additions & 4 deletions tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def colour_gradient_from_distance(distance_array):
for i in range(length):
if distance_array[i] != 0:
start = 0 # 102.8 Start colour in Dabendorf, degrees from red
spectreSize = 0.8 # number of iterations around rainbow, preferibly < 1.0
spectreSize = 0.9 # number of iterations around rainbow, preferibly < 1.0
hue = ((((distance_array[i] - min)/rangemm) +
(((start/360)*255)/255)) % 1)*spectreSize

Expand Down Expand Up @@ -230,6 +230,10 @@ def draw_distance_map(positions_gps, distances, station_types_arr, display_width
"""
positions_x_y = gps_to_x_y(positions_gps, display_width, display_height)
colours = colour_gradient_from_distance(distances)
try:
os.environ["DISPLAY"]
except:
os.environ["SDL_VIDEODRIVER"] = "dummy"
pygame.init()
screen = pygame.display.set_mode((display_width, display_height))
pygame.display.set_caption('Berlin aus Sicht der Metropole')
Expand Down Expand Up @@ -351,9 +355,9 @@ def main():

delta_x = max_x-min_x
delta_y = max_y-min_y
print(delta_x)
print(delta_y)
print(delta_x/delta_y)
print("Delta X: "+str(delta_x))
print("Delta Y: "+str(delta_y))
print("Ratio Delta: "+str(delta_x/delta_y))

height = 1000
width = int(height * (delta_x/delta_y))
Expand Down

0 comments on commit 8003668

Please sign in to comment.