我尝试将osrm路由解析到列表,我解析对此请求的响应:
public class StepsItem {
private String mode;
private double duration;
private double distance;
private String name;
private double weight;
private String geometry;
private String drivingSide;
private List<IntersectionsItem> intersections;
private Maneuver maneuver;
private String destinations;
private String ref;
}
但是我如何获取列表?
我该如何解析:mqqvHiijfBC?sWlE}J
B} IxAMBKBQ @ o @ LuVfEsKhBuATaFv @ _ANu @ PiAPwDn @ _BVqEt @ k @ HC?yI | AqAPiBZaAPuARwWanmD_DP {AFeCDeC?} DGcAcByB @ BVCAB @ BVB ] mCg @ yFeAaCe @ _BY_I {AuKqBqAWcHqAqEy @ yF {@A?w @ IsAKuBO {ACuAEQAcA?wB @ s @?e @?A @ kDJaGd @ mC \ aMfAgAJm @pDyBR}BRyFh@yE^uBHuBB}B?qACqAGqAIqAMuC]eCe@aCi@}GeBuNuD??q@QqCs@aFqAmA]mAYsCw@{Bu@iE{AoBo@}Aq@gAc@iAg@iAi@wCuAuC}AcH_EaGsDMIgFaDwDiCk@_@{E{DuCqCsEeFw@cAy@eAoBoCuAwB_C}DgCuEo@iAuFeKMUwFmKaN_WiMyUiMaV_F{JoBsEoByEiA{CKY{BuGeCmIw@mCg@mB{AiGyA{Gq@eDq@mDq@{Do@aEm@gEk@kE}@_I]kDYkDYmDWoDa@yGScEOeEOqEIqEIyFEyFAsH@eLFwU?i@D{T@gDF_WFmT?gA
列出纬度
答案 0 :(得分:0)
医生说几何默认为polyline
。并且RouteStep对象链接到https://www.npmjs.com/package/polyline
因此,您可以使用此javascript程序包解析字符串,也可以在请求中添加geometries=geojson
参数,以获取列出lat和long的geojson。参见http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=full&geometries=geojson作为示例。