Created
April 4, 2021 11:31
-
-
Save lmeulen/b0519a5ef8a3634e2c1176b5c1c95110 to your computer and use it in GitHub Desktop.
crowdedness_create_network
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
network = trips.drop_duplicates('route_id').dropna() | |
network = network[~(network.trip_long_name == 'Stopbus i.p.v. trein')] | |
features=[] | |
for si in network.shape_id.unique(): | |
section = shapes[shapes.shape_id == si] | |
ls =LineString(section[['shape_pt_lon','shape_pt_lat']].to_numpy().tolist()) | |
features.append( | |
Feature(geometry=ls, properties=dict(label=str(si))) | |
) | |
with open('network.geojson', 'w') as outfile: | |
dump(FeatureCollection(features), outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment