使用Google地图API获取游戏的街景图 [英] Get street graph for a game using Google Maps API

查看:162
本文介绍了使用Google地图API获取游戏的街景图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是谷歌地图API的新手,我想开发一款将谷歌地图上的街道作为路径的游戏。我很清楚自己需要什么,但我甚至不知道要在API文档中开始搜索什么......



我该如何获得某些东西就像一个城市或谷歌地图的其他部分的街道图形表示 - 类似于交叉点的顶点和边缘的街道名称(或任何可以转换为类似的东西),顶点映射到(lat,long )坐标点......甚至街道上的Polyline对象,以便我可以从中提取我想要的东西? (路由查找算法肯定可以访问像这样的数据结构,所以它在某处,但是我怎么通过API来获取它)



<如果有人试图写一些类似于基于Google Maps的自定义路线查找应用程序,他可能会经历从API中获取这些数据之王的步骤,所以如果您已经想到了,请分享此解决方案它出... ...

解决方案

街道数据不可通过API使用,除非它出现在路线服务的输出中。为了获得大量数据,您似乎需要了解您的使用情况,您需要根据国家/地区查找其他来源,这可能是免费的;或者您可以从 OpenStreetMaps 获取所需内容。

I'm a total newbie to the Google Maps API and I want to develop a game that will use streets on google maps as the paths. I know pretty well what I need, but I don't even know what to begin searching for in the API docs...

How can I get something like a graph representation for the streets in a city or other portion of a google map - something like vertices for intersection and street names for edges (or anything that I can convert to something like this), with the vertices mapped to (lat, long) coordinate points ...or even the Polyline objects for the streets so I can extract what I want from them? (the route finding algorithm surely has access to a data structure like this, so it's in there somewhere, but how do I get at it through the API?)

If anyone has tried to write something like a custom route finding app based on Google Maps, he probably went through the step of getting this king of data out of the API, so please share the solution to this if you've already figured it out...

解决方案

Street data is not available through the API except as it appears in the output of the directions service. To get the bulk data you seem to be asking about for your use, you will need to find another source, depending on country, it may be freely available; or you might be able to get what you need from OpenStreetMaps.

这篇关于使用Google地图API获取游戏的街景图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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