mapillary / mapillary/mapillary-python-sdk

Bug Report

オープン
#150 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug
主要言語
Python
スター
66
フォーク
23
平均マージ
1日 20時間
マージ済み PR(30日)
11

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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 の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。