Bug Report
还没有人认领这个 Issue。
评估
调研方向
从 mapillary/controller/image.py 中的 get_image_close_to_controller 和 mapillary/models/api/vector_tiles.py 中的 fetch_layer 开始,然后通过 get_image_close_to 重现报告的坐标。检查调用如何到达 mercantile.tile,并将结果与 issue 预期的 NaN 处理进行比较;当该输入不再导致请求意外失败且该行为已被覆盖时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
xtile = int(math.floor((x + EPSILON) * Z2))
ValueError: cannot convert float NaN to integer
To Reproduce
This is the code I am using to collect th close-to images to a specific coordinates:
for index, row in enumerate(df.iterrows()):
coordinates_to_image_id_dict: dict = {}
latitude, longitude = dict(row[1])['LATITUDE'], dict(row[1])['LONGITUDE']
coordinates_to_image_id_dict['lat'] = latitude
coordinates_to_image_id_dict['lng'] = longitude
try:
data= mly.get_image_close_to(
latitude=latitude,
longitude=longitude,
radius=35,
image_type="flat",
min_captured_at="2016-01-01"
).to_dict()
except AttributeError:
print('AttributeError occurred')
data = {}
print(data)
print('latitude and longitude:', latitude, longitude)
Expected behavior
if math.isnan(x):
# handle NaN case here
else:
xtile = int(math.floor((x + EPSILON) * Z2))
Screenshots
latitude and longitude: 51.9326934493218 -8.05201349824569
Requesting GET to https://tiles.mapillary.com/maps/vtp/mly1_public/2/14/7892/5318/?access_token=MLY%???
Response 200 OK received in 78ms
{'type': 'FeatureCollection', 'features': []}
latitude and longitude: 53.2429118794892 -6.58873419758931
Traceback (most recent call last):
File "Data_collection_json_metadata.py", line 39, in
min_captured_at="2016-01-01"
File "/home/peoplexxx/.local/lib/python3.7/site-packages/mapillary/utils/auth.py", line 59, in wrapper
return f(*args, **kwargs)
File "/home/people/xx/.local/lib/python3.7/site-packages/mapillary/interface.py", line 116, in get_image_close_to
kwargs=kwargs,
File "/home/people/xx/.local/lib/python3.7/site-packages/mapillary/controller/image.py", line 110, in get_image_close_to_controller
latitude=latitude,
File "/home/people/xxx/.local/lib/python3.7/site-packages/mapillary/models/api/vector_tiles.py", line 123, in fetch_layer
tile=mercantile.tile(lng=longitude, lat=latitude, zoom=zoom),
File "/home/people/xxxx/.local/lib/python3.7/site-packages/mercantile/init.py", line 426, in tile
xtile = int(math.floor((x + EPSILON) * Z2))
ValueError: cannot convert float NaN to integer
- 主要语言
- Python
- 星标
- 66
- 派生
- 23
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 11
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mapillary/mapillary-python-sdk 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 45/100
-
enhancement
难度 5/5 一周以上 新手友好度 15/100
mapillary/mapillary-python-sdk#156 · 1 条评论 ·
-
point cloud data 未关闭example
难度 5/5 一周以上 新手友好度 20/100
mapillary/mapillary-python-sdk#147 · 11 条评论 ·
-
feature
难度 5/5 一周以上 新手友好度 32/100
mapillary/mapillary-python-sdk#127 · 1 条评论 · 2 个 reaction ·
-
feature
mapillary/mapillary-python-sdk#119 · 已指派 1 人 ·
查看 mapillary/mapillary-python-sdk 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·