Skip to content

Commit 0667072

Browse files
committed
Tweaked mosaic support
1 parent ea69509 commit 0667072

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

arcpyext/mapping/_cim/layers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def __init__(self, proj_zip, layer_string):
121121
# probably JSON, attempt that
122122
super().__init__(proj_zip, CIMMosaicLayer.FromJson(layer_string))
123123

124-
def _get_mosaic_child_paths(self):
125-
return [self._cim_obj.BoundaryLayer[8:],self._cim_obj.FootprintLayer[8:],self._cim_obj.ImageLayer[8:]]
124+
def _get_child_paths(self):
125+
return [self._cim_obj.BoundaryLayer[8:], self._cim_obj.FootprintLayer[8:], self._cim_obj.ImageLayer[8:]]
126126

127127

128128
class ProFeatureMosaicSubLayer(ProLayerBase):

arcpyext/mapping/_cim/pro_map.py

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# pylint: enable=wildcard-import,unused-wildcard-import,wrong-import-order,wrong-import-position,import-error,no-name-in-module
1111

1212
# Third-party imports
13-
import json
1413
import arcpy
1514

1615
# Local imports
@@ -89,26 +88,12 @@ def _create_layers(self, layer_path):
8988
layer_obj = create_layer(self._proj_zip, layer_string)
9089
self._layers.append(layer_obj)
9190

92-
if layer_obj:
93-
94-
# Mosaic imagery datasets have different internal structures and need
95-
# to be handled differently from other layers.
96-
layer_json = json.loads(layer_string)
97-
if layer_json["type"] == "CIMMosaicLayer":
98-
mosaic_children_paths = layer_obj._get_mosaic_child_paths()
99-
100-
for mosaic_child_path in mosaic_children_paths:
101-
mosaic_child_layer = self._create_layers(mosaic_child_path)
102-
103-
# build parent/child relationships
104-
mosaic_child_layer._parent = layer_obj
105-
layer_obj._children.append(mosaic_child_layer)
106-
else:
107-
for child_path in layer_obj._get_child_paths():
108-
child_layer = self._create_layers(child_path)
109-
110-
# build parent/child relationships
111-
child_layer._parent = layer_obj
112-
layer_obj._children.append(child_layer)
91+
if layer_obj:
92+
for child_path in layer_obj._get_child_paths():
93+
child_layer = self._create_layers(child_path)
94+
95+
# build parent/child relationships
96+
child_layer._parent = layer_obj
97+
layer_obj._children.append(child_layer)
11398

11499
return layer_obj

0 commit comments

Comments
 (0)