如何通过Google Maps API获取道路宽度 [英] How to get the width of a road through Google Maps API

查看:214
本文介绍了如何通过Google Maps API获取道路宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Google地图中找到道路的宽度。

Google地球无法使用,因为它不支持Linux。
Streetviews无法使用,因为它不在我居住的地区。



此链接: http://osdir.com/ml/google-maps-js-api-v3/2011-05 /msg00666.html 建议通过了解双方的坐标来找出道路两端之间的距离。因此,第一个问题是如标题所示。

顺便说一句,我已经设法显示已经在地图上的两个坐标之间的路线。



地图的类型可以通过API设置为卫星视图。
这是否会影响距离和坐标的获取?

解决方案

由于返回的地理编码有时是ROOFTOP地理编码(可能意味着建筑物的质心),而其他时间则是RANGE_INTERPOLATED,这表明它不会非常精确。请参阅 http://code.google.com/apis/maps/文档/ JavaScript的/的reference.html#GeocoderLocationType 。无论哪种情况,它都不会成为道路的边缘。



看起来Google Maps可能会把标记放到一个多远的地方地址: http://maps.google.com/maps?f=q&source=s_q&hl=zh-TW&geocode=&q=4+Clinton+Drive,+Englishtown ,+ NJ&安培;水溶液=安培; SLL = 40.299985,-74.290066&安培; SSPN = 0.009426,0.015213&安培; GL = US&安培,即= UTF8&安培; HQ =安培; hnear = 4 + +新+新泽西克林顿+博士+ Englishtown的, + 07726& t = h& z = 16

总之,除非你的用例可以容忍一个非常宽的错误栏,我认为可以安全地说这只是不起作用,至少不是没有可用的大量资源。



Google地球网络插件不适用于Linux,但如果您不需要它为网页,那么您可以尝试使用Google地球应用程序, 也许。它适用于Linux。



如果您的用例适用于相当狭窄的地理区域,则可能有其他地方可用的数据。但是从Google Maps API v3获取这个信息不太可能是一个很好的选择。

(和往常一样,当我给出我认为这不可行的答案时,我会很高兴有人来证明我错了。)


I need to find the width of roads in Google Maps.

Google Earth can't be used as it doesn't support Linux. Streetviews cannot be used, since it is not available in the area I live.

This link: http://osdir.com/ml/google-maps-js-api-v3/2011-05/msg00666.html suggests the method of finding the distance between the two ends of the road by knowing the coordinates of both sides.

Therefore the first question is as in title.

BTW, I have managed to display the "route" between the two coordinates already on the maps.

The type of the map can be set to "satellite" view through the API. Does that affect the distance and coordinates that'll be fetched?

解决方案

All this stuff about getting points across the street from each other is further complicated by the fact that sometimes the geocode returned will be a ROOFTOP geocode--likely meaning the centroid of a building--and other times, it is RANGE_INTERPOLATED which suggests that it will be not very precise. See http://code.google.com/apis/maps/documentation/javascript/reference.html#GeocoderLocationType. In either case, it won't be the edge of the road.

It may be sobering to look just how far from the road Google Maps may put the marker for an address: http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=4+Clinton+Drive,+Englishtown,+NJ&aq=&sll=40.299985,-74.290066&sspn=0.009426,0.015213&gl=us&ie=UTF8&hq=&hnear=4+Clinton+Dr,+Englishtown,+New+Jersey+07726&t=h&z=16

In short, unless your use case can tolerate a pretty wide error bar, I think it's safe to say that this just isn't going to work, at least not without considerable resources at your disposal.

Google Earth web plug-in is not available for Linux, but if you don't need it to be a web page, then you can try working with Google Earth app, perhaps. It works on Linux.

If your use case is for a reasonably narrow geographical area, there may be data available elsewhere. But getting this from Google Maps API v3 is unlikely to be a very good option.

(As always when I give a "I don't think this is feasible" answer, I'd be happy for someone to come along and prove me wrong.)

这篇关于如何通过Google Maps API获取道路宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