Closed nvkelso closed 8 years ago
For context, we hide most gates from display in the map because the data is too funky in tiles now.
A query like this will do the trick:
SELECT
osm_id,
MAX(CASE
WHEN highway IN ('motorway', 'trunk', 'primary', 'motorway_link',
'trunk_link', 'primary_link') THEN 3
WHEN highway IN ('secondary', 'tertiary', 'secondary_link',
'tertiary_link') THEN 2
WHEN highway IN ('residential', 'unclassified') THEN 1
ELSE 0
END) AS highway_level
FROM (
SELECT
p.osm_id,
hstore(w.tags)->'highway' AS highway
FROM planet_osm_point p
JOIN planet_osm_ways w
ON ARRAY[p.osm_id] && w.nodes
WHERE
p.way && <insert bbox here>
AND p.barrier='gate'
AND hstore(w.tags) ? 'highway'
) x
GROUP BY osm_id;
This will have a performance impact but hopefully, since gates are relatively rare, it might not be noticeable. The form above is good for experimentation, but it's probably best for maintainability to rewrite it as a function of osm_id
returning the appropriate highway level (or zoom level) and then just use that as the min_zoom
expression in the YAML.
The form above is good for experimentation, but it's probably best for maintainability to rewrite it as a function of osm_id returning the appropriate highway level (or zoom level) and then just use that as the min_zoom expression in the YAML.
:+1:
Is this referring to kind:gate
or kind:toll_booth
? Usually, gates are not digitized on the road, I couldn't find any examples of a gate on a major highway, secondary road. kind:toll_booth
are digitized on highways. Should the rule apply to kind:toll_booth
?
Only for gate
(not for toll_booth
). Let me look for some gates on roads...
Here's an example of a gate at the end of a secondary road. This one in Quantico Marine Corps base is in the middle of the road, but I'd expect to find gates on military bases, even on higher class roads. Same for this one on the University of Virginia campus.
I'm using this Overpass query to find matching gates. Although a great many seem to be where footpaths join the road, suggesting that they're editing mistakes, and the gate is far more likely to be on the footpath than the secondary road.
highway=residential
example: http://www.openstreetmap.org/node/2591034891 (NYC metro area), expected zoom 16 for minor roadshighway=secondary
: http://www.openstreetmap.org/node/3608363612 outside of Yosemite National Park, expected zoom 15 for major roadshighway=unclassified
: http://www.openstreetmap.org/node/276321344 (Moffett Field between SF and San Jose). Should be visible at zoom 16 (minor roads generally).highway=residential
and highway=service
and barrier=fence
: http://www.openstreetmap.org/node/1510908481 (SF park), expected zoom 16 because of the roads. highway=residential
(but with an access control change) http://www.openstreetmap.org/node/702390031 in SF, expected zoom 16.Dev's not loading many z16 tiles at the moment, and not even some z15 tiles so holding off verification until it's sorted itself out.
I don't see the gate by Moffet field referenced in this test, did the test pass?
(everything else checks out)
@zerebubuth Can you please run the integration tests against dev to see if they all pass, please?
The following tests failed (including gate):
integration-test/524-peak-kind-tile-rank.py
integration-test/661-historic-transit-stops.py
integration-test/719-add-kind-detail-for-pois.py
integration-test/742-predictable-layers-pois.py
integration-test/820-gate-min-zoom.py
integration-test/829-garden-pois.py
integration-test/841-normalize-boundaries-kind.py
integration-test/896-ne-shield-enums.py
integration-test/927-normalize-operator-values.py
integration-test/931-locality-changes-places.py
integration-test/981-remove-unstyled-ne-places.py
integration-test/982-remove-unstyled-localities.py
integration-test/993-remove-props-road-merge.py
Verified Moffett Gates.
In working on https://github.com/mapzen/vector-datasource/pull/819 for
kind:toll_booth
, we've discovered the min zoom ofkind:gate
POIs to be very high at zoom 15. That should be defaulting to zoom 17 instead as many gates are digitized in fences, not just across roads.@zerebubuth How hard would it be to modify the zoom based on what road class the the gate was on?
A gate on a path &/or fence at zoom 17. But a gate on a major road zoom 14 and minor road zoom 15?