|
POST
|
HI James, More info about first option: ArcGIS Pro 2.5 API Reference Guide
... View more
04-10-2020
06:29 AM
|
0
|
1
|
5175
|
|
POST
|
Hi James, Have you tried like this: var parameters = Geoprocessing.MakeValueArray(fullSpec, fieldName); var cts = new CancellationTokenSource(); var results = Geoprocessing.ExecuteToolAsync("management.DeleteField", parameters, null, cts.Token, (eventName, o) => { System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}"); if (eventName == "OnMessage") { System.Diagnostics.Debug.WriteLine($@"Msg: {o}"); } }); If you want to wait until your job finishes you can do like this: var parameters = Geoprocessing.MakeValueArray(sInputPath); var gpResult = Geoprocessing.ExecuteToolAsync("Delete_management", parameters, null, CancelableProgressor.None, GPExecuteToolFlags.None); gpResult.Wait(); return !gpResult.Result.IsFailed; Task.Wait Method (System.Threading.Tasks) | Microsoft Docs Or you can combine both.
... View more
04-09-2020
11:21 PM
|
0
|
4
|
5175
|
|
POST
|
Hi Than, For ArcGIS.Core.Geometry.SpatialReference you can use ToXML() method ang then deserialize result string to ProjectedCoordinateSystem or GeographicCoordinateSystem (depending on your spatial reference). Then take from coordinate system variable WKT property. For ArcGIS.core.Internal.CIM.SpatialReference you can just take wkt property. WKT parser you can find on internet. First what I find : GitHub - Esri/ogc-crs-wkt-parser: Sample code to implement new OGC WKT specification
... View more
04-09-2020
12:38 AM
|
2
|
1
|
2130
|
|
POST
|
HI Than, You can parse them from json or xml string using SpatialReference methods ToXML() or ToJson()
... View more
04-08-2020
07:22 AM
|
0
|
3
|
2130
|
|
POST
|
Hi Gernot, You can assign row value to object type variable. Then check if it is null. If not - assing it to timestamp variable as in your code. Another way is to use Convert.ToDateTime like this: DateTime timestamp = Convert.ToDateTime(row["Timestamp"]);
... View more
04-08-2020
07:10 AM
|
0
|
1
|
2217
|
|
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
|
2904
|
|
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
|
2904
|
|
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
|
3254
|
|
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
|
2163
|
|
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
|
2163
|
|
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
|
2225
|
|
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
|
1606
|
|
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
|
1693
|
|
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
|
862
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 06-30-2026 10:14 PM | |
| 1 | 06-30-2026 01:43 PM | |
| 2 | 04-24-2026 08:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|