> Is it safe for me to simply divide the decoded coordinates by 10?

Yes it is safe to do that. Polyline encodes arbitrary integers.
Multiplication by a factor and rounding is the first step. Dividing by
the factor is the last step.

Sadly the python implementation hard-codes this factor. Might be up
for a rewrite?

Cheers,
Patrick


On Mon, Oct 5, 2015 at 2:24 AM, Daniel Patterson <dan...@mapbox.com> wrote:
> Hey Bryan,
>
>   The simplest thing to might be to just add "compression=false" to your 
> /viaroute request.  That'll give you back a plain JSON array of coordinates, 
> rather than in encoded form.
>
> daniel
>
>> On Oct 4, 2015, at 4:57 PM, Bryan Coutts <bryan.coutts1...@gmail.com> wrote:
>>
>> I'm trying to use OSRM to supply routes as polylines. I've noticed that, 
>> when I use a standard decoder to decode these polylines (i.e. Python's 
>> polyline package), the lat/lon coordinates I get are multiplied by a factor 
>> of 10. Googling around, I found that this is due to OSRM producing 
>> coordinates at a higher precision; is there a way for me to decode these 
>> without writing my own decoder, or digging into an existing one? Is it safe 
>> for me to simply divide the decoded coordinates by 10?
>>
>> Thanks,
>> Bryan
>> _______________________________________________
>> OSRM-talk mailing list
>> OSRM-talk@openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/osrm-talk
>
>
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk

_______________________________________________
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk

Reply via email to