Skip to content

Instantly share code, notes, and snippets.

@lmeulen
Created May 25, 2021 17:55
Show Gist options
  • Save lmeulen/8c6866493b00351a935d3c36fda40838 to your computer and use it in GitHub Desktop.
Save lmeulen/8c6866493b00351a935d3c36fda40838 to your computer and use it in GitHub Desktop.
AllPT2UT_input
import pandas as pd
import geopandas as gpd
import numpy as np
import urllib, json, csv, zipfile, sys
import matplotlib.pyplot as plt
from geopandas.tools import sjoin
from shapely.geometry import LineString, Point
with zipfile.ZipFile('gtfs-nl.zip') as z:
with z.open('stops.txt') as f:
routes = pd.read_csv(f)
routes = routes[['stop_lat', 'stop_lon']]
routes['Date'] = '03/17/2021'
routes['Time'] = '04:00PM'
routes['utc_lat'] = '52.088208'
routes['utc_lon'] = '5.113234'
routes = routes[['Date', 'Time', 'utc_lat', 'utc_lon', 'stop_lat', 'stop_lon']]
routes = routes.drop_duplicates()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment