goat-community / goat

This is the home of Geo Open Accessibility Tool (GOAT)
GNU General Public License v3.0
89 stars 47 forks source link

Mark psv:yes as not walkable #284

Open EPajares opened 4 years ago

EPajares commented 4 years ago

There is existing the osm-tag psv that is frequently used for bus- or tramways. At least in Munich they are generally highway=service. They are generally not walkable and often not cycleable. We could check if it makes sense to classify them as foot='no'

rafleo2008 commented 3 years ago

I was doing some tests with Bogotá, I think this could be the correct query (we could try to test it also in other cities)

SELECT * FROM planet_osm_line WHERE highway = 'service' AND (tags->'psv' = 'yes' OR tags->'psv' = 'bus' OR tags->'bus' = 'yes');

Perhaps in the tags->'bus' = yes, we should try to test with other modes, like 'trams' or 'brt'

On the other hand, where should we have to drop those links from the database? I was checking the file "network_preparation.sql", but looks like the filter process (of create planet_osm_line, and transfer the data to ways) was done before this script.

EPajares commented 3 years ago

Do you think (tags -> 'psv' ) is not null would also do it? I would not delete them from the DB but we could label the associated network links from the ways table with foot='no' and cycling='no'.

The table ways and planet_osm_line share the same osm_id.

EPajares commented 3 years ago

You could put this classification in line 344 of the script /data_preparation/SQL/network_modification.sql

rafleo2008 commented 3 years ago

Do you think (tags -> 'psv' ) is not null would also do it? I would not delete them from the DB but we could label the associated network links from the ways table with foot='no' and cycling='no'.

The table ways and planet_osm_line share the same osm_id.

Sometimes works but is not enough to cover all the cases. First, the tag psv is not null groups all the values of psv = 'yes' and psv = 'bus'. In terms of the tag bus = 'yes', I've found some cases in BOG and MUC where the tag psv does not cover all the dedicated lanes (and therefore, points the need to use extra tags). The examples are shown below.

munich Bogota

As this code has major impact in the Bogotá Network, I think I'll implement the next code in BOG. SELECT * FROM planet_osm_line WHERE highway = 'service' AND (tags->'psv' IS NOT NULL OR tags->'bus' = 'yes');

Finally, as you mentioned, I'll classify the roads as foot='no', as shown here:

UPDATE ways SET foot = 'no' WHERE osm_id = ANY (SELECT osm_id FROM planet_osm_line WHERE highway = 'service' AND (tags->'psv' IS NOT NULL OR tags->'bus' = 'yes'));

EPajares commented 3 years ago

Thanks. I see. Make sense. We need to check in the long run if there are cases where tags -> 'bus' = 'yes' can be walkable but I don't think this is frequently the case. There might be also other attributes like designated for bus: https://wiki.openstreetmap.org/wiki/Key:bus

For now this fix should help though. The query could be more performant like this:

UPDATE ways w SET foot = 'no' FROM ( SELECT osm_id FROM planet_osm_line WHERE highway = 'service' AND (tags->'psv' IS NOT NULL OR tags->'bus' = 'yes') ) x WHERE w.osm_id = x.osm_id;

EPajares commented 3 years ago

@rafleo2008 can we close this issue?

rafleo2008 commented 3 years ago

This one will be included in the next push request