Select to view content in your preferred language

ArcGISLocalDynamicMapServiceLayer referencing the same geodatabase

3670
3
Jump to solution
04-30-2013 08:26 AM
CarlosColón-Maldonado
Frequent Contributor
Greetings,

As a package option, I want to be able to generate geoprocessing packages (gpk) that, when executed via a local geoprocessing service, can execute adding or remove rasters to the referenced mosaic datasets, similarly to how the geoprocesing samples apps Runtime comes with do, e.g., Viewshed, ClipFeatures, etc., off the same geodatabase. But, that's all about getting to second base and I need to get to first (not loose data source references on moved/copied map packages and associated data). Essentially, I need to provide different views, via map packages, from data off a single geodatabase.

I tried setting the application data path instead of allowing Runtime use a default user folder. I am noticing errors where no map data contained in the geodatabase the map package references is being displayed. This occurred when I copy the entire map folder containing the map document, the created map package, the geodatabase, and the folder with raster data loaded on the mosaic datasets, to another computer. I noticed that "datadir" is not the same as AppDataLocalDir" because they are set to different places, and I am still seeing the "datadir does not exist, creating: ..." line.

The map package created in Windows kept references where Arc Map had saved a good state and a package was made on that location:
Java version : 1.7.0_17 (Oracle Corporation) x86
Rendering engine : DirectX
Starting server
OS Name: Windows 7
"C:\Program Files\ArcGIS
SDKs\java10.1.1\arcgisruntime10.1.1\LocalServer32\bin\RuntimeLocalServer.exe"
appPid=496
AppStateDir=C:\eclipse\workspace\MapManager\res\map
C:\Program Files\ArcGIS SDKs\java10.1.1\ArcGISRuntime10.1.1\LocalServer32\bin
'apppid' = '496'
'appstatedir' = 'C:\eclipse\workspace\MapManager\res\map'
'cleanuponshutdown' = ''
'crashdump' = 'mini'
'enablehtmlviews' = ''
'maxport' = '60000'
'minport' = '50000'
'urlprefix' = 'random'
datadir does not exist, creating:
"C:\Users\CARLOS~1.COL\AppData\Local\Temp\arcgisruntime_4348"
Message : DataDir :
C:\Users\CARLOS~1.COL\AppData\Local\Temp\arcgisruntime_4348
Message : Logging disabled
Message : AppDataLocalDir : C:\eclipse\WORKSP~1\MAPMAN~1\res\map\Local
Message : AppDataRoamingDir : C:\eclipse\WORKSP~1\MAPMAN~1\res\map\Roaming
Message : AppDataCommonDir : C:\eclipse\WORKSP~1\MAPMAN~1\res\map\Common
Message : MyDocumentsDir : C:\eclipse\WORKSP~1\MAPMAN~1\res\map\Documents
Message : CrashDumpPath :
C:\Users\CARLOS~1.COL\AppData\Local\Temp\ArcGISRuntimeErrorReports
Message : Running using developer license
Message : Licensing level : standard:standard:0
Message : Server version : 10.1.1.3298
Message : Server listening on : http://127.0.0.1:50000/ZXZJNF/arcgis/rest


I then copied the folder to a Linux box and debugged the application on
eclipse:
Java version : 1.7.0_17 (Oracle Corporation) amd64
Rendering engine : OpenGL
Info: XInitThreads() called for concurrent Thread support
Starting server
OS Name: Linux
/home/epguser/arcgis/runtime_sdk/java10.1.1/ArcGISRuntime10.1.1/LocalServerLx/bin/runtimeLauncher
appPid=15590
onLinux
AppStateDir=Z:/media/data/workspace/MapManager/res/map
/home/epguser/arcgis/runtime_sdk/java10.1.1/ArcGISRuntime10.1.1/LocalServerLx/bin
'apppid' = '15590'
'appstatedir' = 'Z:/media/data/workspace/MapManager/res/map'
'cleanuponshutdown' = ''
'crashdump' = 'mini'
'datadir' = '/tmp'
'enablehtmlviews' = ''
'maxport' = '60000'
'minport' = '50000'
'onlinux' = ''
'urlprefix' = 'random'
datadir does not exist, creating: "Z:\tmp\arcgisruntime_8"
Message : DataDir : Z:\tmp\arcgisruntime_8
Message : Logging disabled
Message : AppDataLocalDir : Z:\media\data\WO~0JJXE\MA~REKI5\res\map\Local
Message : AppDataRoamingDir : Z:\media\data\WO~0JJXE\MA~REKI5\res\map\Roaming
Message : AppDataCommonDir : Z:\media\data\WO~0JJXE\MA~REKI5\res\map\Common
Message : MyDocumentsDir : Z:\media\data\WO~0JJXE\MA~REKI5\res\map\Documents
Message : CrashDumpPath : Z:\tmp\ArcGISRuntimeErrorReports
Message : Running using developer license
Message : Licensing level : standard:standard:0
Message : Server version : 10.1.1.3265
Message : Server listening on : http://127.0.0.1:50000/GFrhD4/arcgis/rest
java.lang.NullPointerException
    at com.esri.map.LayerInfo.addLayer(Unknown Source)
    at com.esri.map.ArcGISDynamicMapServiceLayer.a(Unknown Source)
    at com.esri.map.ArcGISDynamicMapServiceLayer$1.run(Unknown Source)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)


