await QueuedTask.Run(() => { pOutLay = (FeatureLayer)LayerFactory.Instance.CreateLayer(new Uri(url), MapView.Active.Map); pSpatRef = SpatialReferenceBuilder.CreateSpatialReference(32655); //UTM55N EditOperation createFeatEditOp = new EditOperation(); createFeatEditOp.Name = "CreateImageEdges"; createFeatEditOp.SelectModifiedFeatures = false; createFeatEditOp.SelectNewFeatures = false; foreach (Item itm in items) { lstPnt = new List(); string path = itm.Path.Substring(0, itm.Path.LastIndexOf(@"\")); string strFile = itm.Path.Substring(itm.Path.LastIndexOf(@"\") + 1); FileSystemConnectionPath connectionPath = new FileSystemConnectionPath(new System.Uri(path), FileSystemDatastoreType.Raster); FileSystemDatastore dataStore = new FileSystemDatastore(connectionPath); RasterDataset fileRasterDataset = dataStore.OpenDataset(strFile); Raster pRas = fileRasterDataset.CreateDefaultRaster(); pTup = pRas.PixelToMap(0, 0); lstPnt.Add(MapPointBuilder.CreateMapPoint(pTup.Item1, pTup.Item2)); pTup = pRas.PixelToMap(0, pRas.GetWidth()); lstPnt.Add(MapPointBuilder.CreateMapPoint(pTup.Item1, pTup.Item2)); pTup = pRas.PixelToMap(pRas.GetHeight(), pRas.GetWidth()); lstPnt.Add(MapPointBuilder.CreateMapPoint(pTup.Item1, pTup.Item2)); pTup = pRas.PixelToMap(pRas.GetHeight(), 0); lstPnt.Add(MapPointBuilder.CreateMapPoint(pTup.Item1, pTup.Item2)); pTup = pRas.PixelToMap(0, 0); lstPnt.Add(MapPointBuilder.CreateMapPoint(pTup.Item1, pTup.Item2)); pPline = PolylineBuilder.CreatePolyline(lstPnt, pSpatRef); dctAtts = new Dictionary(); dctAtts.Add("SHAPE", pPline); dctAtts.Add("Image", strFile); dctAtts.Add("Width", pRas.GetWidth()); dctAtts.Add("Height", pRas.GetHeight()); createFeatEditOp.Create(pOutLay, dctAtts); } createFeatEditOp.Execute(); }); } catch (Exception ex) { MessageBox.Show(ex.Message); } }