Page MenuHomePhabricator

[feature request] allow selection by East and West corners on Wikidata Query Service wikibase:box
Closed, ResolvedPublic


Per and
the following should be supported

wikibase:cornerSouthWest The south-west corner of the box.
wikibase:cornerNorthEast The north-east corner of the box.
wikibase:cornerSouthEast The south-east corner of the box.
wikibase:cornerNorthWest The north-west corner of the box.

This feature request suggests to add the following:
wikibase:cornerWest A west corner of the box.
wikibase:cornerEast An east corner of the box.

Depending on the value, the server would determine if it was S or N.
If latitude of W > latitude of E = W is NW, E is SE,
otherwise it's SW and NE.

Sample query, based on the current sample one, should give comparable results:

Schools between San Jose, CA and Sacramento, CA

wd:Q986857 wdt:P625 ?SJloc .
wd:Q17152020 wdt:P625 ?SCloc .
SERVICE wikibase:box {
    ?place wdt:P625 ?location .
    bd:serviceParam wikibase:cornerWest ?SJloc .
    bd:serviceParam wikibase:cornerEast ?SCloc .
?place wdt:P31/wdt:P279* wd:Q3914 .


Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald Transcript

Change 300456 had a related patch set uploaded (by Smalyshev):
Add funxtionality to allow search box with any pair of coordinates.

Change 300456 merged by jenkins-bot:
Add functionality to allow search box with any pair of coordinates.

Smalyshev triaged this task as Medium priority.Jul 27 2016, 5:47 PM

I think adding just wikibase:cornerWest/wikibase:cornerEast should be enough, since with that you can specify any diagonal corners.

Ok for me. I prefer this feature over T139823

Using this approach also avoids having to check if someone isn't using NE & SE, etc.