I know it has something to do with not using relative paths because this occurs even when I move the map folder (where it works)  to another location, and I run the application pointing to the new map folder location. I may not be setting the referenced geodatabase on the MXD properly so it could find it when unpackaged.

Now, I have temporarily solved this problem by including (nor referencing) all data on package creation (see screen shot). I've noticed that the package is larger in size, but not much bigger than I expected if it would also include the raster data folders that the mosaic datasets are handling. Since these packages are extracted to a "datadir" location, How could two packages point to the same geodatabase? Could someone enlighten me on this setting differences with respect to ArcGIS Runtime support on map packages?

[ATTACH=CONFIG]23868[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
CarlosColón-Maldonado
Frequent Contributor
The original issue has long being resolved since version 10.1.1, and no issues has been noted regardless of where the application runs.

1. If the addition of rasters to a mosaic dataset contained by a geodatabase that was extracted to a temporary folder from an map package is not preserved in the map used but on the temporary location, how do I preserve the changes that were made on the temporary folder for more than a session? Is this what the ArcGISRuntime.setAppDataDirectory(String) method does? As a side note, our users will not have Arc Map available to re-package map documents after adding rasters, and they expect our application to preserve any raster data they load over the life of the application, until they choose to remove it.


It has also being noted that, once the mpa packes are extracted for the first time, the services do point ot the same location where the package was extracted.

2. If there is no easier way to have two ArcGISLocalDynamicMapServiceLayer objects point to the same geodatabase that contain a mosaic dataset they reference, what approach could I use to only display the Image sublayer of the mosaic layer on one window and only display the Footprint sublayer of that same mosaic layer of that same ArcGISLocalDynamicMapServiceLayer object on another window? I'm guessing this would circumvent the issue and would clarify why I need to have two map views of data from a shared geodatabase in ArcGIS Runtime.


There is no reason to do this given that the layers the services render can be consumed by any number of maps that can access them. The visibility of only the footprint layer of the services rendering the mosaic dataset content can be done via their visibility manipulation on Java component renderers.

View solution in original post

0 Kudos
3 Replies
CarlosColón-Maldonado
Frequent Contributor
I would like to add a couple more related concept questions:

1. If the addition of rasters to a mosaic dataset contained by a geodatabase that was extracted to a temporary folder from an map package is not preserved in the map used but on the temporary location, how do I preserve the changes that were made on the temporary folder for more than a session? Is this what the ArcGISRuntime.setAppDataDirectory(String) method does? As a side note, our users will not have Arc Map available to re-package map documents after adding rasters, and they expect our application to preserve any raster data they load over the life of the application, until they choose to remove it.

2. If there is no easier way to have two ArcGISLocalDynamicMapServiceLayer objects point to the same geodatabase that contain a mosaic dataset they reference, what approach could I use to only display the Image sublayer of the mosaic layer on one window and only display the Footprint sublayer of that same mosaic layer of that same ArcGISLocalDynamicMapServiceLayer object on another window? I'm guessing this would circumvent the issue and would clarify why I need to have two map views of data from a shared geodatabase in ArcGIS Runtime.

Thanks in advanced.
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
This post states that ArcGISLocalDynamicMapServiceLayer objects created with Dynamic Workspaces can be used to alter contents on the fly.

...working with Dynamic Workspaces. These can be used for altering the content of a local map package on the fly.  For example, you might have an .mpk to which you want to add a shapefile.


Can these be used to ensure the added raster data on mosaic datasets persists in the extracted map document? I want to ensure that any additions to rasters on the containing mosaic datasets persist at application restart.
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
The original issue has long being resolved since version 10.1.1, and no issues has been noted regardless of where the application runs.

1. If the addition of rasters to a mosaic dataset contained by a geodatabase that was extracted to a temporary folder from an map package is not preserved in the map used but on the temporary location, how do I preserve the changes that were made on the temporary folder for more than a session? Is this what the ArcGISRuntime.setAppDataDirectory(String) method does? As a side note, our users will not have Arc Map available to re-package map documents after adding rasters, and they expect our application to preserve any raster data they load over the life of the application, until they choose to remove it.


It has also being noted that, once the mpa packes are extracted for the first time, the services do point ot the same location where the package was extracted.

2. If there is no easier way to have two ArcGISLocalDynamicMapServiceLayer objects point to the same geodatabase that contain a mosaic dataset they reference, what approach could I use to only display the Image sublayer of the mosaic layer on one window and only display the Footprint sublayer of that same mosaic layer of that same ArcGISLocalDynamicMapServiceLayer object on another window? I'm guessing this would circumvent the issue and would clarify why I need to have two map views of data from a shared geodatabase in ArcGIS Runtime.


There is no reason to do this given that the layers the services render can be consumed by any number of maps that can access them. The visibility of only the footprint layer of the services rendering the mosaic dataset content can be done via their visibility manipulation on Java component renderers.
0 Kudos