Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter crashes outside of city boundaries #174

Closed
j-t-t opened this issue Aug 22, 2018 · 1 comment
Closed

Filter crashes outside of city boundaries #174

j-t-t opened this issue Aug 22, 2018 · 1 comment

Comments

@j-t-t
Copy link
Collaborator

j-t-t commented Aug 22, 2018

For crash datasets that are on a county level, we'd like to exclude crashes outside of the city polygon.

First, a city polygon should be written to the city's data directory, e.g. data/boston/processed/maps in geojson format (in 4326 projection). That way, we won't have to get the city polygon twice.

The city polygon is sometimes generated in src/data/osm_create_maps.py (once the buffer_polygon branch is merged into master), if the city needed buffering. I think we should get the polygon even if the city didn't need buffering, and then if there's no city polygon in open street maps, also get a polygon of circle with radius around the center point given.

Then, in util.read_records, add an optional polygon argument (or maybe polygon filename), and only add records whose points are within the polygon (you'll need to reproject into 3857 projection to do this check).

Then in join_segments_crash_concern, there are two calls made to read_records. One is with record_type 'crash' and one with record_type 'concern'. You'd modify the call with record_type crash to take the polygon.

@j-t-t
Copy link
Collaborator Author

j-t-t commented Jul 22, 2019

Ended up duplicating this issue here, and it is now fixed: #274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants