Skip to content

Commit

Permalink
Merge pull request #215 from hotosm/fix/unit-tests
Browse files Browse the repository at this point in the history
Fix : Unit test build
  • Loading branch information
kshitijrajsharma authored Feb 21, 2024
2 parents 9650482 + 60db771 commit d12e8a7
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 235 deletions.
22 changes: 12 additions & 10 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,16 +544,6 @@ def ogr_export(query, outputtype, working_dir, dump_temp_path, params):
file.write(query)

format_options = {
RawDataOutputType.MBTILES.value: {
"format": "MBTILES",
"extra": (
"-dsco MINZOOM={} -dsco MAXZOOM={} ".format(
params.min_zoom, params.max_zoom
)
if params.min_zoom and params.max_zoom
else "-dsco ZOOM_LEVEL_AUTO=YES"
),
},
RawDataOutputType.FLATGEOBUF.value: {
"format": "FLATGEOBUF",
"extra": "-lco SPATIAL_INDEX=YES VERIFY_BUFFERS=NO",
Expand All @@ -580,6 +570,18 @@ def ogr_export(query, outputtype, working_dir, dump_temp_path, params):
},
}

if ENABLE_TILES:
format_options[RawDataOutputType.MBTILES.value] = {
"format": "MBTILES",
"extra": (
"-dsco MINZOOM={} -dsco MAXZOOM={} ".format(
params.min_zoom, params.max_zoom
)
if params.min_zoom and params.max_zoom
else "-dsco ZOOM_LEVEL_AUTO=YES"
),
}

file_name_option = (
f"-nln {params.file_name if params.file_name else 'raw_export'}"
)
Expand Down
Loading

0 comments on commit d12e8a7

Please sign in to comment.