Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_polyline5_3d_decoding(self):
decoded = [(8.68864, 49.42058, 120.96), (8.68092, 49.41578, 1491.39)]
self.assertEqual(decoded, utils.decode_polyline5(self.coords3d_5prec, True))
def test_polyline5_2d_decoding(self):
decoded = [(8.68864, 49.42058), (8.68092, 49.41578)]
self.assertEqual(decoded, utils.decode_polyline5(self.coords2d_5prec))
def _parse_geometry(route_geometry):
if geometry_format in (None, 'polyline'):
geometry = utils.decode_polyline5(route_geometry, is3d=False)
elif geometry_format == 'polyline6':
geometry = utils.decode_polyline6(route_geometry, is3d=False)
elif geometry_format == 'geojson':
geometry = route_geometry['coordinates']
else:
raise ValueError(
"OSRM: parameter geometries needs one of ['polyline', 'polyline6', 'geojson"
)
return geometry