How to use the routingpy.utils.decode_polyline5 function in routingpy

To help you get started, we’ve selected a few routingpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gis-ops / routing-py / tests / test_utils.py View on Github external
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))
github gis-ops / routing-py / tests / test_utils.py View on Github external
def test_polyline5_2d_decoding(self):

        decoded = [(8.68864, 49.42058), (8.68092, 49.41578)]
        self.assertEqual(decoded, utils.decode_polyline5(self.coords2d_5prec))
github gis-ops / routing-py / routingpy / routers / osrm.py View on Github external
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