private bool TryFetchWay(TransportWayIdInterop wayIdInterop, out TransportWay way)
        {
            var wayInterop = new TransportWayInterop()
            {
                Id = wayIdInterop
            };


            bool success = NativeTransportApi_TryGetWayBufferSizes(NativePluginRunner.API, ref wayInterop);

            if (!success)
            {
                way = TransportWay.MakeEmpty();
                return(false);
            }

            var centerLinePointsBuffer         = new DoubleVector3[wayInterop.CenterLinePointsBufferSize];
            var centerLinePointsBufferGCHandle = GCHandle.Alloc(centerLinePointsBuffer, GCHandleType.Pinned);

            wayInterop.CenterLinePoints = centerLinePointsBufferGCHandle.AddrOfPinnedObject();

            var centerLineSplineParamsBuffer         = new double[wayInterop.CenterLineSplineParamsBufferSize];
            var centerLineSplineParamsBufferGCHandle = GCHandle.Alloc(centerLineSplineParamsBuffer, GCHandleType.Pinned);

            wayInterop.CenterLineSplineParams = centerLineSplineParamsBufferGCHandle.AddrOfPinnedObject();

            var classificationBuffer         = new byte[wayInterop.ClassificationBufferSize];
            var classificationBufferGCHandle = GCHandle.Alloc(classificationBuffer, GCHandleType.Pinned);

            wayInterop.Classification = classificationBufferGCHandle.AddrOfPinnedObject();

            success = NativeTransportApi_TryGetWay(NativePluginRunner.API, ref wayInterop);
            if (!success)
            {
                way = TransportWay.MakeEmpty();
                return(false);
            }

            var classification = Marshal.PtrToStringAnsi(wayInterop.Classification, wayInterop.ClassificationBufferSize - 1);

            way = new TransportWay(
                wayInterop.Id.FromInterop(),
                centerLinePointsBuffer,
                centerLineSplineParamsBuffer,
                wayInterop.LengthMeters,
                wayInterop.HalfWidthMeters,
                wayInterop.WayDirection,
                classification,
                wayInterop.AverageSpeedKph,
                wayInterop.ApproximateSpeedLimitKph
                );

            centerLinePointsBufferGCHandle.Free();
            centerLineSplineParamsBufferGCHandle.Free();
            classificationBufferGCHandle.Free();
            return(true);
        }
 private static extern bool NativeTransportApi_TryGetWay(IntPtr ptr, ref TransportWayInterop wayInterop);