gpt4 book ai didi

android - 如何确定地理坐标附近是否存在街道或地址?

转载 作者:行者123 更新时间:2023-11-29 17:34:47 26 4
gpt4 key购买 nike

我的程序为谷歌计算 WGS84 中的新坐标(经度和纬度)。您如何验证这些坐标下是街道还是地址。

最佳答案

此功能由 TGeocoder 类提供 - 文档可在此处找到:

类别:TGeocoder

Used for handling geocoding and reverse geocoding.

Geocoding is the process of transforming geographic data like address, zip codes into geographic coordinates. Reverse geocoding is the process for transforming geographical coordinates into other geographical data, such as address. The Initialize procedure must be used before using TGeocoder for the first time through the Current property. The Supported function determines whether the geocoding can be realized. Authorized determines whether the application is authorized to use the service.

您可能需要的方法:TGeocoder.GeocodeReverse

Requests the address matching the specified geographic coordinates.

要创建特定于您的平台/设备的 TGeocoder 类的实例,您可以使用 .Current 类属性 as described in the documentation .

// ... in your class
private
FGeocoder: TGeocoder;
procedure OnGeocodeReverseEvent(const Address: TCivicAddress);

然后

// Setup an instance of TGeocoder
if not Assigned(FGeocoder) then
begin
if Assigned(TGeocoder.Current) then
FGeocoder := TGeocoder.Current.Create;
if Assigned(FGeocoder) then
FGeocoder.OnGeocodeReverse := OnGeocodeReverseEvent;
end;

关于android - 如何确定地理坐标附近是否存在街道或地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31001773/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com