Skip to content

Commit

Permalink
[Naver] Fix parse_historical and update parse_nearby
Browse files Browse the repository at this point in the history
`metadata/timeline` now also contains the panorama type, breaking
`parse_historical`. Likewise, `panorama/nearby` returns the
panorama type as well (though I don't know for certain whether this is
new), so `parse_nearby` has been updated as well.
  • Loading branch information
sk-zk committed Apr 29, 2024
1 parent 0320746 commit dee0c2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions streetlevel/naver/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def parse_historical(response: dict, parent_id: str) -> List[NaverPanorama]:
id=pano[0],
lat=pano[2],
lon=pano[1],
date=datetime.strptime(pano[3], "%Y-%m-%d %H:%M:%S.0")
panorama_type=PanoramaType(int(pano[3])),
date=datetime.strptime(pano[4], "%Y-%m-%d %H:%M:%S.0"),
) for pano in panos if pano[0] != parent_id]


Expand All @@ -80,7 +81,8 @@ def parse_nearby(response: dict) -> NaverPanorama:
description=feature["properties"]["description"],
title=feature["properties"]["title"],
elevation=elevation,
camera_height=(feature["properties"]["camera_altitude"] * 0.01) - elevation
camera_height=(feature["properties"]["camera_altitude"] * 0.01) - elevation,
panorama_type=PanoramaType(int(feature["properties"]["type"])),
)


Expand Down

0 comments on commit dee0c2b

Please sign in to comment.