简体   繁体   English

android搜索附近的公交车站google api

[英]android search nearby bus stop google api

I have android project for searching nearby bus stops i have this url: http://travelplanner.mobiliteit.lu/hafas/query.exe/dot?performLocating=2&tpl=stop2csv&stationProxy=yes&look_maxdist=250&look_x=6112550&look_y=49610700 我有一个用于搜索附近公交车站的android项目,我有以下网址: http : //travelplanner.mobiliteit.lu/hafas/query.exe/dot?performLocating=2&tpl= stop2csv& stationProxy= yes& look_maxdist= 250& look_x= 6112550& look_y=49610700

i write in the code 我写代码

  StringBuilder sb = newStringBuilder("http://travelplanner.mobiliteit.lu/hafas/query.exe/dot?performLocating=2&tpl=stop2csv&stationProxy=yes &");
                   sb.append("look_maxdist=250");sb.append("look_x="+mLatitude");sb.append("look_y="+mLongitude");

where mLatitude and mLongitude are for current user location 其中,mLatitude和mLongitude用于当前用户位置

now the response in not json but http response 现在响应不是json而是http响应

6,113204;49,610280;200403005;Belair, Sacré-Coeur;http://travelplanner.mobiliteit.lu/hafas/stboard.exe/dn?L=vs_stb&input=200403005&start 

6,112260;49,612644;200403002;Belair, Archiducs;http://travelplanner.mobiliteit.lu/hafas/stboard.exe/dn?L=vs_stb&input=200403002&start 

or as link maybe 或作为链接

id=A=1@O=Belair, Sacré-Coeur@X=6,113204@Y=49,610280@U=82@L=200403005@B=1@p=1481807866; 

id=A=1@O=Belair, Archiducs@X=6,112260@Y=49,612644@U=82@L=200403002@B=1@p=1481807866; 

the question is how i can continue with this result to ge coordinates (6,113204,49,610280)and put marker on the map here is the link https://data.public.lu/en/datasets/arrets-de-transport-public-et-departs-en-temps-reel/ 问题是我如何继续此结果以ge坐标(6,113204,49,610280)并将标记放在地图上,这里是链接https://data.public.lu/zh/datasets/arrets-de-运输公共和离开卷筒/

From this url you get the id for the request. 从该URL中,您可以获得请求的ID。

http://travelplanner.mobiliteit.lu/hafas/query.exe/dot?performLocating=2&tpl=stop2csv&stationProxy=yes &look_maxdist=250&look_x=6112550&look_y=49610700 http://travelplanner.mobiliteit.lu/hafas/query.exe/dot?performLocating=2&tpl=stop2csv&stationProxy=yes&look_maxdist = 250&look_x = 6112550&look_y = 49610700

Now you received response as below : 现在您收到以下响应:

id=A=1@O=Belair,%20Sacré-Coeur@X=6,113204@Y=49,610279@U=82@L=200403005@B=1@p=1459856195 id = A = 1 @ O = Belair,%20Sacré-Coeur@ X = 6,113204 @ Y = 49,610279 @ U = 82 @ L = 200403005 @ B = 1 @ p = 1459856195

Now, append received response with below url and you will get the response in json. 现在,在下面的URL后面附加收到的响应,您将在json中获得响应。

http://travelplanner.mobiliteit.lu/restproxy/departureBoard?accessId=cdt&format=json& http://travelplanner.mobiliteit.lu/restproxy/departureBoard?accessId=cdt&format=json&

For example: 例如:

http://travelplanner.mobiliteit.lu/restproxy/departureBoard?accessId=cdt&format=json&id=A=1@O=Belair,%20Sacré-Coeur@X=6,113204@Y=49,610279@U=82@L=200403005@B=1@p=1459856195 http://travelplanner.mobiliteit.lu/restproxy/departureBoard?accessId=cdt&format=json&id=A=1@O=Belair,%20Sacré-Coeur@X=6,113204@Y=49,610279@U=82@L = 200403005 @ B = 1 @ p = 1459856195

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:如何使用Google Places API(自动填充)搜索附近的酒店? - Android: How to search for nearby hotels using the Google Places API (Autocomplete)? 附近的Android应用搜索 - Android App search nearby 尝试将Google附近消息API集成到Android项目中 - Trying to integration Google Nearby Message API in android project Google Places API获取Android中附近地点的距离 - Google places api get distance of nearby places in android 优化对最近公交车站的搜索 - Optimize the search of the closest bus stop 订阅时的 Android Nearby API NullPointerException - Android Nearby API NullPointerException at Subscribe 如何使用Java中的改造从Google附近的搜索API检索图像网址 - How to retrieve an image url from Google nearby search API using retrofit in java 使用 Zomato API 搜索附近的餐馆 - Search nearby restaurants using Zomato API LocationListener,LocationRequest,LocationServices在实施Google Maps API时导入无效,以便在Android Studio中查找附近的地点 - LocationListener, LocationRequest, LocationServices imports invalid while implementing Google Maps API to find nearby places in Android Studio 使用Android Nearby API检测Beacon(Eddystone) - Detect Beacon (Eddystone) with Android Nearby API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM