Пример #1
0
 public UnsignedCharVector(UnsignedCharVector other) : this(CNTKLibPINVOKE.new_UnsignedCharVector__SWIG_1(UnsignedCharVector.getCPtr(other)), true)
 {
     if (CNTKLibPINVOKE.SWIGPendingException.Pending)
     {
         throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #2
0
 public UnsignedCharVectorEnumerator(UnsignedCharVector collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
Пример #3
0
 private void _Save(UnsignedCharVector vectorBuf)
 {
     CNTKLibPINVOKE.Function__Save__SWIG_0(swigCPtr, UnsignedCharVector.getCPtr(vectorBuf));
     if (CNTKLibPINVOKE.SWIGPendingException.Pending)
     {
         throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #4
0
 public void SetRange(int index, UnsignedCharVector values)
 {
     CNTKLibPINVOKE.UnsignedCharVector_SetRange(swigCPtr, index, UnsignedCharVector.getCPtr(values));
     if (CNTKLibPINVOKE.SWIGPendingException.Pending)
     {
         throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #5
0
        protected bool LoadNutiteqMapCommon()
        {
            // Set base projection
            EPSG3857 proj = new EPSG3857();

            _mapViewer.Options.BaseProjection = proj; // note: EPSG3857 is the default, so this is actually not required

            // Set initial location and other parameters, don't animate
            _mapViewer.FocusPos    = proj.FromWgs84(new MapPos(-0.8164, 51.2383)); // Berlin
            _mapViewer.Zoom        = 2;
            _mapViewer.MapRotation = 0;
            _mapViewer.Tilt        = 90;

            // Start package manager
            var packageManager = new NutiteqPackageManager("nutiteq.mbstreets", _downloadPackagePath);

            packageManager.Start();

            // Import initial package
            if (packageManager.GetLocalPackage("world0_4") == null)
            {
                packageManager.StartPackageImport("world0_4", 1, _importPackagePath);
            }

            // Set bounding box
            String bbox = "bbox(-0.8164,51.2382,0.6406,51.7401)"; // London (about 30MB)

            if (packageManager.GetLocalPackage(bbox) == null)
            {
                packageManager.StartPackageDownload(bbox);
            }

            // Now can add vector map as layer
            // define styling for vector map
            UnsignedCharVector  styleBytes        = AssetUtils.LoadBytes("osmbright.zip");
            MBVectorTileDecoder vectorTileDecoder = null;

            if (styleBytes != null)
            {
                // Create style set
                MBVectorTileStyleSet vectorTileStyleSet = new MBVectorTileStyleSet(styleBytes);
                vectorTileDecoder = new MBVectorTileDecoder(vectorTileStyleSet);
            }
            else
            {
                Log.Error("Failed to load style data");
            }

            // Create online base layer (no package download needed then). Use vector style from assets (osmbright.zip)
            // comment in to use online map. Packagemanager stuff is not needed then
            //			VectorTileLayer baseLayer = new NutiteqOnlineVectorTileLayer("osmbright.zip");

            var baseLayer = new VectorTileLayer(new PackageManagerTileDataSource(packageManager), vectorTileDecoder);

            _mapViewer.Layers.Add(baseLayer);

            return(true);
        }
Пример #6
0
        public static UnsignedCharVector Repeat(byte value, int count)
        {
            global::System.IntPtr cPtr = CNTKLibPINVOKE.UnsignedCharVector_Repeat(value, count);
            UnsignedCharVector    ret  = (cPtr == global::System.IntPtr.Zero) ? null : new UnsignedCharVector(cPtr, true);

            if (CNTKLibPINVOKE.SWIGPendingException.Pending)
            {
                throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #7
0
        public UnsignedCharVector GetRange(int index, int count)
        {
            global::System.IntPtr cPtr = CNTKLibPINVOKE.UnsignedCharVector_GetRange(swigCPtr, index, count);
            UnsignedCharVector    ret  = (cPtr == global::System.IntPtr.Zero) ? null : new UnsignedCharVector(cPtr, true);

            if (CNTKLibPINVOKE.SWIGPendingException.Pending)
            {
                throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #8
0
        public static void InitializePackageManager(string packageFolder, string importPackagePath, IMapView mapView, string downloadedPackage)
        {
            // offline base layer

            // 2. define listener, definition is in same class above
            var packageManager = new NutiteqPackageManager("nutiteq.osm", packageFolder);

            packageManager.PackageManagerListener = new PackageListener(packageManager, downloadedPackage);

            // Download new package list only if it is older than 24h
            // Note: this is only needed if pre-made packages are used
            if (packageManager.ServerPackageListAge > 24 * 60 * 60)
            {
                packageManager.StartPackageListDownload();
            }

            // start manager - mandatory
            packageManager.Start();

            // Import initial package
            if (packageManager.GetLocalPackage("world0_4") == null)
            {
                packageManager.StartPackageImport("world0_4", 1, importPackagePath);
            }

            // Now can add vector map as layer
            // define styling for vector map
            UnsignedCharVector  styleBytes        = AssetUtils.LoadBytes("nutibright-v2a.zip");
            MBVectorTileDecoder vectorTileDecoder = null;

            if (styleBytes != null)
            {
                // Create style set
                MBVectorTileStyleSet vectorTileStyleSet = new MBVectorTileStyleSet(styleBytes);
                vectorTileDecoder = new MBVectorTileDecoder(vectorTileStyleSet);
            }
            else
            {
                Log.Error("Failed to load style data");
            }

            // Create online base layer (no package download needed then). Use vector style from assets (osmbright.zip)
            // comment in to use online map. Packagemanager stuff is not needed then
            //			VectorTileLayer baseLayer = new NutiteqOnlineVectorTileLayer("osmbright.zip");

            var baseLayer = new VectorTileLayer(new PackageManagerTileDataSource(packageManager), vectorTileDecoder);

            mapView.Layers.Add(baseLayer);
        }
Пример #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(UnsignedCharVector obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }