mediawiki api - Filter Wikipedia geosearch per region -
i saw wikipedia api (called mediawiki geodata) search wiki pages around fixed coordinates. example call is
https://it.wikipedia.org/w/api.php?action=query&list=geosearch&gsradius=10000&gscoord=37.786971|-122.399677
i saw geodata, in extra parameters, has concept of region, accepting iso 3166-2 region code.
how can search elements, filtering per region code? example, if searching around coordinates near border between 2 regions, able filter elements of 1 region?
short answer: can't.
longer answer: lack 2 features filed in issue tracker you, i.e.
- populating region parameter in geodata: pages do not specify region geodata in free text (which useless), structured data have in wikidata;
- adding option filter results region.
for now, you'll have client-side: figure out coordinates of each region , filter those; or search region in wikidata statements , fetch corresponding articles in language desired. developer help import country data in wikidata ;-).
(expanded maxsem's answer, hence wiki.)
Comments
Post a Comment