mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
getNearbyItemCount: Added javadoc
This commit is contained in:
parent
c3deea4849
commit
24acf3f56f
2 changed files with 8 additions and 1 deletions
|
|
@ -332,6 +332,12 @@ class OkHttpJsonApiClient @Inject constructor(
|
||||||
throw Exception(response.message)
|
throw Exception(response.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the count of items in the specified area by querying Wikidata.
|
||||||
|
*
|
||||||
|
* @param queryParams: a `NearbyQueryParam` specifying the geographical area.
|
||||||
|
* @return The count of items in the specified area.
|
||||||
|
*/
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun getNearbyItemCount(
|
fun getNearbyItemCount(
|
||||||
queryParams: NearbyQueryParams
|
queryParams: NearbyQueryParams
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,8 @@ public class NearbyPlaces {
|
||||||
}
|
}
|
||||||
|
|
||||||
// minRadius, targetRadius and maxRadius are radii in decameters
|
// minRadius, targetRadius and maxRadius are radii in decameters
|
||||||
// unlike other
|
// unlike other radii here, which are in kilometers, to avoid looping over
|
||||||
|
// floating point values
|
||||||
int minRadius = 0, maxRadius = Math.round(Math.min(300f, Math.min(longGap, latGap))) * 100;
|
int minRadius = 0, maxRadius = Math.round(Math.min(300f, Math.min(longGap, latGap))) * 100;
|
||||||
int targetRadius = maxRadius / 2;
|
int targetRadius = maxRadius / 2;
|
||||||
while (minRadius < maxRadius) {
|
while (minRadius < maxRadius) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue