mapillary / mapillary/mapillary-python-sdk

Bug Report

Đang mở
#150 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug
Ngôn ngữ chính
Python
Star
66
Fork
23
Merge trung bình
1 ngày 20 giờ
Pull request đã merge (30 ngày)
11

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với mapillary/controller/image.py tại get_image_close_to_controller và mapillary/models/api/vector_tiles.py tại fetch_layer, sau đó tái hiện các tọa độ được báo cáo thông qua get_image_close_to. Kiểm tra cách lời gọi đi đến mercantile.tile và so sánh kết quả với cách xử lý NaN được issue mong đợi; được xem là hoàn tất khi request không còn thất bại bất ngờ với input này và hành vi đã được bao phủ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.