Is it possible to replaceDataSource of layer with dataset stored in_memory?

355
1
Jump to solution
02-14-2012 12:52 AM
GraemeBrowning
Occasional Contributor III
I've enjoyed using in_memory workspaces to speed up some Python script tools that get published as Geoprocessing Services.

The tools open MXDs and perform, among other things, an ExportToPDF.

In the MXD there is a layer that references a dataset stored on disk.

At runtime a new dataset gets created with the same schema as that above but, given a choice, I would like that new dataset to ONLY be written to the in_memory workspace.

My testing suggests that using in_memory workspaces like this is not supported by either Layer.replaceDataSource or Layer.findAndReplaceWorkspacePath.

Is there a way to replace the data souce of a layer with a feature class stored in the in_memory workspace so that it can be displayed in a map that gets exported to PDF before the in_memory workspace is deleted?

Note: After no responses here in first 12 hours or so I have also posted this to Stack Exchange GIS
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
GraemeBrowning
Occasional Contributor III
An ArcGIS Idea for this has now been submitted.

View solution in original post

0 Kudos
1 Reply
GraemeBrowning
Occasional Contributor III
An ArcGIS Idea for this has now been submitted.
0 Kudos