Map Service - Geodatabase location

2793
3
06-12-2014 02:26 AM
Labels (1)
GaryWilkins
New Contributor
Hi,

As part of our application we want to ensure that our GPKs are always using the same geodatabase that the currently loaded map package is using. To achieve this we are passing in the path to the GDB on disk to our geoprocessing packages.

We have set the AppDataPath so we can control where the runtime extracts the MPK (which contains our Geodatabase), but we are unsure how to work out the path to the GDB precisely as the packages under ???%AppDataPath%\Documents\ArcGIS\Packages\??? use GUIDs in their names.

Is it possible to find out using the runtime the exact location of the geodatabase that the MPK is using?

Thanks,
0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

A GUID is used to ensure uniqueness when unpacking packages on disk. Therefore it is not possible to predict the location in advance. I am not aware of any mechanism to find the precise unpack location via the API either.

I would recommend deploying the GDB separately then using the dynamic layers capability to reference the GDB from the dynamic map service layer, and you can pass the path of the GDB into the GPK as a string and turn it into a workspace within the model.

Cheers

Mike
0 Kudos
GaryWilkins
New Contributor
Thanks Mike,

We feared this may be the case.

It's a bit of shame really, is this something which may be added in future? Seems like it might be handy in a few, admittedly slightly less orthodox, scenarios.

Jon
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
...is this something which may be added in future? Seems like it might be handy in a few, admittedly slightly less orthodox, scenarios.


Perhaps, but the recommended approach would be to specifically deploy the geodatabase to a known location (will need to be an absolute path for the MPK, and potentially the GPK too depending on how you reference the geodatabase) then use a string in your GP model to reference the geodatabase and use the DynamicLayers capability on the ArcGISLocalDynamicMapServiceLayer to reference the geodatabase at runtime.

Cheers

Mike
0 Kudos