I am using google maps API to get directions from one place to another. Google maps returns a polyline that looks something like this
o`kpBywaaMQs@y@{Ag@LUJEKUsFyATeE|@i@@{B?w@@iBLkC\}APoBP{BPyAJuBCqAJeAHkAB{@Bs@JcAVyCv@yBlBl@i@JoAPuB?}@@UB]NWRq@^yBdAaB~@IBEr@MpBK~A@RDLLFxBf@hAVb@P`Bz@bErB
First query
I want to know if I store this polyline in the mongo database or do I convert it to a list of points and store it as a LineString?
Converting the polyline to points returns something like this
[
(18.5756, 73.74221),
(18.57569, 73.74247),
(18.57598, 73.74239),
(18.57601, 73.74237),
(18.57603, 73.74238),
(18.57605, 73.7424),
(18.57622, 73.74286),
(18.57642, 73.74279),
(18.57653, 73.74273),
(18.57656, 73.74279),
(18.57667, 73.74401),
(18.57712, 73.7439),
(18.57811, 73.74359),
(18.57832, 73.74358),
]
Second question
I will have to work with multiple such polylines and I need to find if two or more polylines overlap each other (and by what percentage if possible).
This relates to the first question as I would assume that executing a query for my above requirement would need the polyline to be stored in one of the two formats for eaiser (or successful) query execution.