Naoki04 / Google-Road-Map

Code to get binary image map of roads from Google Maps Static API
0 stars 0 forks source link

google map api #1

Open zuo-ux opened 10 months ago

zuo-ux commented 10 months ago

hi! How to get the road binary map without the Google Maps API? Because the Google Maps maybe limit the application of the api through the VISA card

Naoki04 commented 10 months ago

Hi, thank you for your message. Oh really, I didn't know that. I guess you can find other map api like Bing Map API, Yahoo, or some smaller services only focusing on a country. Otherwise, u can try using Chronium to get google map data without API, it's a bit roundabout way tho. Pls let me know if you find a good way!

zuo-ux commented 10 months ago

Thank you for your response and suggestions, I got the Bing Map API, and put it in settings.yml. For example, Map: url: "https://www.bing.com/maps" # Endpoint key: "Aoe***xTyFZ" # API Key The run the main.py, but get the wrong message:Traceback (most recent call last): File "c:\Users\Renxiang\Downloads\Google-Road-Map-main\Google-Road-Map-main\main.py", line 45, in main() File "c:\Users\Renxiang\Downloads\Google-Road-Map-main\Google-Road-Map-main\main.py", line 31, in main load_map(loaded_image_name, coordinate, zoom) File "c:\Users\Renxiang\Downloads\Google-Road-Map-main\Google-Road-Map-main\functions.py", line 55, in load_map img = Image.open(BytesIO(res.content)) # img is plt.image Object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Renxiang\AppData\Local\Programs\Python\Python311\Lib\site-packages\PIL\Image.py", line 3186, in open raise UnidentifiedImageError( PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000001EC5C18D6C0>