我可以根据坐标免费获取地点详细信息吗? Geocoding/Reverse 地理编码 Api 不是免费的吗?
Can I get place details against a coordinate for free?? Geocoding/Reverse Geocoding Api is not free?
我从Geolocation.getcurrentposition得到我的当前位置,我现在有我的坐标,我可以不用任何付款就得到这个坐标的详细信息吗
不适用于地理定位包。你可以使用 exp-location 包来响应本机。在此处查找文档 https://docs.expo.io/versions/latest/sdk/location/. You can get location, get longitude and latitude, then reverse geocode and return the address object. Pricing for exp https://expo.io/pricing 有一个免费选项。
import React, {useState, useEffect} from 'react'
import * as Location from 'expo-location'
import * as Premmissions from 'expo-premmissions'
export function location(){
const [currentCoords, setCurrentCoords] = React.useState<Object>(null)
const [location, setLocation] = React.useState<Object> (null);
const [address, setAddress ] = React.useState<Object>(null);
useEffect(() => {
(async () => {
// get phone premission
let { status } = await Location.requestPermissionsAsync();
if (status !== 'granted') {
setErrorMsg('Permission to access location was denied');
return;
}
//get location using exp-location package
const location = await Location.getCurrentPositionAsync({});
setLocation(location);
setCurrentCoords({
latitude: location.coords.latitude,
longitude: location.coords.longitude,
})
// print the phone location
console.log(location)
const readOnlyAddress = await Location.reverseGeocodeAsync(currentCoords);
setAddress(readOnlyAddress[0]);
//print the postal address.
console.log(address)
})();
}, []);
let locationText = "waiting...";
if (location){
locationText = JSON.stringify(location);
}
let addressText = "waiting";
if(address){
addressText = JSON.stringify(address);
}
return(
<Text>{locationText}</Text>
<Text>{addressText}</Text>
)
}
我终于明白了,这个 API 基于从(GeoLocation.getCurrentPosition 方法)获取的用户当前位置,在客户端应用程序上是免费且无限制的。
https://www.bigdatacloud.com/geocoding-apis/free-reverse-geocode-to-city-api
必须阅读他们的条款和条件。
有一个新的在线反向地理编码服务可用。
它处于启动阶段。
无论如何,使用 http/s 请求的反向地理编码引擎是可能的。
该服务的基本演示在这里。
https://feroeg.com/Demo.html
免责声明:我是该网站的所有者。数据来自 Open StreetMap 和 OpenAddresses。
随意尝试一下。
你可以用你的浏览器查询。
示例:https://www.feroeg.com/address?lat=40.786138&lon=-73.950691&mode=text
我从Geolocation.getcurrentposition得到我的当前位置,我现在有我的坐标,我可以不用任何付款就得到这个坐标的详细信息吗
不适用于地理定位包。你可以使用 exp-location 包来响应本机。在此处查找文档 https://docs.expo.io/versions/latest/sdk/location/. You can get location, get longitude and latitude, then reverse geocode and return the address object. Pricing for exp https://expo.io/pricing 有一个免费选项。
import React, {useState, useEffect} from 'react'
import * as Location from 'expo-location'
import * as Premmissions from 'expo-premmissions'
export function location(){
const [currentCoords, setCurrentCoords] = React.useState<Object>(null)
const [location, setLocation] = React.useState<Object> (null);
const [address, setAddress ] = React.useState<Object>(null);
useEffect(() => {
(async () => {
// get phone premission
let { status } = await Location.requestPermissionsAsync();
if (status !== 'granted') {
setErrorMsg('Permission to access location was denied');
return;
}
//get location using exp-location package
const location = await Location.getCurrentPositionAsync({});
setLocation(location);
setCurrentCoords({
latitude: location.coords.latitude,
longitude: location.coords.longitude,
})
// print the phone location
console.log(location)
const readOnlyAddress = await Location.reverseGeocodeAsync(currentCoords);
setAddress(readOnlyAddress[0]);
//print the postal address.
console.log(address)
})();
}, []);
let locationText = "waiting...";
if (location){
locationText = JSON.stringify(location);
}
let addressText = "waiting";
if(address){
addressText = JSON.stringify(address);
}
return(
<Text>{locationText}</Text>
<Text>{addressText}</Text>
)
}
我终于明白了,这个 API 基于从(GeoLocation.getCurrentPosition 方法)获取的用户当前位置,在客户端应用程序上是免费且无限制的。
https://www.bigdatacloud.com/geocoding-apis/free-reverse-geocode-to-city-api
必须阅读他们的条款和条件。
有一个新的在线反向地理编码服务可用。 它处于启动阶段。 无论如何,使用 http/s 请求的反向地理编码引擎是可能的。 该服务的基本演示在这里。 https://feroeg.com/Demo.html 免责声明:我是该网站的所有者。数据来自 Open StreetMap 和 OpenAddresses。 随意尝试一下。 你可以用你的浏览器查询。 示例:https://www.feroeg.com/address?lat=40.786138&lon=-73.950691&mode=text