POST
|
When I clicked on the above link, it indicated . . . Not Found The item does not exist. It may have been deleted. I was not able to find the proper place to post this. That's why I posted it here. Thanks.
... View more
08-07-2017
07:08 AM
|
0
|
1
|
647
|
POST
|
I'm having problems (not in every case, but when attempting to display some rasters on the map) with either none or some of the Elevation (DEM) Raster Layer not showing up on the map. However, when I bring the raster into ArcMap, the image looks fine. This only happens with the rasters that I assign the Elevation color ramp stretch renderer to. It doesn't happen with rasters that I don't assign a renderer to (although I don't know if that has anything to do with it). This is what my C# code looks like . . . using Esri.ArcGISRuntime.Mapping; using Esri.ArcGISRuntime.Rasters; . . . . . var newRaster = new Raster(rasterPath); // create the raster object from the image file var newRasterLayer = new RasterLayer(newRaster); // create the raster layer object from the raster double[] minVals = { min }; // minimum value for stretch parameters input double[] maxVals = { max }; // maximum value for stretch parameters input MinMaxStretchParameters minMaxParams = new MinMaxStretchParameters(minVals, maxVals); // create stretch parameters object ColorRamp elevationColorRamp = ColorRamp.Create(PresetColorRampType.Elevation); // create the color ramp var rendrr = new StretchRenderer(minMaxParams, null, true, elevationColorRamp); // create the renderer from the above newRasterLayer.Renderer = rendrr; // apply the renderer to the raster layer newRasterLayer.Opacity = 0.6; // set the opacity var mapViewModel = ServiceLocator.Current.GetInstance<MapViewModel>(); // get the map view model mapViewModel.Map.OperationalLayers.Add(newRasterLayer); // add the raster layer to the map Have there been issues reported having to do with displaying DEM rasters on a map (perhaps relating to OperationalLayers object)? Thanks, Renee
... View more
08-04-2017
08:09 AM
|
0
|
3
|
985
|
POST
|
Using ArcGIS Runtime SDK for .NET, how can I display the legend or symbology of an image, along with the image, on a map? I have an ArcGIS runtime program written in C#, which generates a series of rasters, and displays them on a map using the following code snippit . . . private void AddRasterLayer(string rasterPath, string id, bool isVisible, double[,] rasterArray) { var newRaster = new Raster(rasterPath); // create the raster object from the image file var newRasterLayer = new RasterLayer(newRaster); // create the raster layer object from the raster newRasterLayer.Id = id; if (id == "DEMMosaic")// if the image is the DEM { double max = SoilMoisturePreprocessing.Max2d(rasterArray); // get the maximum value in the array double min = SoilMoisturePreprocessing.Min2d(rasterArray); // get the minimum value in the array double[] minVals = { min }; // minimum value for stretch parameters input double[] maxVals = { max }; // maximum value for stretch parameters input MinMaxStretchParameters minMaxParams = new MinMaxStretchParameters(minVals, maxVals); // create stretch parameters object ColorRamp elevationColorRamp = ColorRamp.Create(PresetColorRampType.Elevation); // create the color ramp var rendrr = new StretchRenderer(minMaxParams, null, true, elevationColorRamp); // create the renderer newRasterLayer.Renderer = rendrr; // apply the renderer to the raster layer } newRasterLayer.Opacity = 0.6; // set the opacity newRasterLayer.IsVisible = isVisible; // visibility setting var mapViewModel = ServiceLocator.Current.GetInstance<MapViewModel>(); // get the map view model mapViewModel.Map.OperationalLayers.Add(newRasterLayer); // add the raster layer to the map } Is there a way that I could incorporate into the above code, a method that would display a legend for the raster along with the raster?
... View more
06-02-2017
06:15 AM
|
0
|
0
|
877
|
POST
|
Using C# with ArcGISRuntime I need to display raster data on a map. Right now I have the following code that successfully displays an elevation raster (DEM) on the map. However, I have other rasters that are not displayed correctly using this color ramp. When I bring them into Arc Map, they are displayed the way I want them, as grayscale images. How can I define a StretchRenderer that would be a grayscale color ramp, that would make these rasters appear the same as they do when bringing them into Arc Map? private void AddRasterLayer(string rasterPath, string id) { var newRaster = new Raster(rasterPath); var newRasterLayer = new RasterLayer(newRaster); newRasterLayer.Id = id; // Code to get the min and max values for the MinMaxStretchParameters object double[,] rasterArray = Conversions.RasterToArray(rasterPath); double max = SoilMoisturePreprocessing.Max2d(rasterArray); double[] minVals = { 0 };// 0 double[] maxVals = { (int)max + 1 }; MinMaxStretchParameters minMaxParams = new MinMaxStretchParameters(minVals, maxVals); ColorRamp elevationColorRamp = ColorRamp.Create(PresetColorRampType.Elevation); var rendrr = new StretchRenderer(minMaxParams, null, true, elevationColorRamp); newRasterLayer.Renderer = rendrr; newRasterLayer.Opacity = 0.6; var mapViewModel = ServiceLocator.Current.GetInstance<MapViewModel>(); mapViewModel.Map.OperationalLayers.Add(newRasterLayer); }
... View more
05-02-2017
07:16 AM
|
1
|
0
|
566
|
POST
|
I've run into this same problem, and would be curious to know how you resolved it as well.
... View more
10-31-2014
12:16 PM
|
0
|
0
|
615
|
POST
|
I have an SDK for WPF Runtime application that performs routing. The network dataset that I'm using is overlaid with polygons that represent areas of various degrees of threat. The threat is quantified by a double ranging between .01 and .9. Each polygon has a threat score associate with it. Can I use these values as an impedance? If so, how would I do that? I've thought of using the polygons as barriers. Barriers can either be restrictions (on or off - if the barrier is there, the way is blocked) or cost-based (barrier adds a cost, but doesn't necessarily block the way). The barriers I've used to date are restrictions. However, I might be able to represent the threat polygons as cost barriers - with the cost proportional to the threat score. How would I be able to set this up in the model, or in the C# code?
... View more
10-09-2014
09:52 AM
|
0
|
0
|
3478
|
POST
|
I was able to accomplish the above this way . . . ESRI.ArcGIS.Carto.IRasterLayer rasterLayer = new RasterLayerClass(); rasterLayer.CreateFromRaster(raster); string sRasterName = rasterLayer.Name;
... View more
12-09-2013
08:28 AM
|
0
|
0
|
271
|
POST
|
I have an IRaster object as output from a function. I need to be able to get the name of that raster. Is there a way that I can do that? I know that I can't mask an IRaster as an IRasterDataset. If I could, I would be able to get the Name property from that (I think). Thanks!
... View more
12-09-2013
05:23 AM
|
0
|
1
|
673
|
POST
|
I resolved the problem by re-creating the map package and including the data rather than referencing the data.
... View more
10-14-2013
10:24 AM
|
0
|
0
|
208
|
POST
|
I have a C# project that uses a LocalFeatureService, a LocalGeoprocessingService and a LocalMapService. Everything runs fine when I run it at my own machine. However, when I transport the code and data (including packages) to another machine, and try to run the code, it is not able to start the Local Feature Service. I'm not sure yet if the other services will start successfully, because it bombs at the Local Feature Service. The error messages are: LocalServerException was unhandled. Service Failed to initialize Error code 500 Feature service creation failed Everything is there, so what might I look for to understand why the service doesn't start? Thanks!
... View more
10-11-2013
10:15 AM
|
0
|
1
|
485
|
POST
|
As it turns out, I took a different approach to this problem. Rather than attempting to access the name of the unpacked location, I re-created the map package, and this time I selected the option "Reference all data", so that the edits would be saved in the location referenced in the map document.
... View more
10-02-2013
06:10 PM
|
0
|
0
|
620
|
POST
|
I have C# code that uses the app.config file to locate a map package ( <add key="EsriRuntimeEditingMapPackageLocation" value="C:/Projects//MyEditingMap.mpk"/> ) This map package is used by the Editor Widget to edit feature classes. I need to be able to programmatically access the unpacked location of this map package. I know that I can right-click on the mpk file in Arc Catalog and select Properties, and the ???Unpacked Location??? is indicated. However, I need this path to be returned in the form of a string in my code. Is there a way to do this? I looked into using ArcGISFileHandler but didn't know how I could use this executable for my purposes. Thanks!
... View more
10-02-2013
07:13 AM
|
0
|
2
|
1167
|
POST
|
I was able to resolve this on my own. private List<IPoint> GetPointsList(IFeatureRepository Bfr) { IFeatureClass Bfc = Bfr.GetFeatureClassByName("PointFeatureClass"); List<IPoint> listPoints = GetGeometries<IPoint>(Bfc); return listPoints; }
... View more
09-30-2013
05:52 AM
|
0
|
0
|
155
|
POST
|
I've got the following routine . . . /// <summary> /// Gets a list of all geoms in a Feature Class /// </summary> /// <param name="FClass">The Feature Class</param> /// <returns>a List of Geometries</returns> private List<T> GetGeometries<T>(IFeatureClass FClass) { List<T> List_Geometries = new List<T>(); IQueryFilter aQF = new QueryFilter(); aQF.WhereClause = ""; ISelectionSet selectionSet = FClass.Select(aQF, esriSelectionType.esriSelectionTypeIDSet, esriSelectionOption.esriSelectionOptionNormal, null); IEnumIDs enumId = selectionSet.IDs; int nFeatures = selectionSet.Count; enumId.Reset(); int id; for (int j = 0; j < nFeatures; j++) { id = enumId.Next(); IGeometry pGeom = FClass.GetFeature(id).Shape; List_Geometries.Add((T)pGeom); } return List_Geometries; } I don't get any diagnostics errors on the above routine. However I do get an error when I attempt to call this method. How can I call this method from the following set of code . . . private List<IPoint> GetPointsList(IFeatureRepository Bfr) { IFeatureClass Bfc = Bfr.GetFeatureClassByName("PointFeatureClass"); List<IPoint> listPoints = GetGeometries(Bfc); return listPoints; } By the way, this is not the way to do it, but I'm just trying to give an example of what I'm trying to do. Thanks, Renee
... View more
09-30-2013
05:08 AM
|
0
|
1
|
375
|
Title | Kudos | Posted |
---|---|---|
1 | 05-02-2017 07:16 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|