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.
34 lines
1.1 KiB
Batchfile
34 lines
1.1 KiB
Batchfile
@echo off
|
|
setlocal enableextensions
|
|
REM Run gdalbuildvrt from the GDAL bundled with QGIS.
|
|
REM
|
|
REM QGIS ships GDAL but its Python bindings need the OSGeo4W environment
|
|
REM (GDAL_DATA, PROJ_LIB). Loading o4w_env.bat first keeps PROJ working.
|
|
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 gdalbuildvrt 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 gdalbuildvrt wrapper: "%QGIS_ROOT%\bin\o4w_env.bat" is missing; is this a QGIS install? 1>&2
|
|
exit /b 2
|
|
)
|
|
if not exist "%QGIS_ROOT%\bin\gdalbuildvrt.exe" (
|
|
echo gdalbuildvrt wrapper: gdalbuildvrt.exe not found under "%QGIS_ROOT%\bin". 1>&2
|
|
exit /b 2
|
|
)
|
|
|
|
call "%QGIS_ROOT%\bin\o4w_env.bat" >nul 2>&1
|
|
"%QGIS_ROOT%\bin\gdalbuildvrt.exe" %*
|
|
exit /b %ERRORLEVEL%
|