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

OUTDATED: Add is_paved boolean for road layer features #1335

Closed
nvkelso opened this issue Jul 26, 2017 · 9 comments
Closed

OUTDATED: Add is_paved boolean for road layer features #1335

nvkelso opened this issue Jul 26, 2017 · 9 comments
Labels
Milestone

Comments

@nvkelso
Copy link
Member

nvkelso commented Jul 26, 2017

Picking up from #1334.... There are lots of different surface values, some of which fall under the generic rubric of "paved" and others which don't. Let's add a generic is_paved boolean for road layer features.

Once we have the is_paved logic we should also revisit dropping surface at low zooms, see #1334.

In Mapzen's bike map theme for Walkabout we have to test a long list of surface values, it would be more convenient to know if something is paved or not. (There are also plans to do more with surface for a road focused theme.)

Here's how OSM.org cartography categories them:

CASE
    WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass',
        'grass_paver', 'gravel', 'ground', 'mud', 'pebblestone', 'salt', 'sand',
        'wood chips', 'clay') THEN 'unpaved'
    WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened',
        'sett', 'concrete', 'concrete:lanes', 'concrete:plates', 'paving_stones', 'metal',
        'wood') THEN 'paved'

Note: we don't use : in Tilezen property names or values so the following are re-mapped:

  • cobblestone:flattened to cobblestone_flattened
  • concrete:lanes to concrete_lanes
  • concrete:plates to concrete_plates
@zerebubuth
Copy link
Member

Would we default is_paved to true or false? Or different defaults for different road types (e.g: true for roads, false for tracks and paths)?

@nvkelso
Copy link
Member Author

nvkelso commented Jul 26, 2017

Generally we only export boolean values when true, so I see your point ;) Maybe we only export it when false?

(There's also a related concept here of warning people when a surface is impassable when wet for clay and related kind values, commonly seen in desert southwest of United States and Australian outback.)

Agree we should vary default by highway=* (and see related tracktype where only grade1 is assumed paved). We should probably do what Valhalla is doing. From the OSM wiki:

For roads for motor vehicles there there is normally an assumption that the surface is surface=paved unless otherwise stated. Paved in OpenStreetMap is non-specific and may cover sealed, tarmac, asphalt, bitumen. surface=unpaved is treated as the opposite of paved.

For Tangram we can test:

  • filter: { is_paved: true } will match any feature with that property (any value)
  • filter: { is_paved: false } will match any feature without that property
  • filter: { is_paved: [true] } will only match feature with that property when value is true
  • filter: { is_paved: [false] } will only match feature with that property when value is false

From TagInfo values with ≥ 0.01% &/or greater than 500 count.

sufrace count % wiki remapping
asphalt 6 752 489 38.40%  
unpaved 3 248 873 18.48%  
paved 2 333 886 13.27%  
ground 1 199 169 6.82%  
gravel 1 106 077 6.29%  
concrete 547 291 3.11%  
dirt 531 377 3.02%  
paving_stones 463 595 2.64%  
grass 444 335 2.53%  
compacted 214 843 1.22%  
sand 200 335 1.14%  
cobblestone 157 759 0.90%  
fine_gravel 57 193 0.33%  
wood 51 736 0.29%  
sett 39 743 0.23%  
earth 36 181 0.21%  
pebblestone 31 963 0.18%  
concrete:plates 31 844 0.18% - concrete_plates 
mud 9 922 0.06%  
clay 9 731 0.06% -  
grass_paver 8 462 0.05%  
metal 7 915 0.05%  
concrete:lanes 7 472 0.04% concrete_lanes 
paving_stones:30 6 180 0.04% paving_stones 
tartan 5 915 0.03% -  
artificial_turf 4 397 0.03% -  
dirt/sand 3 971 0.02% -  dirt_sand
cobblestone:flattened 3 815 0.02% cobblestone_flattened
asphalt␣no␣1 3 660 0.02% - asphalt ??
stone 3 143 0.02% -  
bricks 2 565 0.01% -  
hard 1 827 0.01% -  
cement 1 666 0.01% -  
rock 1 507 0.01% -  
interlock 1 498 0.01% -  
brick 1 270 0.01% -  
ground;grass 1 235 0.01% - ground ??
rocky 1 223 0.01% -  
soil 1 031 0.01% -  
asphalt␣no␣1 3 660 0.02% - asphalt ??
grass;earth 832 0.00% - grass ?? 
woodchips 807 0.00% -  
pebbles 644 0.00% -  
gravel;ground 633 0.00% - gravel ??
granite 618 0.00% -  
limerock 610 0.00% -  
laterite 570 0.00% -  
grass;ground 557 0.00% - grass ??
asphalt␣deg␣2 524 0.00% asphalt ??
metal_grid 513 0.00% -  
shells 506 0.00% -  

NOTE: is used to represent a space character.

@matkoniecz
Copy link
Contributor

cobblestone:flattened is not transformed at this moment, I filed #1337 to correct this

@matkoniecz
Copy link
Contributor

paving_stones:30

Maybe it would be better to ignore this values? 6k usages is not significant and maybe encouraging using sensible surface values overall would have a better effect?

Note that is used to (it seems) to marking paving stones as ones with size of 30cm. Encouraging to use it means encouraging to use separate surface value for every size of paving stone.

@matkoniecz
Copy link
Contributor

matkoniecz commented Jul 26, 2017

Or different defaults for different road types (e.g: true for roads, false for tracks and paths)?

Location (is given way inside park/forest etc) is already computed, maybe set highway=path/footway default depending on location?

For example unpaved as default in forests, paved as default in urban areas?

@nvkelso
Copy link
Member Author

nvkelso commented Jul 26, 2017

Maybe it would be better to ignore this values (nvk: of paving_stones:30)? 6k usages is not significant and maybe encouraging using sensible surface values overall would have a better effect?

I'm fine remapping it to paving_stones. I've updated the table.

@nvkelso
Copy link
Member Author

nvkelso commented Jul 26, 2017

Location (is given way inside park/forest etc) is already computed, maybe set highway=path/footway default depending on location?
For example unpaved as default in forests, paved as default in urban areas?

👍 That's a great idea!

This would require queries.yaml to do the landuse_kind intercut before we calculate the is_paved value.

@nvkelso nvkelso changed the title Add is_paved boolean for road layer features OUTDATED: Add is_paved boolean for road layer features Dec 2, 2018
@nvkelso
Copy link
Member Author

nvkelso commented Dec 2, 2018

Moving in to the v1.6 milestone as I think it should be marked process changed with what @zerebubuth proposes in #1710 (comment).

@nvkelso nvkelso added this to the v1.6.0 milestone Dec 2, 2018
@nvkelso
Copy link
Member Author

nvkelso commented Dec 6, 2018

Process changed to #1716.

@nvkelso nvkelso closed this as completed Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants