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

Elevation / height no longer rendered for peaks, alpine huts, waterfalls etc. #3765

Closed
jeisenbe opened this issue Apr 25, 2019 · 2 comments · Fixed by #3774
Closed

Elevation / height no longer rendered for peaks, alpine huts, waterfalls etc. #3765

jeisenbe opened this issue Apr 25, 2019 · 2 comments · Fixed by #3774

Comments

@jeisenbe
Copy link
Collaborator

Expected behavior

  • Peaks, volcanoes, saddles, alpine huts, and guideposts were previously displayed with their name and their elevation in meters when this was tagged as ele=*
  • The height of a waterfall was added to the name as well

Actual behavior

Test renderings illustrating the problem

Current rendering of Mt Everest with master branch
z16-everest-current

Rendering with commit 712afb8 (immediately before PR 3712) and same data
z16-everest-before-ele-shown

Test area current
z19-test-height-ele-current

Before
z19-ele-height-before

@matkoniecz
Copy link
Contributor

Thanks for catching this!

@jeisenbe jeisenbe mentioned this issue May 2, 2019
@jeisenbe
Copy link
Collaborator Author

jeisenbe commented May 5, 2019

I've tried to fix this, but I can't figure out how to reformat the SQL correctly.

Previously this was in the main SQL select for the text-point layer:

            CONCAT(
                name,
                CASE WHEN name IS NOT NULL AND (elevation IS NOT NULL OR height IS NOT NULL) THEN E'\n' ELSE NULL END,
                CASE WHEN elevation IS NOT NULL THEN CONCAT(REPLACE(ROUND(elevation)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') ELSE NULL END,
                CASE WHEN height IS NOT NULL THEN CONCAT(ROUND(height)::TEXT, U&'\00A0', 'm') ELSE NULL END
            ) AS name,
            CASE
              WHEN "natural" IN ('peak', 'volcano', 'saddle') THEN elevation
              WHEN "waterway" IN ('waterfall') THEN height
              ELSE NULL
            END AS score,

And this was in the subselect:

                CASE
                  WHEN "natural" IN ('peak', 'volcano', 'saddle')
                    OR tourism = 'alpine_hut' OR (tourism = 'information' AND tags->'information' = 'guidepost')
                    OR amenity = 'shelter' THEN
                    CASE
                      WHEN tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'ele')::NUMERIC
                      ELSE NULL
                    END
                  ELSE NULL
                END AS elevation,
                CASE
                  WHEN "waterway" IN ('waterfall') THEN
                    CASE
                      WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC
                      ELSE NULL
                    END
                  ELSE NULL
                END AS height,

Note that we would need to change the "height" column for waterfalls into "elevation" or something like "int_height" since man_made=tower is also selected with "height" in the amenity-points layer.

I've tried to insert these lines back into the new id: amenity-points layer, but I get errors.

Perhaps @pnorman has time to look into this one?

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

Successfully merging a pull request may close this issue.

3 participants