1

I'm attempting to create a isochrone map in Jupyter Notebook/Folium, showing how far from downtown Chicago you could get in 45 minutes by car. TravelTime (TravelTime.com) has a ton of excellent APIs to do this, but I'm unable to plot them into Folium/Jupyter Notebook.

Here's a link to the JSON produced by TravelTime.

Here's what I've tried codewise:

import folium
import json
m = folium.Map([41.87899134154521, -87.63554279241286], zoom_start=6.5)
with open('chicago.json', 'r') as openfile:
     json_object = json.load(openfile)
folium.GeoJson(json_object).add_to(m)
m

It produces a blank Folium map. No polygon showing the drivetime json. Console has an error message:

"Uncaught Error: Invalid GeoJSON object."

The output produced by TravelTime does seem much different than other GeoJSONs I've seen on Stackoverflow and elsewhere.

I tried converting the JSON to a dict, but that didn't work.

M--
  • 25,431
  • 8
  • 61
  • 93
Krbin
  • 33
  • 2
  • 5
  • Does this answer your question? [Converting an API output from a Python Dictionary to a Dataframe](https://stackoverflow.com/questions/71531382/converting-an-api-output-from-a-python-dictionary-to-a-dataframe) – M-- Dec 30 '22 at 03:07

1 Answers1

0

Anybody having the same problem as me, see this post by a Travel Time dev to get Travel Time to directly generate a GeoJson for you.

Krbin
  • 33
  • 2
  • 5
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 01 '22 at 02:16