POST
|
Thanks a lot, this worked for me partially. But this creates a new raster masked by the polygon area, my need is that the changes should be made to the selected subset of cells in the original raster and get back the original raster along with the changed values such that the area that were not under the polygon should remain unchanged.
... View more
06-17-2021
07:02 PM
|
0
|
1
|
1012
|
POST
|
I have a source raster data set (tif file) I want to select a subset (cells) of the source raster data, change the values of the selected cells and write the changes values again to the source raster. How should I approach this in ArcMap. Thank you, Manish
... View more
06-17-2021
01:05 PM
|
0
|
5
|
1073
|
POST
|
Thanks for pointing out the resource but after creating the polygon according the resource I am not able to conduct any kind of geoprocessing on it. It is just like a graphic on my map. Please let me know if there is anything I am missing. Thanks
... View more
05-13-2021
02:50 PM
|
0
|
1
|
1529
|
POST
|
# This script clips all feature classes in a file geodatabase
import arcpy
# Create path variables
sourceWorkspace = r"C:\Users\Lesson2Practice\USA.gdb"
targetWorkspace = r"C:\Users\Lesson2Practice\Iowa.gdb"
clipfeature = r"C:\Users\Lesson2Practice\Iowa.gdb\Iowa"
# Get a list of all feature classes in the USA geodatabase
arcpy.env.workspace = sourceWorkspace
featureClassList = arcpy.ListFeatureClasses()
try:
# Loop through all USA faeture classes
for featureClass in featureClassList:
# Construct the output path
outClipFeatureClass = f'{targetWorkspace}\Iowa{featureClass}'
# Perform Clip
arcpy.Clip_analysis(featureClass,clipfeature,outClipFeatureClass)
arcpy.AddMessage(f'Wrote clipped file {outClipFeatureClass}.')
print(f"Wrote clipped file {outClipFeatureClass}.")
except:
# Report if there was an error
arcpy.AddError("Could not clip feature classes")
print("Could not clip feature classses")
print(arcpy.GetMessages()) I have created a python script file that I am debugging it using visual studio 2019, But as soon as I try to debug, it gives me and Exception on another file (time.py - not sure where it came from as this time.py is not in my project or folder) stating "name 'm' is not defined" (I am attaching a video of the exception). Any help is appreciated. Thanks
... View more
05-13-2021
02:41 PM
|
0
|
8
|
1964
|
POST
|
Hi, I am trying to draw a polygon on the fly in a map view. Is there any tool available in arcgis runtime sdk for .net (using 100.9.0). I am using https://developers.arcgis.com/net/wpf/sample-code/cut-geometry/ as a sample, but instead of providing MapPoints() as coordinates in code file, I want to register the mouse click at runtime and use those clicks as input points to draw a polygon on the MapView. Your help is greatly appreciated. Thanks, Manish
... View more
04-23-2021
03:57 PM
|
0
|
3
|
1645
|
POST
|
Thanks MaximilianGlas. This worked well for me. But still I am not able show the results in the data grid. I tried to bind the query results to the datagrid using the following code. Code Snippet // Query each of the sublayers with the query parameters.
FeatureQueryResult citiesQueryResult = await citiesTable.QueryFeaturesAsync(citiesNameQuery);
FeatureQueryResult countiesQueryResult = await countiesTable.QueryFeaturesAsync(countiesNameQuery);
FeatureQueryResult statesQueryResult = await statesTable.QueryFeaturesAsync(statesNameQuery);
var foundCities = 0;
var foundCounties = 0;
var foundStates = 0;
// Loop through results, count the matches found in each layer.
foreach (Feature city in citiesQueryResult)
{
foundCities++;
}
foreach (Feature county in countiesQueryResult)
{
foundCounties++;
}
foreach (Feature states in statesQueryResult)
{
foundStates++;
}
// Report the number of matches for each layer.
var msg = $"Found {foundCities} cities, {foundCounties} counties, and {foundStates} states containing {SearchTextBox.Text}" +
$" in a Name attribute.";
MessageBox.Show(msg);
// Bind the results to a DataGrid Control on the page
MyDataGrid.ItemsSource = citiesQueryResult;
MyDataGrid.ItemsSource = countiesQueryResult;
MyDataGrid.ItemsSource = statesQueryResult;
}
... View more
03-11-2021
10:07 AM
|
0
|
0
|
1234
|
POST
|
Hi, I am trying to develop a WPF app that can populate a datagrid by querying an online image service. http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer Particularly, I want to search for a name from the sublayers (search for a city, county, or state) and populate the result in a datagrid. I am attaching an image of the result that I want to have and an image of error message that I got. Also I am attaching the code file. please help using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Tasks;
using Esri.ArcGISRuntime.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MapApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Map myMap = new Map(Basemap.CreateImagery());
ArcGISMapImageLayer layer = new ArcGISMapImageLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer"));
myMap.OperationalLayers.Add(layer);
MyMapView.Map = myMap;
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
ArcGISMapImageLayer usaMapImageLayer = (ArcGISMapImageLayer)MyMapView.Map.OperationalLayers[0];
try
{
// Use a utility method on the map image layer to load all the sublayers and tables.
await usaMapImageLayer.LoadTablesAndLayersAsync();
// Get the sublayers of interest.
ArcGISMapImageSublayer citiesSublayer = (ArcGISMapImageSublayer)usaMapImageLayer.Sublayers[0];
ArcGISMapImageSublayer countiesSublayer = (ArcGISMapImageSublayer)usaMapImageLayer.Sublayers[3];
ArcGISMapImageSublayer statesSublayer = (ArcGISMapImageSublayer)usaMapImageLayer.Sublayers[2];
// Get the service feature table for each of the sublayers.
ServiceFeatureTable citiesTable = citiesSublayer.Table;
ServiceFeatureTable countiesTable = countiesSublayer.Table;
ServiceFeatureTable statesTable = statesSublayer.Table;
// Create the query parameters that will find features.
QueryParameters citiesNameQuery = new QueryParameters
{
WhereClause = "AREANAME=" + SearchTextBox.Text,
Geometry = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry,
OutSpatialReference = MyMapView.SpatialReference
};
QueryParameters countiesNameQuery = new QueryParameters
{
WhereClause = "NAME=" + SearchTextBox.Text,
Geometry = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry,
OutSpatialReference = MyMapView.SpatialReference
};
QueryParameters statesNameQuery = new QueryParameters
{
WhereClause = "STATE_NAME=" + SearchTextBox.Text,
Geometry = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry,
OutSpatialReference = MyMapView.SpatialReference
};
// Query each of the sublayers with the query parameters.
FeatureQueryResult citiesQueryResult = await citiesTable.QueryFeaturesAsync(citiesNameQuery);
FeatureQueryResult countiesQueryResult = await citiesTable.QueryFeaturesAsync(countiesNameQuery);
FeatureQueryResult statesQueryResult = await citiesTable.QueryFeaturesAsync(statesNameQuery);
var foundCities = 0;
var foundCounties = 0;
var foundStates = 0;
// Loop through results, count the matches found in each layer.
foreach (Feature city in citiesQueryResult)
{
foundCities++;
}
foreach (Feature county in countiesQueryResult)
{
foundCounties++;
}
foreach (Feature states in statesQueryResult)
{
foundStates++;
}
// Report the number of matches for each layer.
var msg = $"Found {foundCities} cities, {foundCounties} counties, and {foundStates} states containing {SearchTextBox.Text}" +
$"in a Name attribute.";
MessageBox.Show(msg);
// Bind the results to a DataGrid Control on the page
MyDataGrid.ItemsSource = citiesQueryResult;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error");
}
}
}
} Thanks
... View more
03-10-2021
09:39 PM
|
0
|
2
|
1294
|
POST
|
Hi, Can USA NAIP Imagery: NDVI (https://naip.arcgis.com/arcgis/rest/services/NAIP/ImageServer) be used for calculating USLE C Factor? If yes, please guide me to do that for a specific area bounded by a polygon. Also can it be done in ArcMap? Thank you, Manish
... View more
02-05-2021
12:53 PM
|
0
|
0
|
550
|
POST
|
Hi, Can USA NAIP Imagery: NDVI (my url -https://naip.arcgis.com/arcgis/rest/services/NAIP/ImageServer) be used for calculating USLE C Factor? If yes, please guide me to do that for a specific area bounded by a polygon. Also can it be done in ArcMap? Thank you, Manish
... View more
02-05-2021
12:12 PM
|
0
|
0
|
534
|
POST
|
Thanks Mike!! In the same line, can I use multiple tools like a series for example: 1) clip the raster by defining the boundary at runtime from larger raster 2) calculate the slope of the clipped raster in one single application ?
... View more
10-02-2020
03:44 PM
|
0
|
0
|
1027
|
POST
|
Hi, Any suggestions on how can I use arcgis runtime sdk for .net to extract a portion of larger raster dataset (e.g. by drawing a polygon over it on the fly in the application)?
... View more
08-11-2020
02:05 PM
|
0
|
2
|
1070
|
POST
|
Hi Mike, I have tried to follow the instructions and rewritten the tool making sure that everything is output to "ScratchGDB" but I am still not able to get Raster Attribute Table from the output of Flow Accumulation. I have also tried to create the attribute table using "Build Raster Attribute Table" tool, which runs without any error but fails to create the attribute table. With all this I am still getting the same Geoprocessing Error as earlier. Thanks Manish
... View more
06-23-2020
09:23 PM
|
0
|
0
|
1599
|
POST
|
Hi Mike, Thanks for pointing out to resourceful documentations. I tried to make some adjustments in the code as pointed out in the link https://github.com/Esri/arcgis-runtime-samples-dotnet/blob/master/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.xaml.cs#L70. After running the code, "Job Failed" message box shows up with message as follows: I am attaching the new code as well.. Please let me know the work around. Thanks, Manish
... View more
06-23-2020
02:24 PM
|
0
|
2
|
1598
|
Title | Kudos | Posted |
---|---|---|
2 | 09-10-2018 04:58 PM |
Online Status |
Offline
|
Date Last Visited |
07-18-2021
12:27 AM
|