Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Going insane
  • Loading branch information
stocc committed Aug 15, 2022
commit 10aafb38a6a212708b1b7e19f26bfc2a54d01d62
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ ENV/

.idea/

.venv/
.venv/
.vl/
55 changes: 38 additions & 17 deletions analyzeheading.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,48 @@
import json, numpy
from matplotlib import pyplot as plt

with open("eastwestAutobahn.json", "r") as f:
# import as json
json_obj = json.load(f)
unknown_10s = {}
unknown_11s = {}

panos = json_obj["pano"]
for fn in ["eastwestAutobahn.json"]: #, "eow.json"]:

unknown_8s = []
unknown_9s = []
unknown_10s = []
unknown_11s = []
with open(fn, "r") as f:
# import as json
panos = json.load(f)["pano"]

for p in panos:
unknown_8s.append(p["unknown4"]["unknown8"])
unknown_9s.append(p["unknown4"]["unknown9"])
unknown_10s.append(p["unknown4"]["unknown10"])
unknown_11s.append(p["unknown4"]["unknown11"])
u10 = []
u11 = []
for p in panos:
try:
u10.append(p["unknown4"]["unknown10"])
u11.append(p["unknown4"]["unknown11"])
except:
print(p)
unknown_10s[fn] = u10
unknown_11s[fn] = u11


plt.figure()
#print(min(unknown_10s["random.json"]), max(unknown_10s["random.json"]))
#print(min(unknown_11s["random.json"]), max(unknown_11s["random.json"]))

plt.figure(figsize=(20,10))
plt.subplot(2,1,1)
plt.title("unknown10")
#plt.hlines(1,1,20) # Draw a horizontal line
plt.eventplot(unknown_8s, orientation='horizontal', colors='b')
colors=["red", "blue", "green", "black"]
i = 0
for k,v in unknown_10s.items():
plt.eventplot(v, label=k, orientation='horizontal', colors=colors[i], linewidths=0.1)
i += 1
plt.legend()
#plt.axis('off')
plt.show()

plt.subplot(2,1,2)
plt.title("unknown11")
#plt.hlines(1,1,20) # Draw a horizontal line
i = 0
for k,v in unknown_11s.items():
plt.eventplot(v, label=k, orientation='horizontal', colors=colors[i], linewidths=0.1)
i += 1
plt.legend()
#plt.axis('off')
plt.show()
49 changes: 49 additions & 0 deletions analyzerandom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import json, numpy
from matplotlib import pyplot as plt

unknown_10s = {}
unknown_11s = {}

for fn in ["random.json"]: #, "eow.json"]:

with open(fn, "r") as f:
# import as json
panos = json.load(f)#["pano"]

u10 = []
u11 = []
for p in panos:
try:
u10.append(p["unknown4"]["unknown10"])
u11.append(p["unknown4"]["unknown11"])
except:
print(p)
unknown_10s[fn] = u10
unknown_11s[fn] = u11


print(min(unknown_10s["random.json"]), max(unknown_10s["random.json"]))
print(min(unknown_11s["random.json"]), max(unknown_11s["random.json"]))

plt.figure(figsize=(20,10))
plt.subplot(2,1,1)
plt.title("unknown10")
#plt.hlines(1,1,20) # Draw a horizontal line
colors=["red", "blue", "green", "black"]
i = 0
for k,v in unknown_10s.items():
plt.eventplot(v, label=k, orientation='horizontal', colors=colors[i], linewidths=0.1)
i += 1
plt.legend()
#plt.axis('off')
plt.subplot(2,1,2)
plt.title("unknown11")
#plt.hlines(1,1,20) # Draw a horizontal line
i = 0
for k,v in unknown_11s.items():
plt.eventplot(v, label=k, orientation='horizontal', colors=colors[i], linewidths=0.1)
i += 1
plt.legend()
#plt.axis('off')
plt.show()
print(sorted(unknown_10s["random.json"]))
54 changes: 54 additions & 0 deletions analyzesingletile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import json, numpy, requests
from matplotlib import pyplot as plt
import sys

tileX = sys.argv[1]
tileY = sys.argv[2]

unknown_10s = {}
unknown_11s = {}

resp = requests.get("http://127.0.0.1:5001/rawtile/{}/{}/".format(tileX,tileY))
j = (resp.json())

fn = str(tileX) + "/" + str(tileY) + ".json"

u10 = []
u11 = []
for p in j["pano"]:
try:
u10.append(p["unknown4"]["unknown10"])
u11.append(p["unknown4"]["unknown11"])
except:
print(p)
unknown_10s[fn] = u10
unknown_11s[fn] = u11


#print(min(unknown_10s["random.json"]), max(unknown_10s["random.json"]))
#print(min(unknown_11s["random.json"]), max(unknown_11s["random.json"]))

plt.figure(figsize=(20,10))
plt.subplot(2,1,1)
plt.title("unknown10")
plt.xlim(left=0, right=16400)
#plt.hlines(1,1,20) # Draw a horizontal line
colors=["red", "blue", "green", "black"]
i = 0
for k,v in unknown_10s.items():
plt.eventplot(v, label=k, orientation='horizontal', colors=colors[i], linewidths=1)
i += 1
plt.legend()
#plt.axis('off')
plt.subplot(2,1,2)
plt.title("unknown11")
plt.xlim(left=0, right=12000)

#plt.hlines(1,1,20) # Draw a horizontal line
i = 0
for k,v in unknown_11s.items():
plt.eventplot(v, label=k, orientation='horizontal', colors=colors[i], linewidths=1)
i += 1
plt.legend()
#plt.axis('off')
plt.show()
9 changes: 7 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from lookaround.lookaround.auth import Authenticator
from lookaround.lookaround.geo import wgs84_to_tile_coord
from lookaround.lookaround import get_coverage_tile, fetch_pano_segment, get_pano_segment_url
from lookaround.lookaround import _get_coverage_tile_raw_json, get_coverage_tile, fetch_pano_segment, get_pano_segment_url

from util import CustomJSONEncoder
from geo import haversine_distance
Expand Down Expand Up @@ -92,7 +92,7 @@ def closest_pano_to_coord(lat, lon):
smallest_distance = distance
closest = pano
print(x,y)
return jsonify(closest)
return jsonify(date="asdf",lat = closest.lat, lon = closest.lon, panoid = str(closest.panoid), region_id = str(closest.region_id), unknown10 = closest.unknown10, unknown11 = closest.unknown11)



Expand All @@ -102,6 +102,11 @@ def tile_of_coord(lat, lon):

return jsonify(x=x,y=y)

@app.route("/rawtile/<int:x>/<int:y>/")
def rawtile(x, y):
panos = _get_coverage_tile_raw_json(x, y)

return panos

@app.route("/fullTileInfo/<int:x>/<int:y>/")
def full_tile_coverage_incl_neighbors(x, y):
Expand Down
22 changes: 22 additions & 0 deletions collectrandom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import final
import requests
import json

panos = []

try:
for i in range(68630,68630+100):
for j in range(43260,43260+100):
print("http://localhost:5001/rawtile/{}/{}/".format(i,j))
resp = requests.get("http://localhost:5001/rawtile/{}/{}/".format(i,j))
j = (resp.json())
print("{}/{}".format(i,j))

if not "pano" in resp.json().keys():
continue
panos.extend(j["pano"])
except KeyboardInterrupt:
pass
finally:
with open("random.json", "w") as f:
json.dump(panos, f)
Loading