-7

我想统计一个地区的医院数量。 GPS坐标给出,我想知道有多少医院出口在一定的米半径。如何找出GPS坐标附近的医院数量?

使用技术类型没有限制或限制。它可能是Java,google-maps-apis,android或者这些技术的任何组合。

+1

使用此API:https://maps.googleapis.com/maps/api/place/nearbysearch/json?location = LatitudeValue,LangitudeValue&radius = 5000&types = hospital&sensor = true&key = APIKEY' – Stallion

+0

@Stallion这会将它绘制在地图上。我需要在数据库中收集啤酒花数量。 –

+0

API不会绘制。它会给出响应数据。你需要迭代并找出结果。 – Stallion

回答

1

如果医院的坐标提供,你可以计算出你和医院之间的距离坐标使用该

float[] distance = new float[2]; 

Location.distanceBetween(marker.getPosition().latitude, marker.getPosition().longitude, 
    circle.getCenter().latitude, circle.getCenter().longitude, distance); 

if(distance[0] > circle.getRadius() ){ 
    Toast.makeText(getBaseContext(), "Outside", Toast.LENGTH_LONG).show(); 
} else { 
    Toast.makeText(getBaseContext(), "Inside", Toast.LENGTH_LONG).show(); 
} 

文档被here

+0

这似乎很有帮助。可以收集坐标。我会试一试。 –