Skip to content
New issue

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

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

Already on GitHub? # to your account

HIGHWAY_VALUES don't seem to be used to filter #36

Closed
danbjoseph opened this issue May 8, 2024 · 4 comments · Fixed by #37
Closed

HIGHWAY_VALUES don't seem to be used to filter #36

danbjoseph opened this issue May 8, 2024 · 4 comments · Fixed by #37
Assignees

Comments

@danbjoseph
Copy link
Member

danbjoseph commented May 8, 2024

@jayqi would you be able to take a look at this?

i've modified and saved create_points.py to have the following:

HIGHWAY_VALUES = {
    "primary",
    "primary_link",
    "secondary",
    "secondary_link",
    "tertiary",
    "tertiary_link",
    "residential",
}

but when i run it, a highway=tertiary doesn't get points processed, whereas a highway=service does. this is not what i would expect. here is the file: ParkView.geojson.zip and screenshots illustrating results are below.

a highway=tertiary with no points generated along its length:

Screenshot 2024-05-08 at 3 45 34 PM

a highway=service with points generated along its length:

Screenshot 2024-05-08 at 3 45 54 PM
@jayqi
Copy link
Contributor

jayqi commented May 8, 2024

@danbjoseph First thing I would check is whether you have the package installed as editable. If you run in the command line:

pip freeze | grep street-view-green-view

Example output if editable:

pip freeze | grep street-view-green-view
-e git+https://github.com/AmericanRedCross/street-view-green-view.git@11006e81cb5d9e712b23240e0b2673d20ec79761#egg=src

Example output if not editable:

❯ pip freeze | grep street-view-green-view
src @ file:///Users/jqi/repos/street-view-green-view

If it's not editable, then try reinstalling with pip install -e . Non-editable installs will only reflect a snapshot of your code at the time of installation. You need an editable install for changes to the source code to be immediately used.

@danbjoseph
Copy link
Member Author

appears to be editable?

(.venv) ➜  street-view-green-view git:(main) ✗ pip freeze | grep street-view-green-view
-e git+https://github.com/AmericanRedCross/street-view-green-view.git@037d04a4c9d70744943ce00ec29fd4c73650a980#egg=src

@jayqi
Copy link
Contributor

jayqi commented May 8, 2024

Oh, I see what's going on.

The logic in create_pointsremoves the segments that match the highway types specified by HIGHWAY_VALUES.

def remove_highways(gdf: gpd.GeoDataFrame):
"""Returns a copy of a GeoDataFrame of OpenStreetMap road features with highways
removed.

I had implemented it this way because it was just how it had been done in Treepedia. We can change this from an "exclude" list to an "include" list if you think it makes more sense.

@danbjoseph
Copy link
Member Author

yes, i think we should go with "include" - i think it would be easier to do only sidewalks and pedestrian paths or do roadways or whatever.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants