query: #Big cities, grouped into map layers by population
  #defaultView:Map
  SELECT DISTINCT ?city ?cityLabel (SAMPLE(?location) AS ?location) (MAX(?population) AS ?population) (SAMPLE(?layer) AS ?layer)
  WHERE
  {
    ?city wdt:P31/wdt:P279* wd:Q515;
          wdt:P625 ?location;
          wdt:P1082 ?population.
    FILTER(?population >= 150000).
    BIND(
      IF(?population < 500000, "<500K",
      IF(?population < 1000000, "<1M",
      IF(?population < 2000000, "1M-2M",
      IF(?population < 5000000, "2M-5M",
      IF(?population < 10000000, "5M-10M",
      IF(?population < 20000000, "10M-20M",
      ">20M"))))))
      AS ?layer).
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  }
  GROUP BY ?city ?cityLabel