POST
|
I'm trying to get the properties of a raster dataset from a file geodatabase. It is a rasterdataset with a pyramid with 6 levels and of resampling type bilinear. If I open the dataset properties page in ArcGISPro, I see it correctly. But by code I get a resampling type of NearestNeighbor. I tried it with: var raster = rasterDataset.CreateDefaultRaster();
var resampleType = raster.GetResamplingType(); and also with: var rasterValue = new RasterValue();
rasterValue.SetRasterDataset(rasterdataset);
var rasterStorageDef = rasterValue.GetRasterStorageDef();
var pyramidResampleType = rasterStorageDef.GetPyramidResampleType(); Is this a bug or am I doing something wrong. Please someone help me get the pyramid resample type from a raster in a geodatabase in ArcGISPro. Thanks in advance.
... View more
07-05-2021
09:02 AM
|
0
|
0
|
389
|
POST
|
Thank you for your suggestion. The problem is, I still have to get the layout from the LayoutProjectItem with GetLayout(); But at least the ImportItem option is faster than to get the item first and then open it. Anyway the layout only hangs when I'm activating the mapframe. But what I tested now, is to open a layout first with the import layout from the catalog pane and then opening a layout with my code. The interesting thing is, my layout opened by code doesn't hang when I open one with the catalog option first.
... View more
02-10-2021
07:02 AM
|
0
|
0
|
1060
|
POST
|
I'm working with ArcGIS Pro 2.6 and when I add a layout by code and activate the mapframe in the layout, it is not responding any longer. The ribbons are grayed out and the Layout cannot be reactivated. When I import the same layout from the catalog pane, it is working correctly. There is just one default layer in the map on the layout. When I wait long enough I can close the map frame and return to the layout. To activate the map frame now is not a problem any more. Code for adding the layout: var layout = await QueuedTask.Run(() => GetLayout(selectedLayoutPath, name)); private Layout GetLayout(string path, string layoutname) { var pathDef = string.Concat(path, @"\", layoutname, @".pagx"); var layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(layoutname)); if (layoutItem != null) { Project.Current.RemoveItem(layoutItem); } var pagx = (IProjectItem)ItemFactory.Instance.Create(pathDef); Project.Current.AddItem(pagx); layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(layoutname)); return layoutItem.GetLayout(); } Is there another method to add a layout to the project or is it a known bug? I saw other posts with problems on changing map frames on layouts. I also used the ArcGIS Diagnostic Monitor and the process bugged on ArcGIS.Desktop.Internal.Layouts.Ribbon.MapSeriesGalleryItem.RefreshAsync+ 100 05:23:41:595 431439 431439 0 0 I hope somebody can tell me what the problem is.
... View more
02-09-2021
09:02 AM
|
0
|
3
|
1156
|
POST
|
For anyone who is also thinking in the wrong direction, I found the solution: The elements have to be "ungrouped" in the TOC. First they have to be reversed to maintain the same order in the TOC as before they were grouped. if (group != null) { group.Elements.Reverse(); foreach (var item in group.Elements) { item.SetTOCPositionAbsolute(layout, true); } var groupToDelete = layout.FindElement(group.Name); layout.DeleteElement(groupToDelete); }
... View more
12-03-2020
07:00 AM
|
0
|
0
|
940
|
POST
|
I created a GroupElement with layout elements such as text, legend, scalebar to find the bounds of all graphic elements except the map frame. GroupElement allElements = LayoutElementFactory.Instance.CreateGroupElement(layout, layout.Elements); I see this Element in the content pane. Now I just want to ungroup this GroupElement but I just can't find a way to do it by code. There is the function to ungroup a GraphicsLayer in the map but this is not a graphics layer in the map, it is a GroupElement in the Layout. Please help me. Thanks Myriam
... View more
11-05-2020
07:33 AM
|
0
|
1
|
970
|
POST
|
Hi, I'm trying to add a secure WMS service to ArcGIS Pro. It works with non secured WMS services but comes up with a request for user and password even if they are given in code. In fiddler you can see that the Authorization credentials are not commited for the connection. The code is as follows: QueuedTask.Run(() => { var serverConnection = new CIMInternetServerConnection { URL = wmsLayerEndpoint.Url, Password = wmsLayerEndpoint.Password, User = wmsLayerEndpoint.Username }; var connection = new CIMWMSServiceConnection { ServerConnection = serverConnection, Description = caption, LayerName = name }; var layer = LayerFactory.Instance.CreateLayer(connection, MapView.Active.Map); layer.SetExpanded(true); }); Did I miss something or is there a bug. Help would be highly appreciated. Thanks.
... View more
01-14-2019
03:11 AM
|
0
|
0
|
382
|
POST
|
Hi all, I'm trying to program a Tool similar to the NewText-Tool for an Engine-Application. It should work the same as in ArcMap where you can click on the Map and see the text in a box where it is active and you can type in whatever you like. I can do it with a form to have the users input but it's just not as nice as in ArcMap. I just can't think of a way to do it. Can somebody please point me in the right direction or give me some code? Thank you very much.
... View more
07-27-2010
06:57 AM
|
0
|
0
|
941
|
Online Status |
Offline
|
Date Last Visited |
07-05-2021
11:02 PM
|