How to set raster template function using Python

2461
8
04-21-2016 03:23 AM
JoãoNeto1
New Contributor

Hello,

Has anybody knows if i can and how i can set a raster template function using Python. (In ArcMap is in the Raster Properties for the Toolbox AddRasterTo MosaicDataset).

Thanks

0 Kudos
8 Replies
DanPatterson_Retired
MVP Esteemed Contributor
JoãoNeto1
New Contributor

Hi Dan,

Thanks for the answer.

But what im looking for is to set the Raster Template Function programatically using Python. I want to set the (*.rft.xml) template file for the tool AddRastersToMosaicDataset_management in a python script .

Cheers

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

That was what I was suggesting, if it isn't accessable through a tool in arctoolbox or one of the tool properties in arcpy.env, then it may not be possible.  You will have to explore what you can set through the tool and whether you can access that particular type of template through arcpy

0 Kudos
JoãoNeto1
New Contributor

Hum.. Ok Dan thanks.

It exists in arctoolbox but when i export it to python the properties do not come. Nor is the arcpy.env with this kind of info.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Ok... I am obviously missing something

Add Rasters To Mosaic Dataset—Help | ArcGIS for Desktop  is the tool and there are a load of optional parameters, they will use the default parameters if not specified

and this is the manual process

Adding raster data to a mosaic dataset using a custom template—Help | ArcGIS for Desktop

So somewhere in between something is missing, perhaps in the creation process of the mosaic prior to adding..  I will defer to others

0 Kudos
JoãoNeto1
New Contributor

Maybe i didn't make my self clear.

What i want to do is programatically in a python script call the AddRastersToMosaicDataset_management and somehow pass it the (*.rft.xml) file that is the template.

I can do this in Arctoolbox but not in python.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

yup...clear as a bell...I just can't find the link, nor can you either...so we will defer to others

0 Kudos
RyanDeBruyn1
New Contributor III

this post is long in the tooth... but looks like this can be done as part of the Set Mosaic Dataset Properties for future reference.

http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/set-mosaic-dataset-properti...

0 Kudos