You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you very much for the SharedStreets project & library. ❤️
In the match step, the same road geometries come up every time a feature in matched with the road geometry. But, ideally we would want to JOIN as mentioned in the blog below between the matches and the raw dataset.
Step 6. Join the matched bike lanes to the scooter trip volumes
Currently, I had to something like this in Python but would be better done as a command in shst itself.
# Read all the exhaustive list of OSM features.withopen(directory/'output-boundary.out.geojson') asf:
extract_fc=json.load(f)
# Create a mapping for quick reference.extract_fc_mapping= {}
forfeatureinextract_fc['features']:
feature=json.loads(json.dumps(feature))
# Initialize the number of features matched to zero.feature['properties']['match'] =0extract_fc_mapping[feature['properties']['id']] =feature# Read all the matches.withopen(directory/'output-routes.matched.geojson') asf:
match_fc=json.load(f)
len(match_fc['features'])
# Add the counts as an attribute.forfeatureinmatch_fc['features']:
geometry_id=feature['properties']['shstGeometryId']
extract_fc_mapping[geometry_id]['properties']['match'] +=1# Write the geojson back to a file.withopen(directory/'final.geojson', 'w') asf:
json.dump(geojson.FeatureCollection(list(extract_fc_mapping.values())), f)
The text was updated successfully, but these errors were encountered:
First of all, thank you very much for the SharedStreets project & library. ❤️
In the
match
step, the same road geometries come up every time a feature in matched with the road geometry. But, ideally we would want toJOIN
as mentioned in the blog below between the matches and the raw dataset.Ref: https://sharedstreets.io/mobility-metrics-example-trip-volumes-and-street-data/
Currently, I had to something like this in Python but would be better done as a command in
shst
itself.The text was updated successfully, but these errors were encountered: