POST
|
I would like to edit the metadata of a raster to indicate that the unit of the pixel value is square meters, but only imperial units are listed in the dropdown menu for units in the Image Description - Band section. The same is true for me in either ArcMap or ArcGIS Pro. I've looked through a range of options to see if there's a setting for measurements that might apply to metadata editing, but haven't found anything so far. I've tried changing every unit setting I can find to metric, but I can still only access imperial/U.S. units in that dropdown. I am currently using the North American Profile of ISO 19115 2003 as the metadata style, but have tried changing it to a number of different options to see if that makes a difference. In all cases, my dropdown list is the same. What am I missing?
... View more
11-02-2020
04:21 PM
|
0
|
0
|
49
|
POST
|
I've been trying to figure out how to add outputs to the display for Python Toolbox scripts for an embarrassingly long time. I'd pretty much given up when I came upon this exchange. I'm dealing with rasters, so substituted arcpy.MakeRasterLayer_management instead, and it worked great! A quick and easy way to get the job done, seeing as the arcpy.env. addOutputsToMap doesn't function when run from within a tool. For those who are looking to do the same thing, add an additional parameter for the Derived output: # Eighth parameter: output layer to add to project outlayer = arcpy.Parameter( name = "outlayer", displayName = "Derived output for final product raster", datatype = "GPRasterLayer", parameterType = "Derived", direction = "Output") Then once you've generated the output raster in your code, add it to the display, referencing the index number for the derived parameter in the arcpy.SetParameterAsText function (in this example it was the 8th parameter, so has an index value of 7). Note that you cannot have the same name for the input raster and the display raster; I just removed the .tif extension from my raster filename to differentiate the two while still making it clear what dataset was added. In this example, the outpath variable is the full path to the newly-generated raster that I want to add to the map. dispname = os.path.splitext(outname)[0] arcpy.MakeRasterLayer_management(outpath, dispname) arcpy.SetParameterAsText(7, dispname) arcpy.AddMessage("Added RGB raster layer to map display.")
... View more
09-21-2020
12:43 PM
|
2
|
0
|
150
|
POST
|
I find myself revisiting this issue in the process of working on another project, which is timely considering another comment was just added today. It looks like the crux of the issue is the use of virtual rasters. If I actually save the input rasters to a .tif file, and then generate my band list with the path for each of the band .tif files, the bands are labeled correctly. If I just use the variables for the virtual outputs (there are a long series of processing steps in the script, all done in memory, resulting in the three single-band rasters that I want to combine to an RGB image), I consistently get the problem where all of the bands are labeled as band_1. This will happen even if I use the Composite Bands tool manually, and select the virtual rasters as the input bands. Here is the workflow I was using with the virtual rasters as inputs (note that many processing steps came before the final step where values greater than 255 are set to 255 and the values are converted to integers using the Con and Int tools): # Create empty list for RGB bands bandList = [] # Remove negative values and convert each band to an integer raster aR = arcpy.sa.Int(arcpy.sa.Con(iR, "255", iR, "VALUE > 255")) bandList.append(aR) aG = arcpy.sa.Int(arcpy.sa.Con(iG, "255", iG, "VALUE > 255")) bandList.append(aG) aB = arcpy.sa.Int(arcpy.sa.Con(iB, "255", iB, "VALUE > 255")) bandList.append(aB) # Combine the aRGB bands into a composite raster outpath = os.path.join(outdir, outname) arcpy.CompositeBands_management(bandList, outpath) And this is the amended workflow, where I actually save the raster objects to a file before combining them: # Create empty list for RGB bands bandList = [] # Remove negative values and convert each band to an integer raster aR = arcpy.sa.Int(arcpy.sa.Con(iR, "255", iR, "VALUE > 255")) aG = arcpy.sa.Int(arcpy.sa.Con(iG, "255", iG, "VALUE > 255")) aB = arcpy.sa.Int(arcpy.sa.Con(iB, "255", iB, "VALUE > 255")) # Save bands as GeoTIFF rasters in the scratch folder aRpath = os.path.join(scratchpath, "aR.tif") aR.save(aRpath) bandList.append(aRpath) aGpath = os.path.join(scratchpath, "aG.tif") aG.save(aGpath) bandList.append(aGpath) aBpath = os.path.join(scratchpath, "aB.tif") aB.save(aBpath) bandList.append(aBpath) # Combine the aRGB bands into a composite raster outpath = os.path.join(outdir, outname) arcpy.CompositeBands_management(bandList, outpath) The output RGB rasters look pretty similar. When the virtual input bands are used there are more NoData pixels, however - some of the individual bands contain NoData values where there should be values of 1; I'm not sure what's going on there, but that's a problem for another day. The important thing to note is that the one generated with the virtual rasters as inputs lists all bands as Band_1 (even though they're clearly not), while the one generated with the saved GeoTIFF rasters lists the bands correctly. Note that the same behavior occurs when using the Toolbox manually or using the script. When the virtual rasters are used for the input bands, all the bands are listed as Band_1. When the saved rasters are used for the input bands, the band numbers are correct.
... View more
09-15-2020
08:03 PM
|
0
|
0
|
638
|
POST
|
I haven't been able to find a way to change the labels on the RGB bands in ArcGIS Pro. In ArcMap I can just replace the text with whatever I want, which is great when I'm generating a composite of different datasets that are displayed in RGB format. For example: I have not found a way to do this in ArcGIS Pro. I can't just click on the text twice like I can in ArcMap to type in something else, and I've explored all manner of settings trying to find where I might be able to override the default labels with no success. I've looked both in the map and layout interfaces, in the legend settings, in the layer properties, etc., but find myself stuck with the default band information. Am I missing something, or is this just not supported in Pro? It would also be fine if I could add descriptions instead of labels for each of the bands. I just want a way to indicate what the different RGB channels represent in the image.
... View more
09-01-2020
05:09 PM
|
1
|
2
|
221
|
POST
|
There are two settings involved in making this happen, and both can be adjusted in the Settings tab of the Item page for the Tile Layer (hosted) item, in the last section of the settings: Set the Visible Range to include the desired levels of detail, and click the Save button Click the Build Tiles button, and it will display a table indicating which tiles have already been generated, along with any additional tiles that are possible to build based on the extent of the Visible Range settings. Check the box next to the additional tile levels that you want to generate, and click the Create Tiles button. If the layer is already in a map, you will need to adjust the visibility range there as well, if you haven't already, to display the additional tile layers.
... View more
05-08-2020
10:49 AM
|
0
|
0
|
27
|
POST
|
I published a raster dataset from ArcGIS Pro to AGOL as a web layer (tile), and the level of detail settings were set for 8-15. After it was uploaded to AGOL, I realized that I should have included at least level 7 as well, so that it would be visible when zoomed to the level that included the full extent of the image. Is there a way to add on the additional layer of caching to the AGOL tile dataset without having to generate and upload the entire web layer again?
... View more
04-20-2020
02:29 PM
|
0
|
1
|
58
|
POST
|
It turns out that you have to be in the Project or Portal tab in the Catalog pane in order to drag and drop. I had been trying to add content from my Favorites tab.
... View more
02-18-2020
06:51 PM
|
2
|
0
|
290
|
POST
|
Based on the ESRI documentation for ArcGIS Pro, I thought that I could drag and drop files from either the Catalog pane or Catalog view into a map. I just installed Pro 2.5, and I can only drag and drop from the Catalog view. I have not been able to drag a file from the Catalog pane onto my map; I have to right-click the desired file and select the "Add to Current Map" option to add files from the pane, while dragging and dropping from the view works fine. Is there something I'm missing? I encountered the same issue whether I was trying to add rasters or shapefiles. From Catalog pane, catalog view, and browse dialog box—ArcGIS Pro | Documentation : The Catalog pane docks in the ArcGIS Pro application, providing access to items in your project and the active portal while you work. After browsing or searching for content, you can drag layers onto maps , datasets onto tools, tools onto models, and so on.
... View more
02-18-2020
06:24 PM
|
0
|
3
|
572
|
POST
|
Thanks Dan Patterson for taking time to look at this issue. It turns out that I can use the CopyRaster_management function to save the output of the CompositeBands function as an 8-bit unsigned integer raster. The copied output has correctly-named bands, and the additional benefit of a much-reduced filesize. That approach should get me where I need to be; I can afford to lose some pixel depth, and the product is much tidier.
... View more
11-26-2019
04:25 PM
|
0
|
0
|
417
|
POST
|
Just to be clear, there's no problem with the actual data output. The bands are being combined appropriately, they're just not being labeled correctly.
... View more
11-26-2019
03:23 PM
|
0
|
1
|
417
|
Online Status |
Offline
|
Date Last Visited |
01-14-2021
07:30 PM
|