poi api
Places give value to maps. We want to know what interesting places are near us, where those places are located, and how we can best travel to them. These are the primary reasons maps have become so useful to us, pretty much since maps have been available. And today, from searching for a restaurant for dinner, to routing a road trip to a new city, to finding a hotel to stay in, interacting with location information has become ubiquitous.
地方赋予地图价值。 我们想知道我们附近有哪些有趣的地方,这些地方在哪里以及我们如何最好地前往它们。 这是地图对我们如此有用的主要原因,这几乎是因为地图已经可用。 如今,从寻找晚餐餐厅到路由前往新城市的路途,再到寻找住宿的酒店,与位置信息进行交互已变得无处不在。
In the mapping world, we call these locations or places “points of interest” (POI), and they can take the form of addresses, landmarks, or even simply arbitrary markers. But exactly how can you access POI data and turn it into a smooth user experience for your app?
在制图世界中,我们称这些位置为“兴趣点”(POI),它们可以采用地址,地标甚至是任意标记的形式。 但是,究竟如何才能访问POI数据并将其转变为应用程序的流畅用户体验呢?
In this article, we’ll help you navigate POIs from a developer’s perspective and examine the various ways you can integrate them for your users, as well as point you to the different tools and technologies TomTom offers to power your apps with an extensive, global, and consistent POI database for easily finding and displaying places.
在本文中,我们将帮助您从开发人员的角度浏览POI,并研究为用户集成POI的各种方法,并为您指明TomTom提供的各种工具和技术,以广泛的全球性为您的应用提供支持以及一致的POI数据库,以便轻松查找和显示地点。
A point of interest is a specific location that someone may find useful or noteworthy. Broad definition, huh? Yup. It’s basically a way to mark and classify geographic locations that have some significance. They might be homes, businesses, buildings, cities, or even just one big tree inside a park. Some common examples of POIs on maps include railway stations, airports, restaurants, and hotels.
兴趣点是某人可能会发现有用或值得注意的特定位置。 宽泛的定义,对吧? 对。 这基本上是标记和分类具有重要意义的地理位置的一种方法。 它们可能是房屋,企业,建筑物,城市,甚至只是公园内的一棵大树。 地图上POI的一些常见示例包括火车站,机场,饭店和酒店。
What makes POIs important in an app is that they’re the fundamental elements end users interact with when it comes to locations. POIs are often what the end-user knows rather than an exact address or coordinates.
在应用中使POI变得重要的原因是,POI是最终用户在定位时与之交互的基本元素。 POI通常是最终用户知道的,而不是确切的地址或坐标。
For example, you might know the name and even the general location of your favorite ice cream place or restaurant, but probably can’t provide an address from memory. Same for hotels: when looking for directions to a hotel, you rarely enter the address into the search box of whatever app you’re using. Typically, we start with the hotel name. When searching for POIs, users can search for them in a list, see them on a map as icons, and route paths between them. Being able to give your users the most relevant, important, and up-to-date places can be absolutely critical to an app that works with location datasets, and that’s where TomTom APIs can help you succeed. We work with many global and local companies to continually grow our POI coverage, breadth, depth and data quality. TomTom has recently integrated millions of new POIs from Foursquare — a global POI data partner of TomTom — to provide our users with an even better location technology service.
例如,您可能知道您最喜欢的冰淇淋场所或餐厅的名称,甚至是一般位置,但可能无法从内存中提供地址。 对于酒店也是如此:在寻找前往酒店的路线时,您很少会在所使用的任何应用程序的搜索框中输入地址。 通常,我们以酒店名称开头。 搜索POI时,用户可以在列表中搜索它们,在地图上以图标的形式查看它们,并在它们之间路由路径。 对于使用位置数据集的应用程序而言,能够为用户提供最相关,最重要和最新的位置绝对至关重要,这就是TomTom API可以帮助您成功的地方。 我们与许多全球和本地公司合作,以不断扩大我们的POI覆盖范围,广度,深度和数据质量。 TomTom最近已经集成了来自 TomTom的全球POI数据合作伙伴Foursquare的数百万个新POI,以为我们的用户提供更好的定位技术服务。
With access to POI data, developers have enabled people to sift through and manage location information around the world faster and better than ever before. Finding landmarks, discovering nearby pizza restaurants, navigating traffic routes, or even taking a walking tour of a city can now happen immediately in real-time using a mobile app. Integrating points of interest seamlessly into location-based applications changes how people interact with real-world places and are a crucial part of many mapping and location apps. Having quick access to accurate POI data and being able to work with it easily is tremendously powerful for your users. With regard to POI data, keep in mind that it’s not just about having place names and locations; the depth of information an app offers matters, too. Where are the entrances to the museum? What are the days and hours of operation? Information that can answer key context questions like these allows apps to provide real value to users and can make or break the experience. The good news is that by connecting to TomTom APIs, you can easily offer this deep level of information to your users. Not only is it easy to use TomTom APIs, but with a TomTom POI database that includes nearly 100 million points of interest in over 180 countries and territories, labeled with hundreds of POI categories, you also have comprehensive data to offer users. TomTom Enterprise customers can also get POIs in a dataset format, enabling an even broader set of use cases. With a connection to a reliable and vast POI database, you can enable very specific search results for your users to display only the relevant places by using POI categories with as much or as little granularity as you need. For instance, you could add a family dinner suggestions map that would show restaurants in an area, but not fast food. When you’re using TomTom APIs coupled with an extensive database of millions of POIs, the possibilities are endless.
通过访问POI数据,开发人员使人们能够比以往更快,更好地筛选和管理全球位置信息。 现在,可以使用移动应用程序实时实时查找地标,发现附近的比萨餐厅,导航交通路线甚至进行城市徒步旅行。 将兴趣点无缝集成到基于位置的应用程序中,可以改变人们与现实世界的互动方式,并且是许多地图和位置应用程序的关键部分。 快速访问准确的POI数据并能够轻松使用它对您的用户而言非常强大。 关于POI数据,请记住,这不只是具有地名和位置的信息; 应用程序提供的信息深度也很重要。 博物馆的入口在哪里? 营业时间是几小时? 可以回答此类关键上下文问题的信息使应用程序可以为用户提供真正的价值,并可以创造或破坏体验。 好消息是,通过连接到TomTom API,您可以轻松地向用户提供这种深层次的信息。 TomTom API不仅易于使用,而且拥有一个TomTom POI数据库,该数据库包含180多个国家和地区的近1亿个兴趣点,标有数百个POI类别,您还可以为用户提供全面的数据。 TomTom Enterprise客户还可以获取数据集格式的POI,从而实现更多用例集。 通过与可靠且庞大的POI数据库的连接,您可以通过使用POI类别(尽可能根据需要)来启用非常特定的搜索结果,以便用户仅显示相关的地点。 例如,您可以添加家庭晚餐建议地图,该地图将显示某个地区的餐馆,但不显示快餐。 当您将TomTom API与数百万个POI的广泛数据库结合使用时,可能性是无限的。
Let’s take a look at how you can work with POI data in just a single HTTP call. The simplest way to start leveraging TomTom data is with the Fuzzy Search API to find places and basic information, such as place names, addresses, and POI locations. It’s as easy as making an HTTP web request with parameters passed in via a query string, along with your TomTom API key. You can even just put the link into your web browser to test it. The URI takes the form of /search/{versionNumber}/search/{query}.{ext}and the current version is 2. So, for example, if you wanted to get a list of cafés within a 1km radius in Paris, France returned in JSON format, it would look like:
让我们看一下如何通过单个HTTP调用处理POI数据。 开始利用TomTom数据的最简单方法是使用Fuzzy Search API查找地点和基本信息,例如地点名称,地址和POI位置。 就像通过查询字符串发出的参数以及TomTom API密钥发出HTTP Web请求一样简单。 您甚至可以将链接放入Web浏览器中进行测试。 URI的格式为/search/{versionNumber}/search/{query}。{ext},当前版本为2。因此,例如,如果您想获取巴黎方圆1公里范围内的咖啡馆列表, France以JSON格式返回,如下所示:
https://api.tomtom.com/search/2/search/coffee.json?countrySet=FR&lat=48.85&lon=2.34&radius=1000&idxSet=POI&categorySet=7315&key=YOUR_API_KEYLet’s take a moment to break down the query string parameters in the link:
让我们花一点时间来分解链接中的查询字符串参数:
countrySet is a comma-separated list of country codes to specify which countries to search within. In this example, FR indicates France.
countrySet是用逗号分隔的国家/地区代码列表,用于指定要在其中搜索的国家/地区。 在此示例中,FR表示法国。
lat and lon represent the latitude and longitude coordinates to focus the search. The coordinates for Paris are 48.85, 2.34.
lat和lon代表经纬度坐标以集中搜索。 巴黎的坐标是48.85,2.34。
radius is the radius area of the search specified in meters, in our case 1km.
radius是以米为单位指定的搜索半径区域,在本例中为1km。
idxSet is a comma-separated list of indexes for the search. For this search, we only listed the POI index.
idxSet是用于搜索的索引的逗号分隔列表。 对于此搜索,我们仅列出了POI索引。
categorySet specifies comma-separated list of categories for POI searches. 7315 is the “restaurant” category. There are hundreds of categories you can specify. To get the complete list, you can call the POI Categories API endpoint /search/{versionNumber}/poiCategories.{ext} or use the API Explorer.
categorySet指定以逗号分隔的POI搜索类别列表。 7315是“餐厅”类别。 您可以指定数百种类别。 要获取完整列表,您可以调用POI分类API端点/search/{versionNumber}/poiCategories.{ext}或使用API Explorer 。
key is your TomTom Developer API key. If you don’t have an API key, you can get one for free by signing into the TomTom Developer Dashboard.
密钥是您的TomTom Developer API密钥。 如果您没有API密钥,则可以通过登录TomTom Developer Dashboard免费获得一个。
The JSON formatted date returned in the response will give you a lot of information for each returned POI, including name, phone, address, distance, categories, and more if available in the database, and will look a bit like this:
响应中返回的JSON格式日期将为您提供每个返回的POI的很多信息,包括名称,电话,地址,距离,类别以及数据库中可用的更多信息,并且看起来会像这样:
{ "summary":{ "query":"coffee", "queryType":"NON_NEAR", "queryTime":65, "numResults":10, "offset":0, "totalResults":15, "fuzzyLevel":1, "geoBias":{ "lat":48.85, "lon":2.34 } }, "results":[ { "type":"POI", "id":"FR/POI/p0/2112353", "score":2.404910087585449, "dist":497.0501740330584, "info":"search:ta:250009036855126-FR", "poi":{ "name":"Coffee Parisien", "phone":"+(33)-(1)-43541818", "categorySet":[ { "id":7315069 } ], "url":"www.coffee-parisien.fr", "categories":[ "hamburgers", "restaurant" ], "classifications":[ { "code":"RESTAURANT", "names":[ { "nameLocale":"en-US", "name":"restaurant" }, { "nameLocale":"en-US", "name":"hamburgers" } ] } ] }, "address":{ "streetNumber":"4", "streetName":"Rue Princesse", "municipalitySubdivision":"6ème Arrondissement", "municipality":"Paris", "countrySecondarySubdivision":"Paris", "countrySubdivision":"Île-de-France", "postalCode":"75006", "countryCode":"FR", "country":"France", "countryCodeISO3":"FRA", "freeformAddress":"4 Rue Princesse, Paris, 75006", "localName":"Paris" }, "position":{ "lat":48.85254, "lon":2.33441 }, "viewport":{ "topLeftPoint":{ "lat":48.85344, "lon":2.33304 }, "btmRightPoint":{ "lat":48.85164, "lon":2.33578 } }, "entryPoints":[ { "type":"main", "position":{ "lat":48.85255, "lon":2.33445 } } ] }, ... ] }Integrating this kind of detailed POI information into your app, combined with other TomTom services, lets you provide your users with nearby searches, routes, travel times, traffic, and much more. And while the above Fuzzy Search shows just a simple example, there are many other parameters available to further customize and narrow a search. For a full list of options, check the Search API Explorer for Fuzzy Search.
将这种详细的POI信息集成到您的应用程序中,再结合其他TomTom服务,可以为您的用户提供附近的搜索,路线,旅行时间,交通等信息。 尽管上面的模糊搜索仅显示了一个简单的示例,但还有许多其他参数可用于进一步自定义和缩小搜索范围。 有关选项的完整列表,请检查Search API Explorer以进行模糊搜索。
We just saw how, with a single web request to the Fuzzy Search endpoint of the TomTom Search API, you can put a powerful location search through millions of POIs into the hands of your users. Imagine what might be possible with just a bit more data. Why don’t you try adding POI data to your app now? Some great places to start developing with POIs in your app are the functional samples for Search and Geocoding and Customizing Markers. To learn more about using POIs with TomTom APIs, we recommend you check out these resources:
我们只是看到了如何通过对TomTom Search API的Fuzzy Search端点的单个Web请求,通过数百万个POI将强大的位置搜索置于用户手中。 想象一下,仅增加一点数据就可以实现什么。 您为什么不立即尝试将POI数据添加到您的应用程序? 在您的应用中开始使用POI进行开发的一些好地方是搜索和地理编码以及自定义标记的功能示例。 要了解有关将TomTom API与POI结合使用的更多信息,建议您查看以下资源:
The Search API and Extended Search API, to get started with location search, filtering options, and looking at response data, as well as Best Practices to help improve your API query results.
Search API和Extended Search API ,以开始使用位置搜索,过滤选项和查看响应数据,以及帮助改善API查询结果的最佳做法 。
The Map Display API, to get a POI map of any location for your web and mobile apps.
Map Display API ,用于获取Web和移动应用程序任何位置的POI地图。
The TomTom Maps SDKs for Web, iOS, and Android, which provide easy access to these and other TomTom services.
适用于Web , iOS和Android的TomTom Maps SDK,可轻松访问这些服务和其他TomTom服务。
To help you get even more out of our TomTom APIs, we also provide extensive tutorials, functional examples and detailed documentation. For background details on POIs and TomTom location services, see the blog posts How to Use POI Data to Power Your Location-Based Application and Where to Open a Chinese Restaurant in Amsterdam using TomTom Maps APIs. And lastly, for any questions or feedback, we encourage you to reach out to us in the TomTom developer forum. Good luck and happy coding!
为了帮助您充分利用TomTom API,我们还提供了广泛的教程 , 功能示例和详细的文档 。 有关POI和TomTom定位服务的背景详细信息,请参阅博客文章如何使用POI数据为基于位置的应用程序提供动力,以及在何处使用TomTom Maps API在阿姆斯特丹开设中餐馆 。 最后,对于任何问题或反馈,我们鼓励您在TomTom 开发人员论坛中与我们联系。 祝您好运,编码愉快!
This article was first published at https://developer.tomtom.com/blog. The original author is Olivia Vahsen.
本文最初发表在 https://developer.tomtom.com/blog上 。 原始作者是Olivia Vahsen。
翻译自: https://medium.com/tomtom-developers/understanding-places-and-poi-apis-4f46a98499ae
poi api
相关资源:POI 的 API