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

Modify gate min zoom to 17 #820

Closed
nvkelso opened this issue May 16, 2016 · 13 comments
Closed

Modify gate min zoom to 17 #820

nvkelso opened this issue May 16, 2016 · 13 comments
Assignees
Milestone

Comments

@nvkelso
Copy link
Member

nvkelso commented May 16, 2016

In working on #819 for kind:toll_booth, we've discovered the min zoom of kind: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?

@nvkelso
Copy link
Member Author

nvkelso commented May 16, 2016

For context, we hide most gates from display in the map because the data is too funky in tiles now.

@rmarianski rmarianski added this to the v1.0.0 milestone May 16, 2016
@zerebubuth
Copy link
Member

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.

@zerebubuth zerebubuth assigned nvkelso and unassigned zerebubuth May 17, 2016
@rmarianski
Copy link
Member

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.

👍

@nvkelso nvkelso assigned okavvada and unassigned nvkelso Jul 21, 2016
@okavvada
Copy link
Contributor

okavvada commented Jul 25, 2016

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?

@nvkelso
Copy link
Member Author

nvkelso commented Jul 25, 2016

Only for gate (not for toll_booth). Let me look for some gates on roads...

@zerebubuth
Copy link
Member

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.

@nvkelso
Copy link
Member Author

nvkelso commented Jul 25, 2016

@nvkelso
Copy link
Member Author

nvkelso commented Aug 25, 2016

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.

@nvkelso nvkelso self-assigned this Aug 25, 2016
@nvkelso
Copy link
Member Author

nvkelso commented Sep 8, 2016

I don't see the gate by Moffet field referenced in this test, did the test pass?

@nvkelso
Copy link
Member Author

nvkelso commented Sep 8, 2016

(everything else checks out)

@nvkelso nvkelso assigned zerebubuth and unassigned nvkelso Sep 8, 2016
@nvkelso
Copy link
Member Author

nvkelso commented Sep 8, 2016

@zerebubuth Can you please run the integration tests against dev to see if they all pass, please?

@nvkelso
Copy link
Member Author

nvkelso commented Sep 9, 2016

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

@nvkelso nvkelso assigned nvkelso and unassigned zerebubuth Sep 9, 2016
@nvkelso
Copy link
Member Author

nvkelso commented Sep 22, 2016

Verified Moffett Gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants