|
POST
|
Hi Ben, I had many problems with loading raster layers with lyr files. So now I use such way: 1. Create layer from lyr file. 2. Update data connection to raster path. await QueuedTask.Run(async() => { Item currentItem = ItemFactory.Instance.Create(rasterPath, ItemFactory.ItemType.PathItem); if (!LayerFactory.Instance.CanCreateLayerFrom(currentItem)) { return; } int nPos = await FindPlaceInTOCBelowFeaturesAboveRasters(myMap); rasterLayer = (RasterLayer)LayerFactory.Instance.CreateLayer(new Uri(lyrFile), myMap, nPos); if (rasterLayer != null) { await ChangeRasterLayerDataConnectionAsync(rasterLayer, rasterPath); } } public static Task ChangeRasterLayerDataConnectionAsync(RasterLayer rasterLayer, string catalogPath) { return QueuedTask.Run(() => { CIMDataConnection currentDataConnection = rasterLayer.GetDataConnection(); string connection = System.IO.Path.GetDirectoryName(catalogPath); string dataset = System.IO.Path.GetFileName(catalogPath); // provide a replace data connection method CIMStandardDataConnection updatedDataConnection = new CIMStandardDataConnection() { WorkspaceConnectionString = string.Format("DATABASE={0}", connection), WorkspaceFactory = WorkspaceFactory.Raster, Dataset = dataset, DatasetType = esriDatasetType.esriDTRasterDataset }; rasterLayer.SetDataConnection(updatedDataConnection); //Bug #2, we manually invalidate the cache rasterLayer.ClearDisplayCache(); }); }
... View more
04-03-2020
12:41 PM
|
0
|
0
|
2813
|
|
POST
|
Hi Ben, Have you tried eliminate one by one layer to know is it one layer problem or all layers? To check if raster exists better to use : var currentItem = ItemFactory.Instance.Create(sLyrPath, ItemFactory.ItemType.PathItem); if (LayerFactory.Instance.CanCreateLayerFrom(currentItem)) { } It will work with all types of rasters and feature classes
... View more
04-02-2020
10:57 PM
|
0
|
2
|
2813
|
|
POST
|
Hi Abel, More info you can find here: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#using-queuedtask
... View more
03-30-2020
11:54 AM
|
0
|
0
|
3186
|
|
POST
|
Thanks Uma. It works know. It would be nice in API reference to see near InitialLocation description note about AlwaysUseInitialLocation property behavior.
... View more
03-26-2020
09:02 AM
|
0
|
0
|
2084
|
|
POST
|
Hi Than, Thanks for help, but it doesn't work for me. I have tried your code with AddItem and saved in project folder connection but it doesn't work in both cases. In my case I need to select rasters, lyrx'es and etc. I have ArcGIS Pro 2.5 installed.
... View more
03-26-2020
03:39 AM
|
1
|
0
|
2084
|
|
POST
|
Hi, I have tried to use InitialLocation of OpenItemDialog but unsuccessfully. To check not from my code I use FolderConnectionManager sample. InitialLocation folder exists, but it is not in the project folder connections. Maybe that is the reason?
... View more
03-25-2020
11:53 PM
|
0
|
4
|
2146
|
|
POST
|
Hi Than, I think pixel block size depends on your task. If you need specific area which coordinates you know, you can convert them to raster pixels ant then calculate width and height. If you need all raster try to read all raster at ones. In 64 bits there are no memory limitations so it could work. I am not sure that it is totally rewritten in ArcGIS Pro Sometimes I take width as all raster width and height as the best performance value.
... View more
03-20-2020
12:44 AM
|
0
|
0
|
1543
|
|
POST
|
Hi Mats, On ArcGIS 10.3 your code works fine. What is your version of ArcGIS?
... View more
03-18-2020
11:26 PM
|
0
|
1
|
1641
|
|
POST
|
Hi Xuan, Have you installed NET Framework 4.8 for Visual Studio 2017 by downloading the framework from Microsoft directly? Check that link it maybe helpful: NET Framework 4.8 for Visual Studio 2017 by downloading the framework from Microsoft directly.
... View more
03-18-2020
11:08 PM
|
0
|
1
|
826
|
|
POST
|
Hi Barbara, Sorry. We use Visual Studio Installer which by default was in previous versions of Visual Studio. It goes by separate install now. Our installation project was started with first ArcMap version and VS6. It contains many different code and data files so we still using modified copy of setup project for ArcGIS Pro too.
... View more
03-16-2020
08:13 AM
|
0
|
0
|
3052
|
|
POST
|
Hi Brian, Do you use SetColorizer as in code sample of Uma? You need to use SetRenderer for CIMSimpleRenderer. I had the same problem.
... View more
03-03-2020
10:48 PM
|
0
|
0
|
3687
|
|
POST
|
Hi Barbara, You need to delete ConfigurationFolders registry key. If you do not delete registry key, ArcGIS Pro could search in your documents Add-ins folder, where config installation is located as all ArcGIS Pro add-ins installations. I have not tried to do it manually or by code. I use VS Installer project. It makes all steps automatically. You just need to set up all actions in the project. You need to download it separately from Visual Studio
... View more
03-03-2020
05:32 AM
|
2
|
0
|
3052
|
|
POST
|
Hi Barbara, There is a record in registry about configuration file: More info here: ArcGIS Pro Registry Keys · Esri/arcgis-pro-sdk Wiki · GitHub Note: from 3.0 Esri decided to change that setting. We use registry editor settings in the install project.
... View more
03-01-2020
10:44 PM
|
0
|
2
|
3052
|
|
POST
|
Hi Alan, You can use project settings without user interface. You can find implementation in module class. All complex settings you can serialize and store as strings Get Outlook for Android<https://aka.ms/ghei36>
... View more
02-28-2020
07:51 AM
|
1
|
5
|
3193
|
|
POST
|
HI Alan, You can use BackStage_PropertyPage ArcGIS Pro sample to store private data in the project. More info here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/BackStage_PropertyPage
... View more
02-28-2020
12:49 AM
|
1
|
7
|
3193
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 04-24-2026 08:33 AM | |
| 1 | 03-23-2026 11:44 AM | |
| 1 | 05-22-2024 11:48 PM | |
| 1 | 02-27-2026 10:33 AM | |
| 1 | 01-07-2026 10:44 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|