Skip to content

Instantly share code, notes, and snippets.

@francois-baptiste
Created December 18, 2020 17:40
Show Gist options
  • Save francois-baptiste/223d8d01bf7af964148325723689c8ba to your computer and use it in GitHub Desktop.
Save francois-baptiste/223d8d01bf7af964148325723689c8ba to your computer and use it in GitHub Desktop.
Load demo graph from geojson-path-finder js lib
import json
import pandas as pd
import wget
from google.cloud import bigquery
print('Upload geojson-path-finder network demo to Bigquery')
url = 'https://francois-baptiste.github.io/geojson-path-finder/network.json'
wget.download(url, 'network.json')
with open('network.json') as json_file:
df=pd.DataFrame([json.dumps(v) for v in json.load(json_file)['features']])
df.columns=['features']
bigquery.Client().load_table_from_dataframe(df,'temp.network_demo').result()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment