Created
December 18, 2020 17:40
-
-
Save francois-baptiste/223d8d01bf7af964148325723689c8ba to your computer and use it in GitHub Desktop.
Load demo graph from geojson-path-finder js lib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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