Page MenuHomePhabricator

Geoshape service returns topojson when asked geojson
Closed, DuplicatePublic

Description

Query example:

https://maps.wikimedia.org/geoshape?getgeojson=1&query=SELECT+%3Fid%0A%28SAMPLE%28%3Fimg%29+as+%3Fimg%29+%0A%28SAMPLE%28%3Ffill%29+as+%3Ffill%29+%0A%28SAMPLE%28%3FlinkCapital%29+as+%3FlinkCapital%29+%0A%28SAMPLE%28%3FcapitalLabel%29+as+%3FcapitalLabel%29+%0A%28concat%28%27%5B%5Bwikipedia%3A%27%2C+substr%28str%28%3Flink%29%2C31%2C500%29%2C++%27+%7C+%27%2C+%3FdepartmentLabel%2C+%27%5D%5D%27%29+as+%3Ftitle%29%0A%28concat%28%27Capital%3A+%5B%5Bwikipedia%3A%27%2C+substr%28str%28%3FlinkCapital%29%2C31%2C500%29%2C++%27+%7C+%27%2C+%3FcapitalLabel%2C+%27%5D%5D%27%2C+%27%5Cn%27%2C+%27%5B%5BFile%3A%27%2C+substr%28str%28%3Fimg%29%2C+52%2C+500%29%2C+%27%7C200px%5D%5D%27%29+as+%3Fdescription%29%0AWHERE+%7B%0A++%3Fid+wdt%3AP31+wd%3AQ6465+.%0A++FILTER+NOT+EXISTS+%7B+%3Fid+wdt%3AP576+%5B%5D+%7D%0A++OPTIONAL+%7B%0A++++%3Fid+wdt%3AP41+%3Fimg+.%0A++%7D%0A++OPTIONAL+%7B%0A++++%3Fid+wdt%3AP36+%3Fcapital+.%0A++++%3FlinkCapital+schema%3Aabout+%3Fcapital+.%0A++++%3FlinkCapital+schema%3AisPartOf+%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E+.%0A++%7D%0A++OPTIONAL+%7B%0A++++%3Fid+wdt%3AP1082+%3Fpopulation+.%0A++++BIND%28if%28%3Fpopulation+%3E%3D+1000000%2C+%27%237B4E10%27%2C+if%28%3Fpopulation+%3E%3D+500000%2C+%27%23FFCC33%27%2C+%27%23FEF6E7%27%29%29+as+%3Ffill%29+%0A++%7D%0A++%3Flink+schema%3Aabout+%3Fid+.%0A++%3Flink+schema%3AisPartOf+%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E+.%0A++SERVICE+wikibase%3Alabel+%7B%0A++++bd%3AserviceParam+wikibase%3Alanguage+%27en%2Cfr%27+.%0A++++%3Fid+rdfs%3Alabel+%3FdepartmentLabel+.%0A++++%3Fcapital+rdfs%3Alabel+%3FcapitalLabel+.%0A++%7D%0A%7D+GROUP+BY+%3Fid+%3Flink+%3FdepartmentLabel+

When passed getgeojson=1, it used to return GeoJSON. It now returns TopoJSON, which makes the map unable to read and display the data.