【问题标题】:JAVA proper lat/long coords for google street view URL谷歌街景 URL 的 JAVA 正确纬度/经度坐标
【发布时间】:2015-07-22 15:54:08
【问题描述】:

我目前正在从我的应用程序中获取坐标,并能够查找/显示该位置的街景。我这样做是通过在我的应用程序中获取一个点的纬度,然后从参数构建一个 url,如下所示:https://developers.google.com/maps/documentation/streetview/intro 我的问题是,由于应用程序的性质,我知道我的坐标在街道上,但是谷歌地图 url 在尝试访问 url 以显示图片时说“抱歉,我们这里没有图像”。代码如下:

IGeometry shape = closestStationOrSpanFw.getIFeature().getShapeCopy();
    IPoint point = null;
    if (shape instanceof IPoint) {
        point = (IPoint) shape;
    }
    double xCoord = point.getX();
    double yCoord = point.getY();

    System.out.println("original X coordinate: " + xCoord);
    System.out.println("original Y coordinate: " + yCoord);

    GeometryUtil.projectLatLong(point);
    System.out.println("new coords: " + point.getX() + "        " + point.getY());

我认为我使用的空间参考可能存在问题? (即:我使用的坐标系与谷歌地图 API 不同)但从我所读到的情况并非如此

请注意,point.getSpatialReference().getName() 将打印“GCS_North_american_1983”

这里还有一个失败的 url 示例:https://maps.googleapis.com/maps/api/streetview?size=600x300&location=-87.858763145,34.6677027164

【问题讨论】:

  • 您提供的坐标在南极洲

标签: java coordinates gis google-street-view


【解决方案1】:

尝试使用谷歌地图而不是谷歌街景移动到该坐标。大概离马路很远吧。

实际上 -87° 仅在南极上空 3°!

在这里查看:http://www.latlong.net/c/?lat=-87.858763145&long=34.6677027164

并多次缩小以查看您所在的位置!

【讨论】:

  • 是的,我的问题实际上是我将 x 坐标用于 lat 和 y 坐标很长时间,反之亦然。问题现在解决了。为有用的资源点赞
【解决方案2】:

来自https://developers.google.com/maps/documentation/javascript/maptypes

Google 使用世界大地测量系统 WGS84 标准。

【讨论】:

  • 是的,我的问题实际上是我将 x 坐标用于 lat 和 y 坐标很长时间,反之亦然。问题现在解决了。为有用的资源点赞
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-06-20
  • 1970-01-01
  • 2014-09-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-18
相关资源
最近更新 更多