Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion udata_hydra/analysis/geojson.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import logging
import os
import subprocess
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Iterator
Expand Down Expand Up @@ -267,7 +268,9 @@ async def geojson_to_pmtiles(

log.debug(f"Converting GeoJSON file '{input_file_path}' to PMTiles file '{output_file_path}'")

tippecanoe_bin = config.TIPPECANOE_BIN or os.path.join(tippecanoe.BIN_DIR, "tippecanoe")
command = [
tippecanoe_bin,
"--maximum-zoom=g", # guess
"-o",
str(output_file_path),
Expand All @@ -276,7 +279,7 @@ async def geojson_to_pmtiles(
"--extend-zooms-if-still-dropping",
str(input_file_path),
]
exit_code = tippecanoe._program("tippecanoe", *command)
exit_code = subprocess.call(command)
if exit_code:
raise ValueError(f"GeoJSON to PMTiles conversion failed with exit code {exit_code}")
log.debug(f"Successfully converted {input_file_path} to {output_file_path}")
Expand Down
1 change: 1 addition & 0 deletions udata_hydra/config_default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ MINIO_PARQUET_FOLDER = "" # no trailing slash

# -- PMTiles conversion settings -- #
GEOJSON_TO_PMTILES = false
TIPPECANOE_BIN = ""
MINIO_PMTILES_BUCKET = ""
MINIO_PMTILES_FOLDER = "" # no trailing slash

Expand Down