我正在使用ggmap的地理编码来查找不同城市的纬度和经度.它昨天完全没问题,但是今天只有一个请求后我得到了一个超额的限制.
事实上,如果我只是加载库并运行地理编码,它会抛出OVER QUERY LIMIT错误:
> library(ggmap)
> geocode("Paris")
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Paris&sensor=false
lon lat
1 NA NA
Warning message:
geocode failed with status OVER_QUERY_LIMIT, location = "Paris"
Run Code Online (Sandbox Code Playgroud)
我在stackoverflow上检查了不同的主题,但似乎没有人遇到同样的问题.我试着看看我是否超过2500限制(非常不可能,但我是新编码,所以也许我做错了...)并且geocodeQueryCheck()读取2498然后再次重置它每次运行库(ggmap) .
十五分钟前,当我重新启动Rstudio时,它已经工作了,但现在它不再起作用,我完全迷失了!
有谁知道可能是什么问题?
PS:我是stackoverflow的新手,所以如果你对任何事情有任何评论,请告诉我!
我正在使用Google的Geocoder来查找给定地址的lat lng坐标.
var geocoder = new google.maps.Geocoder();
geocoder.geocode(
{
'address': address,
'region': 'uk'
}, function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
lat: results[0].geometry.location.lat(),
lng: results[0].geometry.location.lng()
});
Run Code Online (Sandbox Code Playgroud)
address 变量取自输入字段.
我想只在英国搜索位置.我认为指定'region': 'uk'应该足够但不是.当我输入"波士顿"时,它在美国找到波士顿,我想在英国找到它.
如何限制Geocoder仅从一个国家或某个纬度范围返回位置?
谢谢
由于Google Maps API在以色列不可用(请参阅此处),我想使用OpenStreetMap.我对所有不同的地理编码方式感到困惑,即找到lat,地址为long.
我也在寻找最佳的路由方式,即使用OSM在两个位置之间显示路由.
我在客户端上寻找JavaScript,在我的服务器上寻找.NET.
我也在寻找一种可以与希伯来语中的名字一起使用的解决方案,但我不认为这是一个限制.
有人可以就Google地图地理编码API的配额限制提出建议吗?我在android上使用地理编码.谷歌地图Api网站规定每天限额为2,500.这是API密钥的总数吗?或每个IP地址?我找到了这篇文章:http: //code.google.com/apis/maps/articles/geocodestrat.html#quota-limits
其中规定配额限制与IP地址相关,但这指的是网站.谁能回答这个问题?显然这是一个巨大的差异,每个设备每天2,500个地理编码查找对于大多数应用程序来说已经足够了.
我有一个纬度和经度坐标列表,并希望找出它们所在的国家/地区.
我修改了一个关于lat-long到美国各州的问题的答案,并且有一个工作功能,但我遇到的问题是worldHires地图(来自mapdata包裹)可怕地过时并且包含许多过时的国家,如南斯拉夫和苏联.
如何修改此函数以使用更现代的包,例如rworldmap?到目前为止,我只是挫败了自己...
library(sp)
library(maps)
library(rgeos)
library(maptools)
# The single argument to this function, points, is a data.frame in which:
# - column 1 contains the longitude in degrees
# - column 2 contains the latitude in degrees
coords2country = function(points)
{
# prepare a SpatialPolygons object with one poly per country
countries = map('worldHires', fill=TRUE, col="transparent", plot=FALSE)
names = sapply(strsplit(countries$names, ":"), function(x) x[1])
# clean up polygons that are out of …Run Code Online (Sandbox Code Playgroud) 我使用以下代码来获取当前位置即(纬度和经度),但我没有获得当前位置(纬度和经度).
谁知道为什么?
package com.ram.currentlocation;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;
public class Location_Gps extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/* Use the LocationManager class to obtain GPS locations */
LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
}
/* Class My Location Listener */
public class MyLocationListener implements LocationListener
{
@Override
public …Run Code Online (Sandbox Code Playgroud) android geolocation latitude-longitude google-latitude geocode
我一直在谷歌搜索我试图找到与我有同样问题的人,没有运气.所以这是我的问题:
我正在尝试实现地址的自动完成建议,因为用户在Android中使用地理编码器键入地点的名称.我希望它的行为与使用combbox的javascript版本大致相同.
我正在使用带有AutoCompleteTextView的布局,以及一个arrayadapter,可以在用户输入时动态更新建议列表.我在收到onTextChanged()事件之后添加了500ms的延迟,然后使用Handler调用geocoder.getFromLocationName.如果用户在500毫秒内输入更多字母,则最后一个事件将被取消.我遇到的问题是,这些建议几乎从未在UI中显示为下拉列表中的可选项.我得到了地址建议,但当我将它们添加到附加到autocomplatetextview的适配器时,它们很简单.
我在使用API级别7的模拟器上运行此功能,包括谷歌api.
现在有一些源代码可以帮助你:布局:
<LinearLayout android:id="@+id/searchInputLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="6dip"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/searchMessage" />
<EditText android:id="@+id/freetextInput"
android:hint="@string/searchFreetextLabel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background" />
<CheckBox android:id="@+id/includeVincinityCheckbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/includeVincinityLabel"
android:checked="true"
android:onClick="includeVincinityClick" />
<AutoCompleteTextView android:id="@+id/locationInput"
android:hint="@string/locationInputHint"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<Button android:id="@+id/searchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/searchBtnLabel"
android:onClick="searchBtnClicked" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我的活动的源代码(我省略了不相关的代码):
public class SearchLocationTabActivity extends Activity implements TextWatcher, OnItemSelectedListener {
private static final int MESSAGE_TEXT_CHANGED = 0;
private static final int AUTOCOMPLETE_DELAY = 500;
private static final int THRESHOLD = 3;
private String latitude, longitude; …Run Code Online (Sandbox Code Playgroud) 我正试图从谷歌地图地理编码api获取LatLng.我的代码在下面,地址值是"纽约,纽约"
$.ajax({
url: 'http://maps.googleapis.com/maps/api/geocode/json',
data: {
sensor: false,
address: address
},
success: function (data) {
alert(data)
}
});
Run Code Online (Sandbox Code Playgroud)
但我没有得到警惕的任何价值.
谢谢你的帮助.
我想计算两个地理点的距离.这些点以经度和纬度给出.
坐标是:
第1点:36.578581,-118.291994
第2点:36.23998,-116.83171
这里有一个网站来比较结果:
http://www.movable-type.co.uk/scripts/latlong.html
这里是我从这个链接使用的代码: 计算谷歌地图V3中两点之间的距离
const double PIx = Math.PI;
const double RADIO = 6378.16;
/// <summary>
/// Convert degrees to Radians
/// </summary>
/// <param name="x">Degrees</param>
/// <returns>The equivalent in radians</returns>
public static double Radians(double x)
{
return x * PIx / 180;
}
/// <summary>
/// Calculate the distance between two places.
/// </summary>
/// <param name="lon1"></param>
/// <param name="lat1"></param>
/// <param name="lon2"></param>
/// <param name="lat2"></param>
/// <returns></returns>
public static double DistanceBetweenPlaces(double lon1, double lat1, …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用库中的geocode函数来获取特定位置的坐标.到目前为止,我能够正常使用该功能.ggmapsR
我遇到的问题是我希望将每日限制从2,500增加到100,000.官方Google 文档
说,如果您在项目上启用结算,这很容易实现,我很乐意这样做.继续此过程后,Google Developers Console将为您提供个性化的API密钥.
但是,该geocode功能无法选择放入此个性化API密钥.相反,它要求client(业务用户的客户端ID)和signature(业务用户的签名),这是Google Maps API for Work客户可以访问API的方式.我知道这也是一个选项,但这似乎是一个非常大的用例,因为Google Maps API for Work似乎是为大型企业帐户设计的:
根据年度合同购买,每24小时的每日配额为100,000个请求.
所以我的问题归结为:我可以使用库中的geocode函数来ping Google Maps Geocoding API吗?ggmapsR
geocode ×10
google-maps ×5
android ×3
r ×3
geolocation ×2
ajax ×1
api ×1
autocomplete ×1
c# ×1
c#-4.0 ×1
ggmap ×1
gps ×1
javascript ×1
jquery ×1
maps ×1
routing ×1
rworldmap ×1