Code for batch generation of thumbnails within ArcSDE database

862
3
06-11-2013 07:25 AM
NeilWrobel
New Contributor II
Hi

I currently help manage my companies enterprise ArcSDE database.
We are running ArcSDE 9.3.1 on Oracle 10.0.2.

I am after a single script which can be run to create/update the metadata thumbnails of all fetaure classes and rasters within the database. Many of the feature classes are contained within feature datasets.

The thumbnails need to be generated from the preview, the same as when using the Create Thumbnail button in ArcCatalog.

I am new to python and programming in general, but my feeling is that if there is a button to do this once, then it is likely that this can be scripted to do a batch.

Thanks in advance for any answers.

Neil Wrobel
Tags (2)
0 Kudos
3 Replies
StacyRendall1
Occasional Contributor III
Hi Neil,

I'm not saying it is impossible to do this programatically, but it would not be as simple as you are hoping. Arcpy scripts can only make use of Arc Toolbox geoprocessing tools. It appears that the thumbnail button is a built in function, not a geoprocessing tool, and hence cannot be accessed from Arcpy.
0 Kudos
RhettZufelt
MVP Frequent Contributor
Don't know if it's possible either, but the XSLT Transformation can change "some" aspects of the metadata.  Good at removing items (such as thumbnails, geoprocessing history, etc.) from the metadata.

http://resources.arcgis.com/en/help/main/10.1/index.html#//001200000017000000

and here is example of using it in python to modify metadata on all FC's (in and outside of feature datasets) withing a database.

http://support.esri.com/en/knowledgebase/techarticles/detail/41026   (of course, this one invokes the remove_gp_history_xslt instead of remove thumbnails, but simple to change)

I'm not around a computer that I can look into it more to even see if the xslt can be used to actually "add" a thumbnail or just remove them.

If it can, could possibly use arcpy.mapping to iterate through them all and export the right size/type image for each FC, then add them with the xslt transform.

Just a thought,

In any case, if you ever get tired of multiple pages of Geoprocessing history in your metadata, maybe this post will come in handy after all,:cool:

R_
0 Kudos
NeilFordyce
New Contributor III

I've seen it done in ArcCatalog in C# and have butchered the code to use myself to bulk create thumbnails but for file system and geodatabase data so haven't tried on SDE.

The logic is that you iterate through the selected data sets and preview them capturing the thumbnail.

The code activates the "Create Thumbnail" button for each of the data sets


Definitely something that needs adding to the wish list as making thumbnails for all the data sets is so painful..


Neil

0 Kudos