-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for bounding box in GeoSearchGenerator #57
Comments
See also this Wikimedia API bug report related to the use of |
Thanks for your links, @zstadler ! I will check on this and work on the implementation after the holiday, which is, tomorrow 😄 |
Published I'm planning to refector GeoSearch, GeoCoordinate and GeoCoordinateRectangle API. I'm going to extract the |
Thanks for this! :-) |
I've tried this roughly, and ranges less than 0.2 degrees in longitude and lattitude seem okay. WikiClientLibrary/UnitTestProject1/Tests/GeneratorTests.cs Lines 413 to 422 in cafda1f
My hypothesis is that on MW API server, eventually you cannot bypass the So if you are planning to scan on some larger area the earth, you may need to split your range into a grid, and request for the smaller tiles one by one from the client. And |
Thanks for the quick response! |
When using the var geoSearchGenerator = new GeoSearchGenerator(new WikiSite(wikiClient, new SiteOptions($"https://he.wikipedia.org/w/api.php")))
{
BoundingRectangle = GeoCoordinateRectangle.FromBoundingCoordinates(34.75, 32, 34.9, 32.15),
PaginationSize = 1000 // this is ignored
};
var results = await geoSearchGenerator.EnumItemsAsync().ToListAsync(); // this returns only 500... Let me know if you want me to open a new issue on this or am I missing out something? |
Same request from the browser: |
It seems so. GeoSearch does not support pagination for now. Example response of https://en.wikipedia.org/w/api.php?action=query&maxlag=5&list=geosearch&gsradius=10&gsprimary=primary&gslimit=2&gsbbox=32.15%7C34.75%7C32%7C34.9 {
"batchcomplete": "",
"query": {
"geosearch": [
{
"pageid": 18328987,
"ns": 0,
"title": "Beit Zvi",
"lat": 32.078408333333336,
"lon": 34.821713888888894,
"dist": 489.4,
"primary": ""
},
{
"pageid": 46324352,
"ns": 0,
"title": "HaAliya HaShniya Garden",
"lat": 32.0697,
"lon": 34.8148,
"dist": 1127.4,
"primary": ""
}
]
}
} |
I think the continuation problem is originally tracked with phab:T95241 and closed as duplicate of phab:T78703. Unfortunately, I don't think |
Let's use #64 to track this. |
The Wikimedia geosearch supports the use of a bounding box as an alternative to the coordinates+radius as a Geograpic selector:
and provides an example:
Since the coordinates+radius approach is limited to a 10000 meter radius, combining multiple requests in order to cover a larger area is a challenge. On the other hand, the use of a bounding box for searching Wikimedia is easier to aggregate and to integrate with other Geographic systems
Please consider adding support for search based on a bounding box.
The text was updated successfully, but these errors were encountered: