Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

BingTiles download error fixed. #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vaghawan
Copy link

While trying to run python gettilesfrombing.py , it returns with the following error:

osm/soccer/250124836.GeoJSON Traceback (most recent call last):
  File "gettilesfrombing.py", line 44, in <module>
    tilePixel = quadkey.TileSystem.geo_to_pixel((float(row[0]),float(row[1])), cfg.tileZoom)
ValueError: could not convert string to float: '{"type": "FeatureCollection", "features": [{"geometry": {"coordinates": [[[-71.0508224, 42.3263835], [-71.0508827, 42.3258583], [-71.0496463, 42.3257808], [-71.049586, 42.326306], [-71.0508224, 42.3263835]]], "type": "Polygon"}, "properties": {"wayOSMId": 250124836, "sport": "soccer", "leisure": "pitch"}, "type": "Feature"}]}'

Because the code tries to read the csv hence assuming the osm dir only contains the .csv file, but GEOJson file too are in the directory, and when the loop stumbles on the GEOJson the above error throws. What I simply did is that I checked the fileformat type and only proceeded the loop, if it's fileformat is .csv . And it downloads the tiles accordingly without an error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant