POST
|
The code you provide works very well... except for the lowerBound of the classBreaks[0].Label I modified your code a little and the output is almost perfect. Intuitively, it seems like there should be a property BasicRasterLayer.MinimumValue. However, that does not appear to be available. Do you have a suggestion for obtaining the statistics of a BasicRasterLayer? var classBreaks = newColorizer.ClassBreaks;
classBreaks[0].Label = "? - " + Math.Round(classBreaks[0].UpperBound, 1).ToString();
for (int i = 1; i < classBreaks.Length; i++)
{
string lowerBound = Math.Round(classBreaks[i - 1].UpperBound, 1).ToString();
string upperBound = Math.Round(classBreaks[i].UpperBound, 1).ToString();
classBreaks[i].Label = lowerBound + " - " + upperBound;
}
... View more
09-15-2022
01:37 PM
|
0
|
2
|
545
|
POST
|
This works perfectly to set the format of the characters... Thank You 🙂 Regarding the "Value" field. I think that I presented the problem incorrectly. The goal is not to change the name of the "Value" field. The goal is to set an alias for the name of the "Value" field... just like an alias can be set for a field name in a feature class attribute field. The is easily done to a raster layer in ArcGIS Pro by making the "Value" field active then pressing F2... and entering whatever alias is wanted for a label. There must be a way to do this with code.
... View more
09-15-2022
12:21 PM
|
0
|
0
|
549
|
POST
|
After creating a basicRasterLayer and setting the colorizer as shown in the code below. How would the labels and label format be set? The code used to colorize the raster copied from lines 147 to 171 in the ArcGIS Pro SDK Community Samples shown in this link. This code does not pertain to this problem other than the next step in this coding project is to change the "Value" field label to "Custom". Then change the formatting of the "Custom" field to show 1 decimal place. These 2 operations need to be applied to the same basicRasterLayer that is called in the SetToClassifyColorColorizer () method shown below. public static async Task SetToClassifyColorizer(BasicRasterLayer basicRasterLayer)
{
// Defines values for parameters in colorizer definition.
string fieldName = "Value";
ClassificationMethod classificationMethod = ClassificationMethod.NaturalBreaks;
int numberofClasses = 7;
string colorRampStyle = "ArcGIS Colors";
string colorRampName = "Aspect";
await QueuedTask.Run(async () =>
{
// Gets a color ramp from a style.
IList<ColorRampStyleItem> rampList = GetColorRampsFromStyleAsync(Project.Current, colorRampStyle, colorRampName);
CIMColorRamp colorRamp = rampList[0].ColorRamp;
// Creates a new Classify Colorizer Definition using defined parameters.
ClassifyColorizerDefinition classifyColorizerDef = new ClassifyColorizerDefinition(fieldName, numberofClasses, classificationMethod, colorRamp);
// Creates a new Classify colorizer using the colorizer definition created above.
CIMRasterClassifyColorizer newColorizer = await basicRasterLayer.CreateColorizerAsync(classifyColorizerDef) as CIMRasterClassifyColorizer;
// Sets the newly created colorizer on the layer.
basicRasterLayer.SetColorizer(newColorizer);
});
}
... View more
09-14-2022
02:55 PM
|
0
|
5
|
595
|
POST
|
Excellent Reply... Worked well. FYI for others, the Path.GetDirectoryName() needs the "using System.IO;" statement
... View more
09-09-2022
10:18 AM
|
0
|
0
|
561
|
POST
|
The GetBoundary() method below returns the string path to a feature class. How is the string path to the feature class used instead of the code on lines 25 and 26? protected override async void OnClick()
{
string extent = await Extent();
MessageBox.Show(extent);
static async Task<string> Extent()
{
string results = "";
static string GetBoundary()
{
OpenItemDialog item = new OpenItemDialog();
item.Title = "Select the Boundary";
item.MultiSelect = false;
item.ShowDialog();
return item.Items.First().Path;
}
await QueuedTask.Run(() =>
{
// Want to use this path name to create a feature class
string boundary = GetBoundary();
// This is fine... except how are the 2 lines below made to run from an OpenItemDialog
Geodatabase gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri("C:\\Temp\\Learn.gdb")));
using (FeatureClass fc = gdb.OpenDataset<FeatureClass>("CSS_1_BoundaryBuffer"))
{
string xMax = fc.GetExtent().XMax.ToString();
string xMin = fc.GetExtent().XMin.ToString();
string yMax = fc.GetExtent().YMax.ToString();
string yMin = fc.GetExtent().YMin.ToString();
results = $"{xMin} {yMin} {xMax} {yMax}";
}
});
return results;
}
}
... View more
09-08-2022
06:55 PM
|
0
|
2
|
600
|
POST
|
Thank You... That is exactly the system that I was looking for. It works well.
... View more
09-08-2022
06:23 AM
|
0
|
0
|
301
|
POST
|
Is there any system for populating the parameters of a MakeValueArray()? Below... the MakeValueArray() is populated correctly... except for the SemiVariogram properties. protected override void OnClick()
{
var progDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel", 100, true);
progDlg.Show();
string inputPointFeatures = @"C:\Temp\Learn.gdb\points";
string zValueField = "zField";
string outputRaster = @"C:\Temp\Learn.gdb\output";
string semiVariogram = "Ordinary Spherical 3 200 100 0";
string outputCellSize = "1";
string krigParameters = "Variable 4 150";
string outputVariance = "";
string tool = "C:\\Program Files\\ArcGIS\\Pro\\Resources\\ArcToolBox\\" +
"toolboxes\\Spatial Analyst Tools.tbx\\" + "Kriging";
var parameters = Geoprocessing.MakeValueArray(inputPointFeatures, zValueField,
outputRaster, semiVariogram, outputCellSize, krigParameters, outputVariance);
Geoprocessing.OpenToolDialog(tool, parameters);
progDlg.Hide();
}
... View more
09-07-2022
07:24 PM
|
0
|
2
|
342
|
IDEA
|
Ability to add custom Toolbox to the Geoprocessing Pane
... View more
03-27-2022
12:05 PM
|
3
|
4
|
722
|
POST
|
Just had the identical problem with 2.9.1 ArcGIS Pro would crash every time I tried to enter a value into a field. After looking through the article Susan posted, I reduced the resolution of my monitor from 3840 by 2160 to 1920 by 1080. Opened a project and tried to enter some data. It worked. Thank You Susan.
... View more
02-26-2022
06:41 PM
|
0
|
0
|
652
|
IDEA
|
Good Job Dan, I read through your suggestions... and find them to be a practical good start. It seems like the Geoprocessing Toolbox could get a lot more attention from ESRI pertaining to basic organizational functionality.
... View more
11-30-2020
10:57 AM
|
0
|
0
|
1851
|
IDEA
|
It would be nice to be able to customize the Toolbox similar to ArcMap. Some toolboxes will never ever be used by certain users in 1000 years. Unused toolboxes were removeable in ArcMap... right click => remove. That was nice. And add the functionality to add a custom toolbox to the Geoprocessing/Toolboxes tab.
... View more
11-30-2020
10:34 AM
|
0
|
1
|
1872
|
IDEA
|
Kory, I suspect that Marta was referring to the main Contents (on every tab or possibly just the selection tab) changing the layer background color just a little when something is selected. And personally, I would prefer that functionality on at least both the "Selection" tab and the "Drawing Order" tab. I have been well aware of the selection number for a quite a while and find it inadequate. Changing the subject slightly... it would also be nice to be able to right click on a layer and color code its background in the Contents pain... or color code groups of layers backgrounds.
... View more
11-30-2020
10:20 AM
|
0
|
0
|
616
|
IDEA
|
This basically the same request as the link shown below. The two should be combined. Add customability to the Symbology Histogram
... View more
10-06-2020
02:35 PM
|
0
|
0
|
1320
|
Title | Kudos | Posted |
---|---|---|
1 | 09-21-2022 03:23 PM | |
2 | 09-19-2022 07:10 PM | |
1 | 09-02-2020 08:45 AM | |
3 | 03-27-2022 12:05 PM | |
2 | 07-23-2018 12:46 PM |
Online Status |
Offline
|
Date Last Visited |
03-12-2024
03:28 PM
|