Basemap Pusher: catalog and distribution gateway for existing tiles
A Go service that scans existing basemap tile directories and vector files, catalogues them in SQLite, issues scoped access tokens, and serves tiles and downloads to downstream systems. It deliberately does not generate or process raster data: GIS software produces the tiles, this service catalogues, authorises and distributes them. Capabilities - scans basemap tile directories (manifest-based or raw z/x/y) and vector assets (.geojson, .json, .zip, shapefiles with sidecars) - token auth with per-resource grants, expiry and coarse scopes (read, slice) - resource health inspection flags a moved or deleted tile root before a client hits a 404 - downstream push with exponential-backoff retries and manual re-queue - image slicing jobs driven by the GDAL bundled with QGIS, including VRT mosaicking so successive drone flights accumulate into one seamless layer - a narrow, non-admin slicing API for external callers: submit, poll, idempotent by job code, completion callback - ops console covering health, ledger, tokens, pushes, scans, slicing and service info - native Windows service install/start/stop with crash recovery, auto-start and a rotating log file, so no NSSM or WinSW wrapper is needed Verified with 49 tests plus live runs against real tile data and real GDAL.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
@echo off
|
||||
setlocal enableextensions
|
||||
REM Run gdal2tiles.py from the GDAL bundled with QGIS.
|
||||
REM
|
||||
REM QGIS ships GDAL but its Python bindings need the OSGeo4W environment
|
||||
REM (GDAL_DATA, PROJ_LIB, PYTHONHOME). Running gdal2tiles.exe from a bare
|
||||
REM shell fails to import osgeo, so this wrapper loads o4w_env.bat first.
|
||||
REM
|
||||
REM Override auto-detection with: set GDAL2TILES_QGIS_ROOT=C:\path\to\QGIS
|
||||
|
||||
set "QGIS_ROOT=%GDAL2TILES_QGIS_ROOT%"
|
||||
if not "%QGIS_ROOT%"=="" goto have_root
|
||||
|
||||
for /f "delims=" %%D in ('dir /b /ad /o-n "%ProgramFiles%\QGIS *" 2^>nul') do (
|
||||
if not defined QGIS_ROOT set "QGIS_ROOT=%ProgramFiles%\%%D"
|
||||
)
|
||||
|
||||
:have_root
|
||||
if "%QGIS_ROOT%"=="" (
|
||||
echo gdal2tiles wrapper: QGIS not found. Set GDAL2TILES_QGIS_ROOT to the QGIS install directory. 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
|
||||
if not exist "%QGIS_ROOT%\bin\o4w_env.bat" (
|
||||
echo gdal2tiles wrapper: "%QGIS_ROOT%\bin\o4w_env.bat" is missing; is this a QGIS install? 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
if not exist "%QGIS_ROOT%\apps\Python312\Scripts\gdal2tiles.exe" (
|
||||
echo gdal2tiles wrapper: gdal2tiles.exe not found under "%QGIS_ROOT%\apps\Python312\Scripts". 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
|
||||
call "%QGIS_ROOT%\bin\o4w_env.bat" >nul 2>&1
|
||||
"%QGIS_ROOT%\apps\Python312\Scripts\gdal2tiles.exe" %*
|
||||
exit /b %ERRORLEVEL%
|
||||
Reference in New Issue
Block a user