Adding Rasters to Database (in Catalog Panel)

655
9
07-27-2022 10:50 AM
Labels (3)
KatherineMcNulty
New Contributor II

Hello,

I am trying to create a model using the model builder, but I am having trouble getting my rasters to be selected by the model. I believe I need to get them to save to the actual database but I can't figure out how to do it. I've added the rasters to the project and I can see them in the map and select them in the geoprocessing toolbox but not in the model builder. I'm unsure how to get them into the actual database so the model can pull them from (see photo to see where I want them to show up).

KatherineMcNulty_0-1658944195017.png

 

Thanks!

Katie

0 Kudos
9 Replies
RhettZufelt
MVP Frequent Contributor

What GP tool are you trying to load them into in the model?

Most tools that support rasters will "see" them, even if in a different database. 

R_

 

0 Kudos
KatherineMcNulty
New Contributor II

Well I am trying to do extract by mask. However, I have multiple polygons so I would like to do an if/then type statement for the extract by mask. My rasters are already projected, so if an image falls within the bounds of one polygon I would like to extract by mask by the extent of that polygon. Right now I am just testing one image I know that is within the bounds of the polygon and just extract to see how the model builder works.

 

This is my model builder now: 

KatherineMcNulty_0-1658946875686.png

This is my layer/images:

KatherineMcNulty_1-1658947057176.png

Thanks!

0 Kudos
RhettZufelt
MVP Frequent Contributor

What is the format of the imagery?

I tested with a jpeg2000, Mosaic dataset, and an Image service.  All of them are available in the Input raster drop down of the Extract by Mask GP tool.

RhettZufelt_0-1658950448367.png

 

R_

 

0 Kudos
KatherineMcNulty
New Contributor II

They are all .tif, should I convert them to another format? Do you think I could add that step to the model?

0 Kudos
RhettZufelt
MVP Frequent Contributor

.tif should be fine.

If they are not showing up in the dropdown list of the Extract tool, what happens if you click the folder and navigate to the .tif file directly?

R_

 

0 Kudos
KatherineMcNulty
New Contributor II

I added a folder and can select one individually but I would like the model to go through the entire folder and process them all the same. 

0 Kudos
RhettZufelt
MVP Frequent Contributor

I normally don't use model builder, but testing seems to work as expected.

In the Iterate Rasters tool, I set a folder containing my images (jp2's n this case) and un-check recursive as I don't have/want sub-folders read.

RhettZufelt_0-1659378437864.png

 

Then in the Extract by Mask tool, use Input raster or feature mask data as the input raster or feature mask data to the tool and the raster to extract from as the Input raster:

RhettZufelt_1-1659378503623.png

 

Then, since the raster iterator also outputs a %Name% variable, use that in the output filename so that it doesn't keep overwriting the first output raster made:

RhettZufelt_2-1659378561544.png

R_

 

 

 

 

 

0 Kudos
KatherineMcNulty
New Contributor II

I think I ran into another potential problem, the polygons I am trying to use for the extract by mask are showing up at an angle (see the below photo). I'm not sure if this is why the function is failing. I defined the projection for each polygon again and it is still showing up at a strange angle. I did create these polygons in another project then packaged them and imported them to this new project. It took quite a while to draw the polygons so I don't want to have to re-do it, but the older project had a lot of other layers that slowed things down.

 

KatherineMcNulty_0-1659377332642.png

 

0 Kudos
RhettZufelt
MVP Frequent Contributor

Are you working in a Map or a Scene?

0 Kudos