Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report #150

Open
NeginZarbakhsh opened this issue Mar 7, 2023 · 0 comments
Open

Bug Report #150

NeginZarbakhsh opened this issue Mar 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@NeginZarbakhsh
Copy link

NeginZarbakhsh commented Mar 7, 2023

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

@NeginZarbakhsh NeginZarbakhsh added the bug Something isn't working label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant