AmericanRedCross / street-view-green-view

BSD 3-Clause "New" or "Revised" License
8 stars 9 forks source link

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

Closed danbjoseph closed 1 month ago

danbjoseph commented 1 month ago

@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 commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

Oh, I see what's going on.

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

https://github.com/AmericanRedCross/street-view-green-view/blob/037d04a4c9d70744943ce00ec29fd4c73650a980/src/create_points.py#L42-L44

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 commented 1 month ago

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.