标签: geocoding

寻找免费的地理定位服务(来自国家/省/市)或数据库?

我正在寻找免费服务(提供定期更新的网络服务或数据库),这将允许我检索国家/箴/城市的地理位置(长/纬).

雅虎和谷歌的API是不可接受的,因为他们每天限制请求的总量.

web-services geocoding

6
推荐指数
1
解决办法
4793
查看次数

在Google地图中标记街道

我想在Google地图上创建一个叠加层,以不同的颜色显示不同的街道.

在Google Maps API中,可以创建覆盖特定区域的标记和多边形.

有没有办法以某种方式标记不同的街道?

google-maps geocoding

6
推荐指数
1
解决办法
4486
查看次数

Android:Nexus One - Geocoder导致IOException - 与其他设备和模拟器完美配合

下面的代码适用于在1.5,1.6和2.0上运行的实际设备以及在2.1上运行的仿真器.

但是,在Nexus One(运行2.1)上执行它会引发IOException:

java.io.IOException: Unable to parse response from server
at android.location.Geocoder.getFromLocation(Geocoder.java:124)
Run Code Online (Sandbox Code Playgroud)

这是它发生的代码片段:

Double myLatitude = AppObject.myLocation.getLatitude();
Double myLongitude = AppObject.myLocation.getLongitude();
DEBUG.i(TAG, "My location: " + myLatitude + " | " + myLongitude);
Geocoder geocoder = new Geocoder(MainActivity.this);
java.util.List<Address> addressList;
try {
    addressList = geocoder.getFromLocation(myLatitude, myLongitude, 5);
    if(addressList!=null && addressList.size()>0) {
        currentAddress = new String();
        DEBUG.i(TAG,addressList.get(0).toString());
        currentAddress = addressList.get(0).getAddressLine(0) + ", "
        + addressList.get(0).getAddressLine(1) + ", "
        + addressList.get(0).getAddressLine(2); 

    }
    return true;

} catch (IOException e) {
    e.printStackTrace();
    return false; …
Run Code Online (Sandbox Code Playgroud)

android geocoding ioexception nexus-one

6
推荐指数
1
解决办法
4082
查看次数

将城市/州从SQL Server加载到谷歌地图?

我正在尝试创建一个小型应用程序,它将城市和州以及地理位置解析为纬度/经度.现在我正在使用Google Map的API,ColdFusion和SQL Server.基本上,城市和州的字段都在数据库表格中,我想要获取这些位置并将标记放在谷歌地图上,以显示它们的位置.

这是我执行地理编码的代码,查看页面源代码显示它正确循环查询并在地址字段中放置位置("奥马哈,NE"),但没有标记或地图,正在页面上显示:

function codeAddress() {
<cfloop query="GetLocations">
    var address = document.getElementById(<cfoutput>#Trim(hometown)#,#Trim(state)#</cfoutput>).value;
      if (geocoder) {
         geocoder.geocode( {<cfoutput>#Trim(hometown)#,#Trim(state)#</cfoutput>: address}, function(results, status) {
         if (status == google.maps.GeocoderStatus.OK) {
             var marker = new google.maps.Marker({
             map: map, 
             position: results[0].geometry.location,
             title: <cfoutput>#Trim(hometown)#,#Trim(state)#</cfoutput>
             });
         } else {
            alert("Geocode was not successful for the following reason: " + status);
            }
         });
      }     
</cfloop> }
Run Code Online (Sandbox Code Playgroud)

以下是初始化地图的代码:

var geocoder;
var map;

function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(42.4167,-90.4290);
    var myOptions = {
      zoom: …
Run Code Online (Sandbox Code Playgroud)

javascript sql-server coldfusion google-maps geocoding

6
推荐指数
1
解决办法
3394
查看次数

使用时区信息进行地理编码

有没有一种方法可以从纬度/经度坐标或物理地址获取带有DST信息的时区信息?

我发现一些似乎提供此服务的Web服务,但我不知道它们可能有多可靠,或者它们是否会在某些时候消失.我的应用需要一些长期的东西.

这些服务是否可靠且长期?还有其他更好的选择吗?

rest timezone web-services geocoding geolocation

6
推荐指数
1
解决办法
3502
查看次数

SQL Server中经度/纬度值的数据库存储:decimal(2,?)

在表定义中,我看到:

Latitude     ->    varchar(50)
Longitude    ->    nvarchar(50)
Run Code Online (Sandbox Code Playgroud)

很明显,我立即质疑这背后的想法 - 确信这些价值实际上是数字的.长话短说:我假设这些将是数字,十进制实际上,我们会抛弃'思想在弦中'的哲学.

现在为了我的困境,我只是继续输入:

Latitude    ->    decimal(2, 4)
Run Code Online (Sandbox Code Playgroud)

但坚持一秒,4不对,对吗?对.所以我认为我在达到阈值之前(可能会在一瞬间添加)6或者8也可能不会削减它.所以,首先要做的事情......

我是否正确坚持我们甚至这样做?如果是这样...

要存储这些值的精度,以确保我们可以保留要插入的整个值?例如,是否有任何预定义规范?

我不仅仅想使用Latitude -> decimal(2, 16)简单的东西,就像它decimal(2, 2)原则上一样有缺陷.类似的问题出现在经度专门,但我假设一个人的答案足够另一个,即decimal(3, answer).

我们正在使用MSSQL Server 2005.

我似乎是通过手工经验教育自己使用SQL Server,因此这个问题的部分内容无关紧要:我无论如何都只能使用decimal(x, max(x))它decimal(x, y)!将问题保留为输入.

sql sql-server types geocoding

6
推荐指数
1
解决办法
1万
查看次数

基于地区的本地通知

我目前正在使用"Regions"示例代码:https: //developer.apple.com/library/ios/#samplecode/Regions/Introduction/Intro.h tml#// apple_ref/doc/uid/DTS40010726-Intro-DontLinkElementID_2

我想更进一步,当用户退出该区域时生成或触发通知(可以同时进入和退出,我不介意,对于初始实现最简单的事情).

我一直在查看CLLocation类参考,位置感知编程指南以及本地和推送通知编程指南.而我正在遭受信息超载.

非常感谢 :)

编辑:我想我可能有一个解决问题的想法:在RegionsViewController实现文件中有这样的:

- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region        {
    NSString *event = [NSString stringWithFormat:@"didExitRegion %@ at %@", region.identifier, [NSDate date]];

    [self updateWithEvent:event];
}
Run Code Online (Sandbox Code Playgroud)

由于我想在用户退出指定区域边界时实现本地通知,我输入了以下内容:

- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region {
    NSString *event = [NSString stringWithFormat:@"didExitRegion %@ at %@", region.identifier, [NSDate date]];
    [self updateWithEvent:event];
    //implement local notification: 
    UIApplication *app                = [UIApplication sharedApplication];
    UILocalNotification *notification = [[UILocalNotification alloc] init];
    [[UIApplication sharedApplication] cancelAllLocalNotifications];

    if (notification == nil)
        return;

    notification.alertBody = [NSString stringWithFormat:@"Did You Lock Your …
Run Code Online (Sandbox Code Playgroud)

geocoding geolocation geofencing

6
推荐指数
1
解决办法
3137
查看次数

谷歌地图地理编码API,其JS API中缺少API的功能(?)

问题很简单,在地理编码API的文档中,他们说存在组件过滤.(来源:https://developers.google.com/maps/documentation/geocoding/)

但是,如果我查看JS文档(https://developers.google.com/maps/documentation/javascript/geocoding),它似乎没有实现.但是我记得google之前曾经使用过但没有在其API中编写的功能,所以我想知道是否有人知道如何使用Google Maps Geocoding API实现组件过滤?

谢谢!

javascript google-maps geocoding google-geocoding-api

6
推荐指数
1
解决办法
3473
查看次数

Google地图会对字符串进行地理编码

我刚接触谷歌地图api并完成了地理编码示例:

https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple

我希望能够在我的代码中对字符串进行地理编码,并在该位置放置标记,而不是用户搜索位置.到目前为止我的代码是:

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <title>Geocoding service</title>
    <style>
      html, body, #map-canvas 
      {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    <script>
   //global variables 
var geocoder;
var map;
var Ireland = "Dublin";

function initialize() 
{
  geocoder = new google.maps.Geocoder();
  var latlng = new google.maps.LatLng(53.3496, -6.3263);
  var mapOptions = 
  {
    zoom: 8,
    center: latlng
  }
  map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  codeAddress();//call the function
}

function codeAddress() 
{
  var address = document.getElementById("Ireland").value;
  geocoder.geocode( …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps geocoding google-maps-api-3

6
推荐指数
2
解决办法
5万
查看次数

如何在POINT类型的MySQL字段中输入"空"POINT()几何值?

我有一个带有POINT几何字段的表.我像这样输入纬度/经度点:

INSERT INTO table( point )
VALUES( POINT( lon_value, lat_value );
Run Code Online (Sandbox Code Playgroud)

有时候我没有输入lat/lon值.我无法输入空白,空值或空的POINT()...因为POINT(0,0)实际上是地球上的一个位置,这也不起作用.

这里有什么解决方案?

mysql geocoding point geolocation geospatial

6
推荐指数
1
解决办法
892
查看次数