10
10
from mapchete .config import raw_conf , raw_conf_output_pyramid
11
11
from mapchete .formats import read_output_metadata
12
12
from mapchete .io import MPath
13
- from mapchete .stac import create_prototype_files , tile_directory_stac_item
13
+ from mapchete .stac import (
14
+ create_prototype_files ,
15
+ tile_direcotry_item_to_dict ,
16
+ tile_directory_stac_item ,
17
+ )
14
18
from mapchete .validate import validate_zooms
15
19
16
20
logger = logging .getLogger (__name__ )
@@ -66,6 +70,7 @@ def create_item(
66
70
default_bounds_crs ,
67
71
default_zoom ,
68
72
default_item_metadata ,
73
+ band_asset_template ,
69
74
) = output_info (input_ )
70
75
71
76
if default_zoom :
@@ -94,11 +99,12 @@ def create_item(
94
99
item_path = item_path ,
95
100
asset_basepath = asset_basepath ,
96
101
relative_paths = relative_paths ,
102
+ band_asset_template = band_asset_template ,
97
103
bands_type = None ,
98
104
crs_unit_to_meter = 1 ,
99
105
)
100
106
logger .debug ("item_path: %s" , item_path )
101
- item_json = json .dumps (item . to_dict ( ), indent = indent )
107
+ item_json = json .dumps (tile_direcotry_item_to_dict ( item ), indent = indent )
102
108
click .echo (item_json )
103
109
if force or click .confirm (f"Write output to { item_path } ?" , abort = True ):
104
110
with fsspec .open (item_path , "w" ) as dst :
@@ -118,16 +124,19 @@ def output_info(inp):
118
124
conf .get ("bounds_crs" ),
119
125
conf .get ("zoom_levels" ),
120
126
conf ["output" ].get ("stac" ),
127
+ conf ["output" ].get ("tile_path_schema" , "{zoom}/{row}/{col}.{extension}" ),
121
128
)
122
129
130
+ output_metadata = read_output_metadata (path / "metadata.json" )
123
131
return (
124
- read_output_metadata ( path / "metadata.json" ) ["pyramid" ],
132
+ output_metadata ["pyramid" ],
125
133
path ,
126
134
path .name ,
127
135
None ,
128
136
None ,
129
137
None ,
130
138
None ,
139
+ output_metadata .get ("tile_path_schema" , "{zoom}/{row}/{col}.{extension}" ),
131
140
)
132
141
133
142
0 commit comments