Select to view content in your preferred language

Output from ArcGIS Pro Script Tool to Content Pane

663
3
07-21-2020 12:30 AM
NourAburaed
New Contributor

Hello, I am new to ArcGIS Pro and developing with Python, so please bear with me if this is a beginner question.

I am creating a script tool, which is performing a series of image processing tasks. What I am stuck with is:

1- If I drag and drop an image as an input raster from the content pane to the tool, the image gets added but without its projections. Would it be possible to add the image (using this way) along with its projections?

2- How can I output the result image from the code as a layer in the content pane? 

Thanks. 

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

In the dialog of the toolbox you are using, you should have specified a parameter of the appropriate type (raster layer or raster dataset).

I would navigate to the image and select it rather than dragging.

To get the outputs you should add the code snippet from 

Make Raster Layer—Data Management toolbox | Documentation 


... sort of retired...
NourAburaed
New Contributor

I am setting the right parameter, but it still takes the image alone without its projection (unlike when I browse for the image from its directory).

Many thanks for linking the code snippet. I will give it a try.

0 Kudos
DanPatterson
MVP Esteemed Contributor

browsing is the way to go, I suspect that something else handles dragging and dropping and it treats it as an unreferenced image


... sort of retired...
0 Kudos