I want to know whether a point is on land or water using google maps geocoding api.
If I give my coordinate point as (40,-74) which is on water body, I am still getting address which is shown below.
the address is:1416 Highland Ave, Cinnaminson, NJ 08077, USA results[0].geometry.locationType:ROOFTOP results[0].types[0].toString():street_address(which has to be "natural_feature")
I am using java client library to do this. Anyone help me because I have strucked up here and has to submit my assignment where soon. Thanks in Advance.
答案 0 :(得分:0)
您可以按结果类型和位置类型过滤反向地理编码的结果。在结果类型中,您可以查找natural_feature,并且位置类型应该是GEOMETRIC_CENTER或APPROXIMATE,以排除任何可以接近陆地上给定点的ROOFTOP地址。
请查看以下请求:
回应的前两项是:
现在,如果我对陆地上的点执行相同的请求:
第一个结果将是' Drum Point Rd,Brick,NJ 08723,USA'路线类型。
希望它有所帮助。