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

HTML OSM Administrative Boundary Levels jumbled, JSON OK #401

Closed
jidanni opened this issue Apr 9, 2023 · 1 comment · Fixed by #405
Closed

HTML OSM Administrative Boundary Levels jumbled, JSON OK #401

jidanni opened this issue Apr 9, 2023 · 1 comment · Fixed by #405

Comments

@jidanni
Copy link

jidanni commented Apr 9, 2023

The HTML levels are always out of order (e.g., 8, 4, 6, 2).
The JSON levels are OK.

u=https://global.mapit.mysociety.org/point/4326/-87.782,42.166
{ w3m -dump $u.html;
  w3m -dump_source $u|json_pp;}|grep Level

    ID 999545, OSM Administrative Boundary Level 8 (O08)
    ID 959228, OSM Administrative Boundary Level 4 (O04)
    ID 974962, OSM Administrative Boundary Level 6 (O06)
    ID 958719, OSM Administrative Boundary Level 2 (O02)
      "type_name" : "OSM Administrative Boundary Level 2"
      "type_name" : "OSM Administrative Boundary Level 4"
      "type_name" : "OSM Administrative Boundary Level 6"
      "type_name" : "OSM Administrative Boundary Level 8"
@dracos
Copy link
Member

dracos commented Apr 17, 2023

The HTML and JSON are both output in alphabetical order by name - the json_pp program sorts keys on output by default. I agree the sorting isn't great for the HTML output, this is a duplicate for mysociety/global.mapit.mysociety.org#5 - there's a little fix there we could do in this repo.

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

Successfully merging a pull request may close this issue.

2 participants