Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Noé
.
Toggle Highlighting
SQL
# Quad-licensed under CC-BY-SA 3.0, GNU AGPL v3, MIT/Expat License, NCSA Open Source License # Use and distribution are permitted as long as any one of the above licenses is satisfied. from PIL import Image, ImageDraw im = Image.new("L", (720, 360)) draw = ImageDraw.Draw(im) query = """ SELECT 180-ROUND(gt_lat*2), ROUND(gt_lon*2)+360, ROUND(LOG2(COUNT(gt_page_id))*16) FROM geo_tags INNER JOIN page ON page_id = gt_page_id WHERE gt_globe = "earth" AND NOT ( gt_lat = 0 AND gt_lon = 0 ) AND page_namespace = 6 GROUP BY ROUND(gt_lat*2), ROUND(gt_lon*2) ORDER BY COUNT(gt_page_id) DESC ;""" import MySQLdb connection = MySQLdb.connect( host = "commonswiki.labsdb", db = "commonswiki_p", read_default_file = "~/replica.my.cnf" ) cursor = connection.cursor() cursor.execute(query) for y, x, c in cursor.fetchall(): draw.point((x,y), fill=c) im.save("File:Geolocated_images_in_Wikimedia_Commons_2020-03-06.png", "PNG")
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...