pax_global_header00006660000000000000000000000064145753745560014537gustar00rootroot0000000000000052 comment=5d18f5132c38ed5318f5508429db394459d0e2b5 mod_tile-0.7.1/000077500000000000000000000000001457537455600133405ustar00rootroot00000000000000mod_tile-0.7.1/.dockerignore000066400000000000000000000004521457537455600160150ustar00rootroot00000000000000* !cmake !CMakeLists.txt !docs/man !etc/apache2/renderd-example-map.conf !etc/apache2/tile.load.in !etc/renderd/renderd.conf.examples !etc/renderd/renderd.conf.in !includes !src !tests !utils/example-map # AutoTools !autogen.sh !configure.ac !etc/renderd/renderd.conf !m4 !Makefile.am !modules.mk mod_tile-0.7.1/.github/000077500000000000000000000000001457537455600147005ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/000077500000000000000000000000001457537455600163405ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/autotools/000077500000000000000000000000001457537455600203715ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/autotools/build/000077500000000000000000000000001457537455600214705ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/autotools/build/action.yml000066400000000000000000000005431457537455600234720ustar00rootroot00000000000000--- runs: using: composite steps: - name: Run `./autogen.sh` run: ./autogen.sh shell: bash --noprofile --norc -euxo pipefail {0} - name: Run `./configure` run: ./configure shell: bash --noprofile --norc -euxo pipefail {0} - name: Run `make` run: make shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/autotools/install/000077500000000000000000000000001457537455600220375ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/autotools/install/action.yml000066400000000000000000000004271457537455600240420ustar00rootroot00000000000000--- runs: using: composite steps: - name: Run `make install` run: make install shell: bash --noprofile --norc -euxo pipefail {0} - name: Run `make install-mod_tile` run: make install-mod_tile shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/autotools/test/000077500000000000000000000000001457537455600213505ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/autotools/test/action.yml000066400000000000000000000002171457537455600233500ustar00rootroot00000000000000--- runs: using: composite steps: - name: Run `make test` run: make test shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/build/000077500000000000000000000000001457537455600174375ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/build/action.yml000066400000000000000000000004431457537455600214400ustar00rootroot00000000000000--- runs: using: composite steps: - name: Build `mod_tile` (Autotools) uses: ./.github/actions/autotools/build if: matrix.build_system == 'Autotools' - name: Build `mod_tile` (CMake) uses: ./.github/actions/cmake/build if: matrix.build_system == 'CMake' mod_tile-0.7.1/.github/actions/cmake/000077500000000000000000000000001457537455600174205ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/cmake/build/000077500000000000000000000000001457537455600205175ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/cmake/build/action.yml000066400000000000000000000014511457537455600225200ustar00rootroot00000000000000--- runs: using: composite steps: - name: Create `cmake` symbolic link run: | if ! command -v cmake &> /dev/null && command -v cmake3 &> /dev/null; then ln --symbolic cmake3 /usr/bin/cmake fi shell: bash --noprofile --norc -euxo pipefail {0} - name: Prepare `build` directory run: | cmake -B build -S . \ -LA \ -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE:-Release} \ -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX:-/usr/local} \ -DENABLE_TESTS:BOOL=ON shell: bash --noprofile --norc -euxo pipefail {0} - name: Build `mod_tile` run: | export CMAKE_BUILD_PARALLEL_LEVEL=${BUILD_PARALLEL_LEVEL:-$(nproc)} cmake --build build shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/cmake/install/000077500000000000000000000000001457537455600210665ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/cmake/install/action.yml000066400000000000000000000003031457537455600230620ustar00rootroot00000000000000--- runs: using: composite steps: - name: Install `mod_tile` run: ${{ !matrix.image && 'sudo' || '' }} cmake --install build shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/cmake/test/000077500000000000000000000000001457537455600203775ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/cmake/test/action.yml000066400000000000000000000020011457537455600223700ustar00rootroot00000000000000--- runs: using: composite steps: - name: Create `ctest` symbolic link run: | if ! command -v ctest &> /dev/null && command -v ctest3 &> /dev/null; then ln --symbolic ctest3 /usr/bin/ctest fi shell: bash --noprofile --norc -euxo pipefail {0} - name: Test `mod_tile` run: ctest --exclude-regex 'clear_dirs|remove_tiles' --output-on-failure shell: bash --noprofile --norc -euxo pipefail {0} working-directory: build - name: Archive test artifacts on failure if: failure() run: | TAR_FILENAME=${{ matrix.image || matrix.os || github.job }}-${{ matrix.compiler }}.tar.gz TAR_FILENAME=$(echo "${TAR_FILENAME}" | sed 's/:/-/g') tar -zcf ${TAR_FILENAME} tests shell: bash --noprofile --norc -euxo pipefail {0} working-directory: build - name: Upload test artifacts on failure if: failure() uses: actions/upload-artifact@v3 with: name: Test Artifacts path: build/*.tar.gz mod_tile-0.7.1/.github/actions/dependencies/000077500000000000000000000000001457537455600207665ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/build-and-install/000077500000000000000000000000001457537455600242715ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/build-and-install/mapnik/000077500000000000000000000000001457537455600255505ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/build-and-install/mapnik/action.yml000066400000000000000000000041501457537455600275500ustar00rootroot00000000000000--- inputs: version: description: Version of Mapnik to build & install required: true runs: using: composite steps: - name: Create `Mapnik` source directory run: | mkdir mapnik-src shell: bash --noprofile --norc -euxo pipefail {0} - name: Cache "Download `Mapnik`" & "Build `Mapnik`" id: cache-mapnik-src uses: actions/cache@v3 with: path: mapnik-src key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-${{ inputs.version }} - name: Download `Mapnik` run: | curl --silent --location \ https://github.com/mapnik/mapnik/releases/download/v${{ inputs.version }}/mapnik-v${{ inputs.version }}.tar.bz2 \ | tar --extract --bzip2 --strip-components=1 --file=- shell: bash --noprofile --norc -euxo pipefail {0} working-directory: mapnik-src if: steps.cache-mapnik-src.outputs.cache-hit != 'true' - name: Build `Mapnik` run: | # Export variables export CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1" export GDAL_DATA=/usr/share/gdal export JOBS=${JOBS:-$(nproc)} export PROJ_LIB=/usr/share/proj export PYTHON=${PYTHON:-python3} # Create GDAL_DATA/PROJ_LIB directories mkdir --parents ${GDAL_DATA} ${PROJ_LIB} # Configure & build ./configure \ CC="${CC:-gcc}" \ CUSTOM_CFLAGS="${CUSTOM_CFLAGS:-}" \ CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS:-}" \ CUSTOM_DEFINES="${CUSTOM_DEFINES:-}" \ CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS:-}" \ CXX="${CXX:-g++}" \ FAST=True \ OPTIMIZATION=0 \ PREFIX="/usr" make PYTHON=${PYTHON} || make PYTHON=${PYTHON} shell: bash --noprofile --norc -euxo pipefail {0} working-directory: mapnik-src if: steps.cache-mapnik-src.outputs.cache-hit != 'true' - name: Install `Mapnik` run: | # Export `PYTHON` export PYTHON=${PYTHON:-python3} make install PYTHON=${PYTHON} shell: bash --noprofile --norc -euxo pipefail {0} working-directory: mapnik-src mod_tile-0.7.1/.github/actions/dependencies/build-and-install/mapnik/latest/000077500000000000000000000000001457537455600270445ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/build-and-install/mapnik/latest/action.yml000066400000000000000000000021321457537455600310420ustar00rootroot00000000000000--- runs: using: composite steps: - name: Cache "Checkout `Mapnik`" & "Build `Mapnik`" id: cache-mapnik uses: actions/cache@v3 with: path: | mapnik-build mapnik-src key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-latest - name: Checkout `Mapnik` uses: actions/checkout@v4 with: path: mapnik-src repository: mapnik/mapnik submodules: recursive if: steps.cache-mapnik.outputs.cache-hit != 'true' - name: Build `Mapnik` run: | export CMAKE_BUILD_PARALLEL_LEVEL=${BUILD_PARALLEL_LEVEL:-$(nproc)} cmake -B mapnik-build -S mapnik-src \ -DBUILD_DEMO_VIEWER:BOOL=OFF \ -DBUILD_TESTING:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX:PATH=/usr cmake --build mapnik-build shell: bash --noprofile --norc -euxo pipefail {0} if: steps.cache-mapnik.outputs.cache-hit != 'true' - name: Install `Mapnik` run: cmake --install mapnik-build shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/dependencies/install/000077500000000000000000000000001457537455600224345ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/install/action.yml000066400000000000000000000221721457537455600244400ustar00rootroot00000000000000--- inputs: debian-build-dependencies: default: >- apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev libiniparser-dev libmemcached-dev librados-dev debian-mapnik-latest-build-dependencies: default: >- cmake git libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libfreetype6-dev libgdal-dev libharfbuzz-dev libicu-dev libjpeg-dev libpq-dev libproj-dev libsqlite3-dev libtiff-dev libwebp-dev libxml2-dev postgresql-server-dev-all debian-test-dependencies: default: >- apache2 jq fedora-build-dependencies: default: >- cairo-devel glib2-devel httpd-devel iniparser-devel libcurl-devel libmemcached-devel librados-devel mapnik-devel sqlite-devel fedora-test-dependencies: default: >- httpd jq freebsd-build-dependencies: default: >- apache24 cairo coreutils curl glib iniparser libmemcached mapnik pkgconf freebsd-test-dependencies: default: >- jq macos-build-dependencies: default: >- apr cairo curl glib httpd iniparser libmemcached mapnik pkg-config macos-test-dependencies: default: >- coreutils jq opensuse-build-dependencies: default: >- apache2-devel cairo-devel curl glib2-devel libcurl-devel libiniparser-devel libmemcached-devel librados-devel opensuse-test-dependencies: default: >- apache2 apache2-event apache2-prefork jq opensuse-mapnik-build-dependencies: default: >- bzip2 freetype-devel gdal-devel harfbuzz-devel libboost_filesystem1_75_0-devel libboost_headers1_75_0-devel libboost_program_options1_75_0-devel libboost_regex1_75_0-devel libboost_system1_75_0-devel libicu-devel libjpeg8-devel libpng16-devel libtiff-devel libwebp-devel libxml2-devel make postgresql-devel proj-devel python3 sqlite3-devel tar zlib-devel rhel-build-dependencies: default: >- cairo-devel glib2-devel httpd-devel iniparser-devel libcurl-devel libmemcached-devel librados2-devel rhel-test-dependencies: default: >- httpd jq rhel-mapnik-build-dependencies: default: >- boost-devel bzip2 freetype-devel gdal-devel harfbuzz-devel libicu-devel libjpeg-devel libpng-devel libtiff-devel libwebp-devel libxml2-devel make postgresql-devel proj-devel python3 sqlite-devel tar zlib-devel ubuntu-build-dependencies: default: >- apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev libiniparser-dev libmemcached-dev librados-dev ubuntu-mapnik-latest-build-dependencies: default: >- cmake git libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libfreetype6-dev libgdal-dev libharfbuzz-dev libicu-dev libjpeg-dev libpq-dev libproj-dev libsqlite3-dev libtiff-dev libwebp-dev libxml2-dev postgresql-server-dev-all ubuntu-test-dependencies: default: >- apache2 jq mapnik-build-version-centos-stream: default: 3.1.0 mapnik-build-version-amazonlinux2-centos7: default: 3.0.17 mapnik-build-version-opensuse: default: 3.1.0 runs: using: composite steps: - name: Install Dependencies (Amazon Linux/CentOS/CentOS Stream) uses: ./.github/actions/dependencies/install/yum with: dependencies: epel-release packages: >- ${{ inputs.rhel-build-dependencies }} ${{ inputs.rhel-mapnik-build-dependencies }} ${{ inputs.rhel-test-dependencies }} ${{ matrix.build_system == 'CMake' && 'cmake3' || 'autoconf automake redhat-rpm-config' }} ${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc gcc-c++' }} ${{ matrix.image == 'centos:7' && matrix.compiler == 'LLVM' && 'gcc-c++' || '' }} if: | startsWith(matrix.image, 'amazonlinux:') || startsWith(matrix.image, 'centos:') || startsWith(matrix.image, 'quay.io/centos/centos:stream') - name: Install Dependencies (Debian) uses: ./.github/actions/dependencies/install/apt-get with: packages: >- ${{ inputs.debian-build-dependencies }} ${{ matrix.mapnik_latest && inputs.debian-mapnik-latest-build-dependencies || 'libmapnik-dev' }} ${{ inputs.debian-test-dependencies }} ${{ matrix.build_system == 'CMake' && 'cmake' || '' }} ${{ matrix.compiler == 'LLVM' && 'clang' || 'g++ gcc' }} if: startsWith(matrix.image, 'debian:') - name: Install Dependencies (Fedora) uses: ./.github/actions/dependencies/install/yum with: packages: >- ${{ inputs.fedora-build-dependencies }} ${{ inputs.fedora-test-dependencies }} ${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake redhat-rpm-config' }} ${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc gcc-c++' }} if: startsWith(matrix.image, 'fedora:') - name: Install Dependencies (FreeBSD) uses: ./.github/actions/dependencies/install/pkg with: packages: >- ${{ inputs.freebsd-build-dependencies }} ${{ inputs.freebsd-test-dependencies }} ${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake' }} ${{ matrix.compiler == 'GNU' && 'gcc' || 'llvm' }} if: github.job == 'FreeBSD' - name: Install Dependencies (macOS) uses: ./.github/actions/dependencies/install/brew with: packages: >- ${{ inputs.macos-build-dependencies }} ${{ inputs.macos-test-dependencies }} ${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake' }} ${{ matrix.compiler == 'GNU' && 'gcc' || '' }} if: github.job == 'macOS' - name: Install Dependencies (openSUSE) uses: ./.github/actions/dependencies/install/zypper with: packages: >- ${{ inputs.opensuse-build-dependencies }} ${{ inputs.opensuse-mapnik-build-dependencies }} ${{ inputs.opensuse-test-dependencies }} ${{ matrix.build_system == 'CMake' && 'cmake' || 'automake' }} ${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc12 gcc12-c++' }} if: startsWith(matrix.image, 'opensuse/') - name: Install Dependencies (Ubuntu) uses: ./.github/actions/dependencies/install/apt-get with: packages: >- ${{ inputs.ubuntu-build-dependencies }} ${{ matrix.mapnik_latest && inputs.ubuntu-mapnik-latest-build-dependencies || 'libmapnik-dev' }} ${{ inputs.ubuntu-test-dependencies }} ${{ matrix.build_system == 'CMake' && 'cmake' || '' }} ${{ matrix.compiler == 'LLVM' && 'clang' || 'g++ gcc' }} if: | startsWith(matrix.image, 'ubuntu:') || (!matrix.image && github.job != 'FreeBSD' && runner.os == 'Linux') - name: Link `gcc`/`g++` (openSUSE) run: | update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 40 update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 40 shell: bash --noprofile --norc -euxo pipefail {0} if: startsWith(matrix.image, 'opensuse/') && matrix.compiler == 'GNU' - name: Add `nobody` user/group (openSUSE) run: | useradd --home-dir / --no-create-home --shell /usr/sbin/nologin --system --user-group nobody shell: bash --noprofile --norc -euxo pipefail {0} if: startsWith(matrix.image, 'opensuse/') - name: Build & Install `mapnik` (Amazon Linux 2/CentOS 7) uses: ./.github/actions/dependencies/build-and-install/mapnik with: version: ${{ inputs.mapnik-build-version-amazonlinux2-centos7 }} if: matrix.image == 'amazonlinux:2' || matrix.image == 'centos:7' - name: Build & Install `mapnik` (CentOS Stream) uses: ./.github/actions/dependencies/build-and-install/mapnik with: version: ${{ inputs.mapnik-build-version-centos-stream }} if: startsWith(matrix.image, 'quay.io/centos/centos:stream') - name: Build & Install `mapnik` (openSUSE) uses: ./.github/actions/dependencies/build-and-install/mapnik with: version: ${{ inputs.mapnik-build-version-opensuse }} if: (!matrix.mapnik_latest && startsWith(matrix.image, 'opensuse/')) - name: Build & Install latest `mapnik` (Debian/Ubuntu) uses: ./.github/actions/dependencies/build-and-install/mapnik/latest if: | matrix.mapnik_latest && (startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:')) - name: Build & Install latest `mapnik` (openSUSE) uses: ./.github/actions/dependencies/build-and-install/mapnik/latest if: (matrix.mapnik_latest && startsWith(matrix.image, 'opensuse/')) mod_tile-0.7.1/.github/actions/dependencies/install/apt-get/000077500000000000000000000000001457537455600237755ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/install/apt-get/action.yml000066400000000000000000000010111457537455600257660ustar00rootroot00000000000000--- inputs: packages: description: List of package(s) to install required: true runs: using: composite steps: - name: Update package information run: ${{ !matrix.image && 'sudo' || '' }} apt-get --yes update shell: bash --noprofile --norc -euxo pipefail {0} - name: Install package(s) env: DEBIAN_FRONTEND: noninteractive run: ${{ !matrix.image && 'sudo' || '' }} apt-get --yes install ${{ inputs.packages }} shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/dependencies/install/brew/000077500000000000000000000000001457537455600233735ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/install/brew/action.yml000066400000000000000000000004131457537455600253710ustar00rootroot00000000000000--- inputs: packages: description: List of package(s) to install required: true runs: using: composite steps: - name: Install package(s) run: brew install ${{ inputs.packages }} || true shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/dependencies/install/pkg/000077500000000000000000000000001457537455600232155ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/install/pkg/action.yml000066400000000000000000000005761457537455600252250ustar00rootroot00000000000000--- inputs: packages: description: List of package(s) to install required: true options: default: --yes description: Option(s) to pass runs: using: composite steps: - name: Install package(s) run: ${{ !matrix.image && 'sudo' || '' }} pkg install ${{ inputs.options }} ${{ inputs.packages }} shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/dependencies/install/yum/000077500000000000000000000000001457537455600232465ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/install/yum/action.yml000066400000000000000000000037211457537455600252510ustar00rootroot00000000000000--- inputs: dependencies: description: List of package(s) to pre-install required: false groups: description: List of group(s) to install required: false packages: description: List of package(s) to install required: true runs: using: composite steps: - name: Install "dnf-command(config-manager)" (CentOS Stream) run: dnf --assumeyes --skip-broken install "dnf-command(config-manager)" shell: bash --noprofile --norc -euxo pipefail {0} if: startsWith(matrix.image, 'quay.io/centos/centos:stream') - name: Enable PowerTools repository (CentOS Stream 8) run: dnf config-manager --set-enabled powertools shell: bash --noprofile --norc -euxo pipefail {0} if: matrix.image == 'quay.io/centos/centos:stream8' - name: Enable CRB repository (CentOS Stream 9) run: dnf config-manager --set-enabled crb shell: bash --noprofile --norc -euxo pipefail {0} if: matrix.image == 'quay.io/centos/centos:stream9' - name: Enable EPEL repository (Amazon Linux 2) run: amazon-linux-extras install epel -y shell: bash --noprofile --norc -euxo pipefail {0} if: matrix.image == 'amazonlinux:2' && contains(inputs.dependencies, 'epel-release') - name: Install dependency package(s) run: | if [ -n "${{ inputs.dependencies }}" ]; then yum --assumeyes install ${{ inputs.dependencies }} fi shell: bash --noprofile --norc -euxo pipefail {0} - name: Install group(s) run: | if [ -n '${{ inputs.groups }}' ]; then yum --assumeyes groups install ${{ inputs.groups }} fi shell: bash --noprofile --norc -euxo pipefail {0} - name: Install package(s) run: | if command -v dnf5 &> /dev/null; then yum --assumeyes install ${{ inputs.packages }} else yum --assumeyes --skip-broken install ${{ inputs.packages }} fi shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/dependencies/install/zypper/000077500000000000000000000000001457537455600237655ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/dependencies/install/zypper/action.yml000066400000000000000000000004741457537455600257720ustar00rootroot00000000000000--- inputs: packages: description: List of package(s) to install required: true runs: using: composite steps: - name: Install package(s) run: ${{ !matrix.image && 'sudo' || '' }} zypper --non-interactive install ${{ inputs.packages }} shell: bash --noprofile --norc -euxo pipefail {0} mod_tile-0.7.1/.github/actions/install/000077500000000000000000000000001457537455600200065ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/install/action.yml000066400000000000000000000004531457537455600220100ustar00rootroot00000000000000--- runs: using: composite steps: - name: Install `mod_tile` (Autotools) uses: ./.github/actions/autotools/install if: matrix.build_system == 'Autotools' - name: Install `mod_tile` (CMake) uses: ./.github/actions/cmake/install if: matrix.build_system == 'CMake' mod_tile-0.7.1/.github/actions/test/000077500000000000000000000000001457537455600173175ustar00rootroot00000000000000mod_tile-0.7.1/.github/actions/test/action.yml000066400000000000000000000004371457537455600213230ustar00rootroot00000000000000--- runs: using: composite steps: - name: Test `mod_tile` (Autotools) uses: ./.github/actions/autotools/test if: matrix.build_system == 'Autotools' - name: Test `mod_tile` (CMake) uses: ./.github/actions/cmake/test if: matrix.build_system == 'CMake' mod_tile-0.7.1/.github/workflows/000077500000000000000000000000001457537455600167355ustar00rootroot00000000000000mod_tile-0.7.1/.github/workflows/build-and-test.yml000066400000000000000000000140111457537455600222710ustar00rootroot00000000000000--- name: Build & Test on: pull_request: push: jobs: Linux: name: >- ${{ matrix.image }} (${{ matrix.build_system }}) (${{ matrix.compiler }}) runs-on: ubuntu-latest strategy: matrix: image: - "centos:7" - "debian:11" - "debian:12" - "debian:testing" - "fedora:38" - "fedora:39" - "fedora:rawhide" - "opensuse/leap:15" - "ubuntu:20.04" - "ubuntu:rolling" build_system: - CMake compiler: - GNU on_default_branch: - ${{ contains(github.ref, 'master') || contains(github.ref, 'develop') || contains(github.ref, 'CI') }} include: - image: "ubuntu:22.04" build_system: Autotools compiler: GNU - image: "ubuntu:22.04" build_system: Autotools compiler: LLVM - image: "ubuntu:22.04" build_system: CMake compiler: GNU - image: "ubuntu:22.04" build_system: CMake compiler: LLVM exclude: - on_default_branch: false fail-fast: false container: env: CC: ${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc' }} CXX: ${{ matrix.compiler == 'LLVM' && 'clang++' || 'g++' }} image: ${{ matrix.image }} steps: - name: Install `git` (Amazon Linux 2) run: yum --assumeyes install git if: matrix.image == 'amazonlinux:2' - name: Install `git` (openSUSE) run: zypper --non-interactive install git if: startsWith(matrix.image, 'opensuse/') - name: Checkout code (CentOS 7) uses: actions/checkout@v3 if: matrix.image == 'centos:7' - name: Checkout code uses: actions/checkout@v4 if: matrix.image != 'centos:7' - name: Install dependencies uses: ./.github/actions/dependencies/install - name: Build `mod_tile` uses: ./.github/actions/build - name: Test `mod_tile` uses: ./.github/actions/test - name: Install `mod_tile` uses: ./.github/actions/install Linux-Latest-Mapnik: continue-on-error: true name: >- ${{ matrix.image }} (Latest Mapnik) (${{ matrix.build_system }}) (${{ matrix.compiler }}) runs-on: ubuntu-latest strategy: matrix: image: - "debian:12" - "ubuntu:22.04" build_system: - CMake compiler: - GNU mapnik_latest: - true fail-fast: false container: env: CC: ${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc' }} CXX: ${{ matrix.compiler == 'LLVM' && 'clang++' || 'g++' }} image: ${{ matrix.image }} steps: - name: Checkout code uses: actions/checkout@v4 - name: Install dependencies uses: ./.github/actions/dependencies/install - name: Build `mod_tile` uses: ./.github/actions/build - name: Test `mod_tile` uses: ./.github/actions/test - name: Install `mod_tile` uses: ./.github/actions/install macOS: env: CFLAGS: -Wno-implicit-function-declaration LDFLAGS: -undefined dynamic_lookup LIBRARY_PATH: /usr/local/lib name: >- ${{ matrix.os }} (${{ matrix.build_system }}) (${{ matrix.compiler }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: - macos-12 build_system: - CMake compiler: - LLVM on_default_branch: - ${{ contains(github.ref, 'master') || contains(github.ref, 'develop') || contains(github.ref, 'CI') }} include: - os: macos-13 build_system: Autotools compiler: LLVM - os: macos-13 build_system: CMake compiler: LLVM exclude: - on_default_branch: false steps: - name: Checkout code uses: actions/checkout@v4 - name: Install dependencies uses: ./.github/actions/dependencies/install - name: Set ICU_ROOT run: | echo "ICU_ROOT=$(brew --prefix icu4c)" >> ${GITHUB_ENV} - name: Build `mod_tile` uses: ./.github/actions/build - name: Test `mod_tile` uses: ./.github/actions/test - name: Install `mod_tile` uses: ./.github/actions/install FreeBSD: continue-on-error: true env: BUILD_PARALLEL_LEVEL: 2 LIBRARY_PATH: /usr/local/lib TMPDIR: /tmp name: >- ${{ matrix.box_generic }} (${{ matrix.build_system }}) (${{ matrix.compiler }}) runs-on: ubuntu-latest strategy: matrix: box_generic: - freebsd12 - freebsd13 build_system: - CMake compiler: - LLVM on_default_branch: - ${{ contains(github.ref, 'master') || contains(github.ref, 'develop') || contains(github.ref, 'CI') }} include: - box_generic: freebsd14 build_system: CMake compiler: LLVM exclude: - on_default_branch: false fail-fast: false steps: - name: Checkout code uses: actions/checkout@v4 - name: Provision VM uses: hummeltech/freebsd-vagrant-action@v1.4 with: box: generic/${{ matrix.box_generic }} cpus: ${{ env.BUILD_PARALLEL_LEVEL }} memory: 4096 # Mapnik is not in the `quarterly` repository (2023.10.12) - name: Use "latest" repository run: | sudo mkdir -p /usr/local/etc/pkg/repos sed 's#/quarterly#/latest#g' /etc/pkg/FreeBSD.conf | sudo tee /usr/local/etc/pkg/repos/FreeBSD.conf sudo pkg upgrade - name: Install dependencies uses: ./.github/actions/dependencies/install - name: Build `mod_tile` uses: ./.github/actions/build - name: Test `mod_tile` uses: ./.github/actions/test - name: Install `mod_tile` uses: ./.github/actions/install mod_tile-0.7.1/.github/workflows/coverage.yml000066400000000000000000000034271457537455600212610ustar00rootroot00000000000000--- name: Coverage on: pull_request: push: branches: - develop - master - "*CI" jobs: Coverage: name: Build, Test & Report Coverage runs-on: ubuntu-latest env: BUILD_TYPE: Debug CFLAGS: --coverage CXXFLAGS: --coverage steps: - name: Checkout code uses: actions/checkout@v4 - name: Install dependencies uses: ./.github/actions/dependencies/install with: ubuntu-test-dependencies: >- apache2 lcov - name: Build `mod_tile` uses: ./.github/actions/cmake/build - name: Test `mod_tile` uses: ./.github/actions/cmake/test - name: Test `mod_tile` again (to gather more coverage data) uses: ./.github/actions/cmake/test - name: Process `mod_tile` coverage results run: | ctest -T coverage lcov \ --capture \ --directory . \ --output-file coverage.info lcov \ --output-file coverage.info \ --remove coverage.info \ "${GITHUB_WORKSPACE}/includes/catch/catch.hpp" \ "${GITHUB_WORKSPACE}/src/gen_tile_test.cpp" \ "/usr/*" genhtml coverage.info --output-directory coverage working-directory: build - name: Write coverage summary to `$GITHUB_STEP_SUMMARY` run: lcov --summary build/coverage.info | sed 's/^ /* /g' >> ${GITHUB_STEP_SUMMARY} - name: Upload `mod_tile` coverage results artifact uses: actions/upload-artifact@v3 with: name: Coverage Results path: build/coverage - name: Report `mod_tile` coverage results to `codecov.io` uses: codecov/codecov-action@v3 with: files: build/coverage.info mod_tile-0.7.1/.github/workflows/docker-image-build.yml000066400000000000000000000047321457537455600231120ustar00rootroot00000000000000--- name: Docker Image Build on: pull_request: push: paths: - "docker/**" - ".github/workflows/docker-image-build.yml" jobs: docker-image-build: name: Build & Test (${{ matrix.service-name }}) runs-on: ubuntu-latest strategy: matrix: service-name: - archlinux - centos-7 - centos-stream-8 - centos-stream-9 - debian-11 - debian-12 - debian-testing - debian-testing-autotools - fedora-38 - fedora-39 - fedora-rawhide - opensuse-leap-15 - opensuse-tumbleweed - ubuntu-20.04 - ubuntu-22.04 - ubuntu-devel - ubuntu-devel-autotools fail-fast: false steps: - name: Checkout repository uses: actions/checkout@v4 - name: Build & Start run: docker compose up --build --detach ${{ matrix.service-name }} working-directory: docker - name: Test run: | until $(curl --fail --output tile.jpg.file.0 --silent http://localhost:8081/tiles/renderd-example-jpg/9/297/191.jpg); do echo 'Sleeping 5s'; sleep 5; done sha256sum --check --ignore-missing tests/tiles.sha256sum | grep tile.jpg.file.0 | grep -q OK until $(curl --fail --output tile.png256.file.0 --silent http://localhost:8081/tiles/renderd-example-png256/9/297/191.png); do echo 'Sleeping 5s'; sleep 5; done sha256sum --check --ignore-missing tests/tiles.sha256sum | grep tile.png256.file.0 | grep -q OK until $(curl --fail --output tile.png32.file.0 --silent http://localhost:8081/tiles/renderd-example-png32/9/297/191.png); do echo 'Sleeping 5s'; sleep 5; done sha256sum --check --ignore-missing tests/tiles.sha256sum | grep tile.png32.file.0 | grep -q OK until $(curl --fail --output tile.webp.file.0 --silent http://localhost:8081/tiles/renderd-example-webp/9/297/191.webp); do echo 'Sleeping 5s'; sleep 5; done sha256sum --check --ignore-missing tests/tiles.sha256sum | grep tile.webp.file.0 | grep -q OK timeout-minutes: 1 - name: Show logs run: docker compose logs working-directory: docker if: failure() - name: Stop run: docker compose down --volumes working-directory: docker if: success() || failure() mod_tile-0.7.1/.github/workflows/flawfinder-analysis.yml000066400000000000000000000013541457537455600234250ustar00rootroot00000000000000--- name: Flawfinder Analysis on: pull_request: push: branches: - develop - master schedule: - cron: "44 0 * * 4" jobs: flawfinder: name: Flawfinder runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write steps: - name: Checkout code uses: actions/checkout@v4 - name: flawfinder_scan uses: david-a-wheeler/flawfinder@2.0.19 with: arguments: "--sarif includes src" output: "flawfinder_results.sarif" - name: Upload analysis results to GitHub Security tab uses: github/codeql-action/upload-sarif@v2 with: sarif_file: ${{github.workspace}}/flawfinder_results.sarif mod_tile-0.7.1/.github/workflows/install-package-and-test.yml000066400000000000000000000046101457537455600242350ustar00rootroot00000000000000--- name: Install Package & Test on: pull_request: push: paths: - "etc/**" - "utils/**" - ".github/workflows/install-package-and-test.yml" jobs: install-package-and-test: name: ${{ matrix.image }} runs-on: ubuntu-latest strategy: matrix: image: - "debian:11" - "debian:12" - "ubuntu:22.04" fail-fast: false container: image: ${{ matrix.image }} steps: - name: Checkout code uses: actions/checkout@v4 - name: Install mod_tile & renderd uses: ./.github/actions/dependencies/install/apt-get with: packages: >- apache2 curl libapache2-mod-tile renderd - name: Prepare run: | mkdir -p /usr/share/renderd cp -av utils/example-map /usr/share/renderd/ cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf printf ' [example-map] URI=/tiles/renderd-example XML=/usr/share/renderd/example-map/mapnik.xml [example-map-jpg] TYPE=jpg image/jpeg jpeg URI=/tiles/renderd-example-jpg XML=/usr/share/renderd/example-map/mapnik.xml [example-map-png256] TYPE=png image/png png256 URI=/tiles/renderd-example-png256 XML=/usr/share/renderd/example-map/mapnik.xml [example-map-png32] TYPE=png image/png png32 URI=/tiles/renderd-example-png32 XML=/usr/share/renderd/example-map/mapnik.xml [example-map-webp] TYPE=webp image/webp webp URI=/tiles/renderd-example-webp XML=/usr/share/renderd/example-map/mapnik.xml ' | tee -a /etc/renderd.conf mkdir -p /run/renderd renderd a2enmod tile a2ensite renderd-example-map apache2ctl restart shell: bash --noprofile --norc -euxo pipefail {0} - name: Test run: | until $(curl --fail --output tile.png --silent http://localhost:8081/tiles/renderd-example/9/297/191.png); do echo 'Sleeping 5s'; sleep 5; done echo 'dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08 tile.png' | sha256sum --check shell: bash --noprofile --norc -euxo pipefail {0} timeout-minutes: 1 mod_tile-0.7.1/.github/workflows/lint.yml000066400000000000000000000054221457537455600204310ustar00rootroot00000000000000--- name: Lint on: pull_request: push: jobs: astyle: env: ASTYLE_CMD: >- astyle --break-blocks --indent-switches --indent=force-tab=8 --lineend=linux --options=none --pad-header --pad-oper --style=1tbs --suffix=none --unpad-paren includes/*.h includes/*.hpp src/*.c src/*.cpp name: Lint with `Artistic Style` runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Provision environment uses: ./.github/actions/dependencies/install/apt-get with: packages: astyle - name: Check if any modifications were made by `astyle` run: | ASTYLE_OUTPUT=$(${ASTYLE_CMD} --dry-run) if [ -n "$(echo "${ASTYLE_OUTPUT}" | grep -v "Unchanged")" ]; then echo "The following files are in need of formatting:" echo "${ASTYLE_OUTPUT}" | grep -v "Unchanged" | awk '{print "`"$2"`"}' echo "" echo "Run the following command before submitting a pull request:" echo '`'"${ASTYLE_CMD}"'`' exit 1 fi - name: Write `$ASTYLE_OUTPUT` to `$GITHUB_STEP_SUMMARY` if: failure() run: | ASTYLE_OUTPUT=$(${ASTYLE_CMD} --dry-run) echo "### The following files are in need of formatting:" >> ${GITHUB_STEP_SUMMARY} echo "${ASTYLE_OUTPUT}" | grep -v "Unchanged" | awk '{print "- `"$2"`"}' >> ${GITHUB_STEP_SUMMARY} echo "### Run the following command before submitting a pull request:" >> ${GITHUB_STEP_SUMMARY} echo -e '```shell\n'"${ASTYLE_CMD}"'\n```' >> ${GITHUB_STEP_SUMMARY} - name: Generate `ArtisticStyleFormattingFixes.patch` file if: failure() run: | ${ASTYLE_CMD} git diff --patch > ArtisticStyleFormattingFixes.patch - name: Upload `ArtisticStyleFormattingFixes.patch` file if: failure() uses: actions/upload-artifact@v3 with: name: ArtisticStyleFormattingFixes.patch path: ArtisticStyleFormattingFixes.patch cmakelint: name: Lint with `CMakeLint` runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Provision environment run: pip install --user cmakelint - name: Run linter run: | cmakelint --linelength=125 \ CMakeLists.txt \ */CMakeLists.txt \ */*.cmake prettier: name: Lint with `Prettier` runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Provision environment run: npm install prettier - name: Run linter run: | npx prettier --check . mod_tile-0.7.1/.gitignore000066400000000000000000000010351457537455600153270ustar00rootroot00000000000000.deps/ .dirstamp .libs/ *.la *.lo *.o *.slo aclocal.m4 autom4te.cache/ build !docs/build compile config.guess config.guess~ config.h config.h.in config.h.in~ config.log config.status config.sub config.sub~ configure configure~ depcomp gen_tile_test install-sh libtool ltmain.sh m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 Makefile* missing render_expired render_list render_old render_speedtest renderd renderd.sock renderd.stats stamp-h1 stderr.out # Do not ignore !Makefile.am !etc/renderd !.github/**/* mod_tile-0.7.1/AUTHORS000066400000000000000000000030221457537455600144050ustar00rootroot00000000000000Ævar Arnfjörð Bjarmason Amanda Andreas Hubel Anton Belichkov Bas Couwenberg Ben Hosmer Ben Kochie Brian Quinion Christoph Brill Dane Springmeyer David Hummel <6109326+hummeltech@users.noreply.github.com> Dirk Stöcker Eric Stadtherr Felix Delattre Frederik Ramm Ircama JaimeLynSchatz Jocelyn Jaubert Jochen Topf Jon Burgess Kai Krueger Lennard voor den Dag Manfred Stock Matt Amos Michael Fazio Michael Schmiedgen Moritz Seemann Paul Norman Peter Körner Rainer Jung Ramunas Robert Buchholz rusvdw Sean Reifschneider SomeoneElseOSM Stephan Austermühle Stephan Knauss Stephan Plepelits Tom Hughes vholten Xin Yu Zverik mod_tile-0.7.1/CMakeLists.txt000066400000000000000000000205521457537455600161040ustar00rootroot00000000000000#----------------------------------------------------------------------------- # # CMake Config # #----------------------------------------------------------------------------- cmake_minimum_required(VERSION 3.13 FATAL_ERROR) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") #----------------------------------------------------------------------------- # # Project version # #----------------------------------------------------------------------------- project(mod_tile VERSION 0.7.1) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(THREADS_PREFER_PTHREAD_FLAG ON) set(ENABLE_MAN ON CACHE BOOL "Build man pages") set(ENABLE_TESTS OFF CACHE BOOL "Build test suite") set(CMAKE_INSTALL_MODULESDIR CACHE PATH "Apache HTTP Server module installation directory") #----------------------------------------------------------------------------- # # Find external dependencies # #----------------------------------------------------------------------------- include(GNUInstallDirs) # Packages find_package(CURL) find_package(ICU REQUIRED uc) find_package(Threads REQUIRED) find_package(APR REQUIRED) find_package(CAIRO REQUIRED) find_package(GLIB REQUIRED) find_package(HTTPD REQUIRED) find_package(INIPARSER REQUIRED) find_package(LIBMAPNIK REQUIRED) find_package(LIBMEMCACHED) find_package(LIBRADOS) if(LIBMAPNIK_VERSION STRGREATER_EQUAL "4") set(CMAKE_CXX_STANDARD 14) endif() # Programs find_program(APXS_EXECUTABLE apxs REQUIRED) # Functions include(CheckFunctionExists) # check_function_exists(bzero HAVE_BZERO) check_function_exists(daemon HAVE_DAEMON) # check_function_exists(gethostbyname HAVE_GETHOSTBYNAME) check_function_exists(getloadavg HAVE_GETLOADAVG) # check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) # check_function_exists(inet_ntoa HAVE_INET_NTOA) # check_function_exists(memset HAVE_MEMSET) # check_function_exists(mkdir HAVE_MKDIR) # check_function_exists(pow HAVE_POW) # check_function_exists(select HAVE_SELECT) # check_function_exists(socket HAVE_SOCKET) # check_function_exists(strchr HAVE_STRCHR) # check_function_exists(strdup HAVE_STRDUP) # check_function_exists(strerror HAVE_STRERROR) # check_function_exists(strrchr HAVE_STRRCHR) # check_function_exists(strstr HAVE_STRSTR) # check_function_exists(strtol HAVE_STRTOL) # check_function_exists(strtoul HAVE_STRTOUL) # check_function_exists(utime HAVE_UTIME) # Include files include(CheckIncludeFile) # check_include_file(arpa/inet.h HAVE_ARPA_INET_H) # check_include_file(fcntl.h HAVE_FCNTL_H) # check_include_file(limits.h HAVE_LIMITS_H) # check_include_file(netdb.h HAVE_NETDB_H) # check_include_file(netinet/in.h HAVE_NETINET_IN_H) check_include_file(paths.h HAVE_PATHS_H) # check_include_file(stdint.h HAVE_STDINT_H) # check_include_file(stdlib.h HAVE_STDLIB_H) # check_include_file(string.h HAVE_STRING_H) check_include_file(sys/cdefs.h HAVE_SYS_CDEFS_H) check_include_file(sys/loadavg.h HAVE_SYS_LOADAVG_H) # check_include_file(sys/socket.h HAVE_SYS_SOCKET_H) # check_include_file(sys/time.h HAVE_SYS_TIME_H) # check_include_file(syslog.h HAVE_SYSLOG_H) # check_include_file(unistd.h HAVE_UNISTD_H) # check_include_file(utime.h HAVE_UTIME_H) #----------------------------------------------------------------------------- # # Set variables # #----------------------------------------------------------------------------- execute_process(COMMAND ${APXS_EXECUTABLE} -q libexecdir OUTPUT_VARIABLE HTTPD_LIBEXECDIR OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process(COMMAND ${APXS_EXECUTABLE} -q sysconfdir OUTPUT_VARIABLE HTTPD_SYSCONFDIR OUTPUT_STRIP_TRAILING_WHITESPACE ) if(LIBMAPNIK_VERSION STRLESS "4") find_program(MAPNIK_CONFIG_EXECUTABLE NAMES mapnik-config REQUIRED) execute_process(COMMAND ${MAPNIK_CONFIG_EXECUTABLE} --fonts OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE MAPNIK_FONTS_DIR ) execute_process(COMMAND ${MAPNIK_CONFIG_EXECUTABLE} --input-plugins OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE MAPNIK_PLUGINS_DIR ) elseif(LIBMAPNIK_VERSION STRGREATER_EQUAL "4") pkg_get_variable(MAPNIK_FONTS_DIR libmapnik fonts_dir) pkg_get_variable(MAPNIK_PLUGINS_DIR libmapnik plugins_dir) endif() if(NOT CMAKE_INSTALL_MODULESDIR) set(CMAKE_INSTALL_MODULESDIR ${HTTPD_LIBEXECDIR}) endif() if(CAIRO_FOUND) set(HAVE_CAIRO 1) endif() if(CURL_FOUND) set(HAVE_LIBCURL 1) endif() if(LIBMEMCACHED_FOUND) set(HAVE_LIBMEMCACHED 1) endif() if(LIBRADOS_FOUND) set(HAVE_LIBRADOS 1) endif() if(CMAKE_HAVE_PTHREAD_H) set(HAVE_PTHREAD 1) endif() set(MAPNIK_FONTS_DIR "${MAPNIK_FONTS_DIR}") set(MAPNIK_FONTS_DIR_RECURSE 0) set(MAPNIK_PLUGINS_DIR "${MAPNIK_PLUGINS_DIR}") set(RENDERD_CONFIG "${CMAKE_INSTALL_SYSCONFDIR}/renderd.conf") set(RENDERD_RUN_DIR "${CMAKE_INSTALL_RUNSTATEDIR}/renderd") set(RENDERD_TILE_DIR "${CMAKE_INSTALL_LOCALSTATEDIR}/cache/renderd/tiles") set(RENDERD_PIDFILE "${RENDERD_RUN_DIR}/renderd.pid") set(RENDERD_SOCKET "${RENDERD_RUN_DIR}/renderd.sock") set(TILE_LOAD_DIRECTORY "${HTTPD_SYSCONFDIR}") set(TILE_LOAD_FILENAME "tile.load") set(VERSION "${PROJECT_VERSION}") #----------------------------------------------------------------------------- # # Configure # #----------------------------------------------------------------------------- # include/config.h.in configure_file( ${PROJECT_SOURCE_DIR}/includes/config.h.in ${PROJECT_SOURCE_DIR}/includes/config.h ) # etc/apache2/tile.load.in configure_file( ${PROJECT_SOURCE_DIR}/etc/apache2/tile.load.in ${PROJECT_BINARY_DIR}/tile.load ) # etc/renderd/renderd.conf.in configure_file( ${PROJECT_SOURCE_DIR}/etc/renderd/renderd.conf.in ${PROJECT_BINARY_DIR}/renderd.conf ) #----------------------------------------------------------------------------- # # Build # #----------------------------------------------------------------------------- add_subdirectory(src) #----------------------------------------------------------------------------- # # Install # #----------------------------------------------------------------------------- # Determine install destination for 'etc/apache2/tile.load.in' if(EXISTS "/etc/os-release") execute_process(COMMAND sh -c ". /etc/os-release && echo $ID" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE DISTRO_ID ) message(STATUS "Found ID='${DISTRO_ID}' in '/etc/os-release'") if(DISTRO_ID MATCHES "arch") set(TILE_LOAD_DIRECTORY "${HTTPD_SYSCONFDIR}/extra") set(TILE_LOAD_FILENAME "httpd-tile.conf") elseif(DISTRO_ID MATCHES "centos|fedora|rhel") set(TILE_LOAD_DIRECTORY "${HTTPD_SYSCONFDIR}.modules.d") set(TILE_LOAD_FILENAME "11-tile.conf") elseif(DISTRO_ID MATCHES "debian|ubuntu") set(TILE_LOAD_DIRECTORY "${HTTPD_SYSCONFDIR}/mods-available") elseif(DISTRO_ID MATCHES "freebsd") set(TILE_LOAD_DIRECTORY "${HTTPD_SYSCONFDIR}/modules.d") set(TILE_LOAD_FILENAME "080_tile.conf") elseif(DISTRO_ID MATCHES "opensuse-leap|opensuse-tumbleweed") set(TILE_LOAD_DIRECTORY "${HTTPD_SYSCONFDIR}/conf.d") set(TILE_LOAD_FILENAME "mod_tile.conf") endif() elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(TILE_LOAD_DIRECTORY "${HTTPD_SYSCONFDIR}/extra") set(TILE_LOAD_FILENAME "httpd-tile.conf") endif() message(STATUS "File 'etc/apache2/tile.load.in' will be installed to '${TILE_LOAD_DIRECTORY}/${TILE_LOAD_FILENAME}'") # Directories install( DIRECTORY DESTINATION ${RENDERD_TILE_DIR} ) install( DIRECTORY DESTINATION ${RENDERD_RUN_DIR} ) # Configuration files install( FILES ${PROJECT_BINARY_DIR}/tile.load DESTINATION ${TILE_LOAD_DIRECTORY} RENAME ${TILE_LOAD_FILENAME} ) install( FILES ${PROJECT_BINARY_DIR}/renderd.conf DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} ) # Targets install( TARGETS mod_tile render_expired render_list render_old render_speedtest renderd LIBRARY DESTINATION ${CMAKE_INSTALL_MODULESDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) # Man files if(ENABLE_MAN) install( FILES docs/man/render_expired.1 docs/man/render_list.1 docs/man/render_old.1 docs/man/render_speedtest.1 docs/man/renderd.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) install( FILES docs/man/renderd.conf.5 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5 ) endif() #----------------------------------------------------------------------------- # # Test # #----------------------------------------------------------------------------- if(ENABLE_TESTS) enable_testing() add_subdirectory(tests) endif() mod_tile-0.7.1/COPYING000066400000000000000000000432541457537455600144030ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. mod_tile-0.7.1/Makefile.am000066400000000000000000000073121457537455600153770ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = $(PTHREAD_CFLAGS) $(GLIB_CFLAGS) STORE_SOURCES = \ src/store.c \ src/store_file.c \ src/store_file_utils.c \ src/store_memcached.c \ src/store_rados.c \ src/store_ro_http_proxy.c \ src/store_ro_composite.c \ src/store_null.c \ src/g_logger.c STORE_LDFLAGS = $(LIBMEMCACHED_LDFLAGS) $(LIBRADOS_LDFLAGS) $(LIBCURL) $(GLIB_LIBS) STORE_CPPFLAGS = bin_PROGRAMS = \ renderd \ render_expired \ render_list \ render_speedtest \ render_old noinst_PROGRAMS = gen_tile_test man_MANS = \ docs/man/renderd.1 \ docs/man/renderd.conf.5 \ docs/man/render_expired.1 \ docs/man/render_list.1 \ docs/man/render_old.1 \ docs/man/render_speedtest.1 renderddir = $(sysconfdir) renderd_SOURCES = \ src/daemon.c \ src/daemon_compat.c \ src/gen_tile.cpp \ src/sys_utils.c \ src/request_queue.c \ src/cache_expire.c \ src/metatile.cpp \ src/parameterize_style.cpp \ src/protocol_helper.c \ $(STORE_SOURCES) renderd_CXXFLAGS = $(MAPNIK_CFLAGS) renderd_LDADD = $(PTHREAD_CFLAGS) $(MAPNIK_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS) renderd_DATA = etc/renderd/renderd.conf render_speedtest_SOURCES = \ src/speedtest.cpp \ src/protocol_helper.c \ src/render_submit_queue.c \ src/sys_utils.c \ src/g_logger.c render_speedtest_LDADD = $(PTHREAD_CFLAGS) $(GLIB_LIBS) render_list_SOURCES = \ src/render_list.c \ src/sys_utils.c \ src/protocol_helper.c \ src/render_submit_queue.c \ $(STORE_SOURCES) render_list_LDADD = $(PTHREAD_CFLAGS) $(STORE_LDFLAGS) render_expired_SOURCES = \ src/render_expired.c \ src/protocol_helper.c \ src/render_submit_queue.c \ src/sys_utils.c \ $(STORE_SOURCES) render_expired_LDADD = $(PTHREAD_CFLAGS) $(STORE_LDFLAGS) render_old_SOURCES = \ src/store_file_utils.c \ src/render_old.c \ src/sys_utils.c \ src/protocol_helper.c \ src/render_submit_queue.c \ src/g_logger.c render_old_LDADD = $(PTHREAD_CFLAGS) $(GLIB_LIBS) #convert_meta_SOURCES = src/dir_utils.c src/store.c src/convert_meta.c gen_tile_test_SOURCES = \ src/gen_tile_test.cpp \ src/metatile.cpp \ src/request_queue.c \ src/protocol_helper.c \ src/daemon.c \ src/daemon_compat.c \ src/gen_tile.cpp \ src/sys_utils.c \ src/cache_expire.c \ src/parameterize_style.cpp \ $(STORE_SOURCES) gen_tile_test_CFLAGS = -DMAIN_ALREADY_DEFINED $(PTHREAD_CFLAGS) $(GLIB_CFLAGS) gen_tile_test_CXXFLAGS = $(MAPNIK_CFLAGS) gen_tile_test_LDADD = $(PTHREAD_CFLAGS) $(MAPNIK_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS) CLEANFILES=*.slo mod_tile.la stderr.out src/*.slo src/*.lo src/.libs/* src/*.la COMMA=, test: gen_tile_test ./gen_tile_test all-local: $(APXS) -c $(DEF_LDLIBS) $(AM_CFLAGS) \ $(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \ -I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \ @srcdir@/src/mod_tile.c \ @srcdir@/src/sys_utils.c \ @srcdir@/src/store.c \ @srcdir@/src/store_file.c \ @srcdir@/src/store_file_utils.c \ @srcdir@/src/store_memcached.c \ @srcdir@/src/store_rados.c \ @srcdir@/src/store_ro_http_proxy.c \ @srcdir@/src/store_ro_composite.c \ @srcdir@/src/store_null.c \ @srcdir@/src/g_logger.c install-mod_tile: mkdir -p $(DESTDIR)`$(APXS) -q LIBEXECDIR` $(APXS) -S LIBEXECDIR=$(DESTDIR)`$(APXS) \ -q LIBEXECDIR` -c -i $(DEF_LDLIBS) $(AM_CFLAGS) \ $(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \ -I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \ @srcdir@/src/mod_tile.c \ @srcdir@/src/sys_utils.c \ @srcdir@/src/store.c \ @srcdir@/src/store_file.c \ @srcdir@/src/store_file_utils.c \ @srcdir@/src/store_memcached.c \ @srcdir@/src/store_rados.c \ @srcdir@/src/store_ro_http_proxy.c \ @srcdir@/src/store_ro_composite.c \ @srcdir@/src/store_null.c \ @srcdir@/src/g_logger.c mod_tile-0.7.1/README.rst000066400000000000000000000220521457537455600150300ustar00rootroot00000000000000==================== mod_tile and renderd ==================== This software contains two main pieces: 1) ``mod_tile``: An Apache 2 module to deliver map tiles. 2) ``renderd``: A daemon that renders map tiles using mapnik. .. figure:: ./screenshot.jpg :alt: Image showing example slippy map and OSM layer Together they efficiently render and serve raster map tiles for example to use within a slippy map. The two consist of the classic raster tile stack from `OpenStreetMap.org `__. As an alternative to ``renderd`` its drop-in replacement `Tirex `__ can be used in combination with ``mod_tile``. Dependencies ------------ * `Supported Operating Systems` * `GNU/Linux` (works best on Debian or Ubuntu) * `FreeBSD` * `macOS` * `Supported Build Systems` * `GNU Autotools `__ * `CMake `__ * `Runtime/Build Dependencies` * `Apache 2 HTTP webserver `__ * `Mapnik `__ * `Cairo 2D graphics library `__ * `Curl library (SSL variant) `__ * `Iniparser library `__ * `GLib library `__ * `Memcached library (optional) `__ * `RADOS library (optional) `__ Installation ------------ Starting from the following operation systems and their versions: * Debian 11 (Bullseye) * Ubuntu 21.04 (Hirsute Hippo) the software and all dependencies can be installed simply with: :: $ apt install libapache2-mod-tile renderd These packages for **Debian** and **Ubuntu** are being maintained by the `Debian GIS Team `__ in the respective `repository `__. Compilation ----------- You may want to compile this software yourself. Either for developing on it or when using it on an operating system this is not being packaged for. We prepared instructions for you on how to build the software on the following distributions: * `CentOS `__ * `CentOS Stream `__ * `Debian `__ * `Fedora `__ * `FreeBSD `__ * `macOS `__ * `openSUSE `__ * `Ubuntu `__ Configuration ------------- After you either installed the software packages or compiled the software yourself, you can continue with the configuration. For your convenience example configuration files are distributed with the software packages and located in the ``etc`` directory of this repository. A very basic example-map and data can be found in the ``utils/example-map`` directory. For a simple test copy it over to ``/usr/share/renderd/example-map``: :: $ sudo mkdir -p /usr/share/renderd $ sudo cp -av utils/example-map /usr/share/renderd/ Copy the apache configuration file to its place, too: :: $ sudo cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf Add map configurations for example-map to ``/etc/renderd.conf``: :: $ printf ' [example-map] URI=/tiles/renderd-example XML=/usr/share/renderd/example-map/mapnik.xml [example-map-jpg] TYPE=jpg image/jpeg jpeg URI=/tiles/renderd-example-jpg XML=/usr/share/renderd/example-map/mapnik.xml [example-map-png256] TYPE=png image/png png256 URI=/tiles/renderd-example-png256 XML=/usr/share/renderd/example-map/mapnik.xml [example-map-png32] TYPE=png image/png png32 URI=/tiles/renderd-example-png32 XML=/usr/share/renderd/example-map/mapnik.xml [example-map-webp] TYPE=webp image/webp webp URI=/tiles/renderd-example-webp XML=/usr/share/renderd/example-map/mapnik.xml ' | sudo tee -a /etc/renderd.conf Ensure the ``/run/renderd`` directory exists: :: $ sudo mkdir -p /run/renderd Start the rendering daemon: :: $ sudo renderd Enable the apache module and site: :: $ sudo a2enmod tile $ sudo a2ensite renderd-example-map Restart apache: :: $ sudo apache2ctl restart Now visit the renderd example map in your browser, e.g.: :: http://localhost/renderd-example-map Or try loading a single tile, e.g: :: http://localhost:8081/tiles/renderd-example/0/0/0.png *Note: the above commands and paths may differ based on your OS/distribution.* You may edit ``/etc/renderd.conf`` to indicate the location of different mapnik style sheets (up to ten) and the endpoints you wish to use to access it. It is recommended to checkout `switch2osm `__ for nice tutorials on how to set up a full tile server like on `OpenStreetMap.org `__, using this software together with a `PostgreSQL `__ database and data from OpenStreetMap. Details about ``renderd``: Tile rendering ----------------------------------------- The rendering is implemented in a multithreaded process called ``renderd`` which opens either a unix or tcp socket and listens for requests to render tiles. It uses Mapnik to render tiles using the rendering rules defined in the configuration file ``/etc/renderd.conf``. Its configuration also allows to specify the number of rendering threads. The render daemon implements a queuing mechanism with multiple priority levels to provide an as up-to-date viewing experience given the available rendering resources. The highest priority is for on the fly rendering of tiles not yet in the tile cache, two priority levels for re-rendering out of date tiles on the fly and two background batch rendering queues. The on the fly rendering queues are limited to a short 32 metatile size to minimize latency. The size of the main background queue is determined at compile time, see: ``render_config.h`` Details about ``mod_tile``: Tile serving ---------------------------------------- An Apache module called ``mod_tile`` enhances the regular Apache file serving mechanisms to provide: 1) When tiles have expired it requests the rendering daemon to render (or re-render) the tile. 2) Remapping of the file path to the hashed layout. 3) Prioritizes rendering requests depending on the available resources on the server and how out of date they are. 4) Use tile storage other than a plain posix file system. e.g it can store tiles in a ceph object store, or proxy them from another tile server. 5) Tile expiry. It estimates when the tile is next likely to be rendered and adds the appropriate HTTP cache expiry headers. This is a configurable heuristic. To avoid problems with directories becoming too large and to avoid too many tiny files. They store the rendered tiles in "meta tiles" in a special hashed directory structure. These combine 8x8 actual tiles into a single metatile file. This is a more efficient use of disk space and inodes. The metatiles are then stored in the following directory structure: ``/[base_dir]/[TileSetName]/[Z]/[xxxxyyyy]/[xxxxyyyy]/[xxxxyyyy]/[xxxxyyyy]/[xxxxyyyy].meta`` Where ``base_dir`` is a configurable base path for all tiles. ``TileSetName`` is the name of the style sheet rendered. ``Z`` is the zoom level. ``[xxxxyyyy]`` is an 8 bit number, with the first 4 bits taken from the x coordinate and the second 4 bits taken from the y coordinate. This attempts to cluster 16x16 square of tiles together into a single sub directory for more efficient access patterns. Apache serves the files as if they were present under ``/[TileSetName]/Z/X/Y.png`` with the path being converted automatically. Notes about performance ----------------------- ``mod_tile`` is designed for high performance tile serving. If the underlying disk system allows it, it can easily provide > 10k tiles/s on a single serve. Rendering performance is mostly dependent on mapnik and postgis performance, however ``renderd`` tries to make sure it uses underlying hardware as efficiently as possible and scales well on multi core systems. ``renderd`` also provides built-in features to scale to multi server rendering set-ups. Copyright and copyleft ---------------------- Copyright (c) 2007 - 2023 by mod_tile contributors (see `AUTHORS <./AUTHORS>`__) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. See the `COPYING <./COPYING>`__ for the full license text. mod_tile-0.7.1/autogen.sh000077500000000000000000000000311457537455600153330ustar00rootroot00000000000000#!/bin/sh autoreconf -vfimod_tile-0.7.1/cmake/000077500000000000000000000000001457537455600144205ustar00rootroot00000000000000mod_tile-0.7.1/cmake/FindAPR.cmake000066400000000000000000000023321457537455600166450ustar00rootroot00000000000000# - Find APR # Find the APR includes and libraries. # This module defines: # APR_FOUND # APR_INCLUDE_DIRS # APR_LIBRARIES find_package(PkgConfig QUIET) pkg_check_modules(APR QUIET apr-1) find_path(APR_INCLUDE_DIR NAMES apr.h PATHS ${APR_INCLUDE_DIRS} PATH_SUFFIXES apr-1 ) if((NOT APR_INCLUDE_DIRS) AND (APR_INCLUDE_DIR)) set(APR_INCLUDE_DIRS ${APR_INCLUDE_DIR}) elseif(APR_INCLUDE_DIRS AND APR_INCLUDE_DIR) list(APPEND APR_INCLUDE_DIRS ${APR_INCLUDE_DIR}) endif() find_library(APR_LIBRARY NAMES ${APR_LIBRARIES} apr-1 ) if((NOT APR_LIBRARIES) AND (APR_LIBRARY)) set(APR_LIBRARIES ${APR_LIBRARY}) elseif(APR_LIBRARIES AND APR_LIBRARY) list(APPEND APR_LIBRARIES ${APR_LIBRARY}) endif() message(VERBOSE "APR_INCLUDE_DIRS=${APR_INCLUDE_DIRS}") message(VERBOSE "APR_INCLUDE_DIR=${APR_INCLUDE_DIR}") message(VERBOSE "APR_LIBRARIES=${APR_LIBRARIES}") message(VERBOSE "APR_LIBRARY=${APR_LIBRARY}") if((NOT APR_FOUND) AND (APR_INCLUDE_DIRS) AND (APR_LIBRARIES)) set(APR_FOUND True) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(APR FOUND_VAR APR_FOUND REQUIRED_VARS APR_FOUND APR_INCLUDE_DIRS APR_LIBRARIES VERSION_VAR APR_VERSION ) mark_as_advanced(APR_INCLUDE_DIR APR_LIBRARY) mod_tile-0.7.1/cmake/FindCAIRO.cmake000066400000000000000000000024701457537455600170630ustar00rootroot00000000000000# - Find CAIRO # Find the CAIRO includes and libraries. # This module defines: # CAIRO_FOUND # CAIRO_INCLUDE_DIRS # CAIRO_LIBRARIES find_package(PkgConfig QUIET) pkg_check_modules(CAIRO QUIET cairo) find_path(CAIRO_INCLUDE_DIR NAMES cairo.h PATHS ${CAIRO_INCLUDE_DIRS} PATH_SUFFIXES cairo ) if((NOT CAIRO_INCLUDE_DIRS) AND (CAIRO_INCLUDE_DIR)) set(CAIRO_INCLUDE_DIRS ${CAIRO_INCLUDE_DIR}) elseif(CAIRO_INCLUDE_DIRS AND CAIRO_INCLUDE_DIR) list(APPEND CAIRO_INCLUDE_DIRS ${CAIRO_INCLUDE_DIR}) endif() find_library(CAIRO_LIBRARY NAMES ${CAIRO_LIBRARIES} cairo ) if((NOT CAIRO_LIBRARIES) AND (CAIRO_LIBRARY)) set(CAIRO_LIBRARIES ${CAIRO_LIBRARY}) elseif(CAIRO_LIBRARIES AND CAIRO_LIBRARY) list(APPEND CAIRO_LIBRARIES ${CAIRO_LIBRARY}) endif() message(VERBOSE "CAIRO_INCLUDE_DIRS=${CAIRO_INCLUDE_DIRS}") message(VERBOSE "CAIRO_INCLUDE_DIR=${CAIRO_INCLUDE_DIR}") message(VERBOSE "CAIRO_LIBRARIES=${CAIRO_LIBRARIES}") message(VERBOSE "CAIRO_LIBRARY=${CAIRO_LIBRARY}") if((NOT CAIRO_FOUND) AND (CAIRO_INCLUDE_DIRS) AND (CAIRO_LIBRARIES)) set(CAIRO_FOUND True) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CAIRO FOUND_VAR CAIRO_FOUND REQUIRED_VARS CAIRO_FOUND CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES VERSION_VAR CAIRO_VERSION ) mark_as_advanced(CAIRO_INCLUDE_DIR CAIRO_LIBRARY) mod_tile-0.7.1/cmake/FindGLIB.cmake000066400000000000000000000024221457537455600167400ustar00rootroot00000000000000# - Find GLIB # Find the GLIB includes and libraries. # This module defines: # GLIB_FOUND # GLIB_INCLUDE_DIRS # GLIB_LIBRARIES find_package(PkgConfig QUIET) pkg_check_modules(GLIB QUIET glib-2.0) find_path(GLIB_INCLUDE_DIR NAMES glib.h PATHS ${GLIB_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0 ) if((NOT GLIB_INCLUDE_DIRS) AND (GLIB_INCLUDE_DIR)) set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR}) elseif(GLIB_INCLUDE_DIRS AND GLIB_INCLUDE_DIR) list(APPEND GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR}) endif() find_library(GLIB_LIBRARY NAMES ${GLIB_LIBRARIES} glib-2.0 ) if((NOT GLIB_LIBRARIES) AND (GLIB_LIBRARY)) set(GLIB_LIBRARIES ${GLIB_LIBRARY}) elseif(GLIB_LIBRARIES AND GLIB_LIBRARY) list(APPEND GLIB_LIBRARIES ${GLIB_LIBRARY}) endif() message(VERBOSE "GLIB_INCLUDE_DIRS=${GLIB_INCLUDE_DIRS}") message(VERBOSE "GLIB_INCLUDE_DIR=${GLIB_INCLUDE_DIR}") message(VERBOSE "GLIB_LIBRARIES=${GLIB_LIBRARIES}") message(VERBOSE "GLIB_LIBRARY=${GLIB_LIBRARY}") if((NOT GLIB_FOUND) AND (GLIB_INCLUDE_DIRS) AND (GLIB_LIBRARIES)) set(GLIB_FOUND True) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLIB FOUND_VAR GLIB_FOUND REQUIRED_VARS GLIB_FOUND GLIB_INCLUDE_DIRS GLIB_LIBRARIES VERSION_VAR GLIB_VERSION ) mark_as_advanced(GLIB_INCLUDE_DIR GLIB_LIBRARY) mod_tile-0.7.1/cmake/FindHTTPD.cmake000066400000000000000000000030551457537455600171110ustar00rootroot00000000000000# - Find HTTPD # Find the HTTPD includes and libraries. # This module defines: # HTTPD_FOUND # HTTPD_INCLUDE_DIRS find_package(PkgConfig QUIET) pkg_check_modules(HTTPD QUIET httpd) find_path(HTTPD_INCLUDE_DIR NAMES httpd.h PATHS ${HTTPD_INCLUDE_DIRS} PATH_SUFFIXES apache2 apache24 httpd ) if((NOT HTTPD_INCLUDE_DIRS) AND (HTTPD_INCLUDE_DIR)) set(HTTPD_INCLUDE_DIRS ${HTTPD_INCLUDE_DIR}) elseif(HTTPD_INCLUDE_DIRS AND HTTPD_INCLUDE_DIR) list(APPEND HTTPD_INCLUDE_DIRS ${HTTPD_INCLUDE_DIR}) endif() message(VERBOSE "HTTPD_INCLUDE_DIRS=${HTTPD_INCLUDE_DIRS}") message(VERBOSE "HTTPD_INCLUDE_DIR=${HTTPD_INCLUDE_DIR}") if((NOT HTTPD_FOUND) AND (HTTPD_INCLUDE_DIRS)) set(HTTPD_FOUND True) endif() if((NOT HTTPD_VERSION) AND (HTTPD_FOUND)) file(STRINGS "${HTTPD_INCLUDE_DIR}/ap_release.h" _contents REGEX "#define AP_SERVER_[A-Z]+_NUMBER[ \t]+") if(_contents) string(REGEX REPLACE ".*#define AP_SERVER_MAJORVERSION_NUMBER[ \t]+([0-9]+).*" "\\1" HTTPD_MAJOR_VERSION "${_contents}") string(REGEX REPLACE ".*#define AP_SERVER_MINORVERSION_NUMBER[ \t]+([0-9]+).*" "\\1" HTTPD_MINOR_VERSION "${_contents}") string(REGEX REPLACE ".*#define AP_SERVER_PATCHLEVEL_NUMBER[ \t]+([0-9]+).*" "\\1" HTTPD_PATCH_VERSION "${_contents}") set(HTTPD_VERSION ${HTTPD_MAJOR_VERSION}.${HTTPD_MINOR_VERSION}.${HTTPD_PATCH_VERSION}) endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(HTTPD FOUND_VAR HTTPD_FOUND REQUIRED_VARS HTTPD_FOUND HTTPD_INCLUDE_DIRS VERSION_VAR HTTPD_VERSION ) mark_as_advanced(HTTPD_INCLUDE_DIR) mod_tile-0.7.1/cmake/FindINIPARSER.cmake000066400000000000000000000027401457537455600175620ustar00rootroot00000000000000# - Find INIPARSER # Find the INIPARSER includes and libraries. # This module defines: # INIPARSER_FOUND # INIPARSER_INCLUDE_DIRS # INIPARSER_LIBRARIES find_package(PkgConfig QUIET) pkg_check_modules(INIPARSER QUIET iniparser) find_path(INIPARSER_INCLUDE_DIR NAMES iniparser.h PATHS ${INIPARSER_INCLUDE_DIRS} PATH_SUFFIXES iniparser ) if((NOT INIPARSER_INCLUDE_DIRS) AND (INIPARSER_INCLUDE_DIR)) set(INIPARSER_INCLUDE_DIRS ${INIPARSER_INCLUDE_DIR}) elseif(INIPARSER_INCLUDE_DIRS AND INIPARSER_INCLUDE_DIR) list(APPEND INIPARSER_INCLUDE_DIRS ${INIPARSER_INCLUDE_DIR}) endif() find_library(INIPARSER_LIBRARY NAMES ${INIPARSER_LIBRARIES} iniparser ) if((NOT INIPARSER_LIBRARIES) AND (INIPARSER_LIBRARY)) set(INIPARSER_LIBRARIES ${INIPARSER_LIBRARY}) elseif(INIPARSER_LIBRARIES AND INIPARSER_LIBRARY) list(APPEND INIPARSER_LIBRARIES ${INIPARSER_LIBRARY}) endif() message(VERBOSE "INIPARSER_INCLUDE_DIRS=${INIPARSER_INCLUDE_DIRS}") message(VERBOSE "INIPARSER_INCLUDE_DIR=${INIPARSER_INCLUDE_DIR}") message(VERBOSE "INIPARSER_LIBRARIES=${INIPARSER_LIBRARIES}") message(VERBOSE "INIPARSER_LIBRARY=${INIPARSER_LIBRARY}") if((NOT INIPARSER_FOUND) AND (INIPARSER_INCLUDE_DIRS) AND (INIPARSER_LIBRARIES)) set(INIPARSER_FOUND True) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(INIPARSER FOUND_VAR INIPARSER_FOUND REQUIRED_VARS INIPARSER_FOUND INIPARSER_INCLUDE_DIRS INIPARSER_LIBRARIES ) mark_as_advanced(INIPARSER_INCLUDE_DIR INIPARSER_LIBRARY) mod_tile-0.7.1/cmake/FindLIBMAPNIK.cmake000066400000000000000000000042211457537455600175300ustar00rootroot00000000000000# - Find LIBMAPNIK # Find the LIBMAPNIK includes and libraries. # This module defines: # LIBMAPNIK_FOUND # LIBMAPNIK_INCLUDE_DIRS # LIBMAPNIK_LIBRARIES find_package(PkgConfig QUIET) pkg_check_modules(LIBMAPNIK QUIET libmapnik) find_path(LIBMAPNIK_INCLUDE_DIR NAMES version.hpp PATHS ${LIBMAPNIK_INCLUDE_DIRS} PATH_SUFFIXES mapnik ) if((NOT LIBMAPNIK_INCLUDE_DIRS) AND (LIBMAPNIK_INCLUDE_DIR)) set(LIBMAPNIK_INCLUDE_DIRS ${LIBMAPNIK_INCLUDE_DIR}) elseif(LIBMAPNIK_INCLUDE_DIRS AND LIBMAPNIK_INCLUDE_DIR) list(APPEND LIBMAPNIK_INCLUDE_DIRS ${LIBMAPNIK_INCLUDE_DIR}) endif() find_library(LIBMAPNIK_LIBRARY NAMES ${LIBMAPNIK_LIBRARIES} mapnik ) if((NOT LIBMAPNIK_LIBRARIES) AND (LIBMAPNIK_LIBRARY)) set(LIBMAPNIK_LIBRARIES ${LIBMAPNIK_LIBRARY}) elseif(LIBMAPNIK_LIBRARIES AND LIBMAPNIK_LIBRARY) list(APPEND LIBMAPNIK_LIBRARIES ${LIBMAPNIK_LIBRARY}) endif() message(VERBOSE "LIBMAPNIK_INCLUDE_DIRS=${LIBMAPNIK_INCLUDE_DIRS}") message(VERBOSE "LIBMAPNIK_INCLUDE_DIR=${LIBMAPNIK_INCLUDE_DIR}") message(VERBOSE "LIBMAPNIK_LIBRARIES=${LIBMAPNIK_LIBRARIES}") message(VERBOSE "LIBMAPNIK_LIBRARY=${LIBMAPNIK_LIBRARY}") if((NOT LIBMAPNIK_FOUND) AND (LIBMAPNIK_INCLUDE_DIRS) AND (LIBMAPNIK_LIBRARIES)) set(LIBMAPNIK_FOUND True) endif() if((NOT LIBMAPNIK_VERSION) AND (LIBMAPNIK_FOUND)) file(STRINGS "${LIBMAPNIK_INCLUDE_DIR}/version.hpp" _contents REGEX "#define MAPNIK_[A-Z]+_VERSION[ \t]+") if(_contents) string(REGEX REPLACE ".*#define MAPNIK_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" LIBMAPNIK_MAJOR_VERSION "${_contents}") string(REGEX REPLACE ".*#define MAPNIK_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" LIBMAPNIK_MINOR_VERSION "${_contents}") string(REGEX REPLACE ".*#define MAPNIK_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" LIBMAPNIK_PATCH_VERSION "${_contents}") set(LIBMAPNIK_VERSION ${LIBMAPNIK_MAJOR_VERSION}.${LIBMAPNIK_MINOR_VERSION}.${LIBMAPNIK_PATCH_VERSION}) endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBMAPNIK FOUND_VAR LIBMAPNIK_FOUND REQUIRED_VARS LIBMAPNIK_FOUND LIBMAPNIK_INCLUDE_DIRS LIBMAPNIK_LIBRARIES VERSION_VAR LIBMAPNIK_VERSION ) mark_as_advanced(LIBMAPNIK_INCLUDE_DIR LIBMAPNIK_LIBRARY) mod_tile-0.7.1/cmake/FindLIBMEMCACHED.cmake000066400000000000000000000032201457537455600200150ustar00rootroot00000000000000# - Find LIBMEMCACHED # Find the LIBMEMCACHED includes and libraries. # This module defines: # LIBMEMCACHED_FOUND # LIBMEMCACHED_INCLUDE_DIRS # LIBMEMCACHED_LIBRARIES find_package(PkgConfig QUIET) pkg_check_modules(LIBMEMCACHED QUIET libmemcached) find_path(LIBMEMCACHED_INCLUDE_DIR NAMES memcached.h PATHS ${LIBMEMCACHED_INCLUDE_DIRS} PATH_SUFFIXES libmemcached ) if((NOT LIBMEMCACHED_INCLUDE_DIRS) AND (LIBMEMCACHED_INCLUDE_DIR)) set(LIBMEMCACHED_INCLUDE_DIRS ${LIBMEMCACHED_INCLUDE_DIR}) elseif(LIBMEMCACHED_INCLUDE_DIRS AND LIBMEMCACHED_INCLUDE_DIR) list(APPEND LIBMEMCACHED_INCLUDE_DIRS ${LIBMEMCACHED_INCLUDE_DIR}) endif() find_library(LIBMEMCACHED_LIBRARY NAMES ${LIBMEMCACHED_LIBRARIES} memcached ) if((NOT LIBMEMCACHED_LIBRARIES) AND (LIBMEMCACHED_LIBRARY)) set(LIBMEMCACHED_LIBRARIES ${LIBMEMCACHED_LIBRARY}) elseif(LIBMEMCACHED_LIBRARIES AND LIBMEMCACHED_LIBRARY) list(APPEND LIBMEMCACHED_LIBRARIES ${LIBMEMCACHED_LIBRARY}) endif() message(VERBOSE "LIBMEMCACHED_INCLUDE_DIRS=${LIBMEMCACHED_INCLUDE_DIRS}") message(VERBOSE "LIBMEMCACHED_INCLUDE_DIR=${LIBMEMCACHED_INCLUDE_DIR}") message(VERBOSE "LIBMEMCACHED_LIBRARIES=${LIBMEMCACHED_LIBRARIES}") message(VERBOSE "LIBMEMCACHED_LIBRARY=${LIBMEMCACHED_LIBRARY}") if((NOT LIBMEMCACHED_FOUND) AND (LIBMEMCACHED_INCLUDE_DIRS) AND (LIBMEMCACHED_LIBRARIES)) set(LIBMEMCACHED_FOUND True) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBMEMCACHED FOUND_VAR LIBMEMCACHED_FOUND REQUIRED_VARS LIBMEMCACHED_FOUND LIBMEMCACHED_INCLUDE_DIRS LIBMEMCACHED_LIBRARIES VERSION_VAR LIBMEMCACHED_VERSION ) mark_as_advanced(LIBMEMCACHED_INCLUDE_DIR LIBMEMCACHED_LIBRARY) mod_tile-0.7.1/cmake/FindLIBRADOS.cmake000066400000000000000000000041111457537455600174170ustar00rootroot00000000000000# - Find LIBRADOS # Find the LIBRADOS includes and libraries. # This module defines: # LIBRADOS_FOUND # LIBRADOS_INCLUDE_DIRS # LIBRADOS_LIBRARIES find_package(PkgConfig QUIET) pkg_check_modules(LIBRADOS QUIET rados) find_path(LIBRADOS_INCLUDE_DIR NAMES librados.h PATHS ${LIBRADOS_INCLUDE_DIRS} PATH_SUFFIXES rados ) if((NOT LIBRADOS_INCLUDE_DIRS) AND (LIBRADOS_INCLUDE_DIR)) set(LIBRADOS_INCLUDE_DIRS ${LIBRADOS_INCLUDE_DIR}) elseif(LIBRADOS_INCLUDE_DIRS AND LIBRADOS_INCLUDE_DIR) list(APPEND LIBRADOS_INCLUDE_DIRS ${LIBRADOS_INCLUDE_DIR}) endif() find_library(LIBRADOS_LIBRARY NAMES ${LIBRADOS_LIBRARIES} rados ) if((NOT LIBRADOS_LIBRARIES) AND (LIBRADOS_LIBRARY)) set(LIBRADOS_LIBRARIES ${LIBRADOS_LIBRARY}) elseif(LIBRADOS_LIBRARIES AND LIBRADOS_LIBRARY) list(APPEND LIBRADOS_LIBRARIES ${LIBRADOS_LIBRARY}) endif() message(VERBOSE "LIBRADOS_INCLUDE_DIRS=${LIBRADOS_INCLUDE_DIRS}") message(VERBOSE "LIBRADOS_INCLUDE_DIR=${LIBRADOS_INCLUDE_DIR}") message(VERBOSE "LIBRADOS_LIBRARIES=${LIBRADOS_LIBRARIES}") message(VERBOSE "LIBRADOS_LIBRARY=${LIBRADOS_LIBRARY}") if((NOT LIBRADOS_FOUND) AND (LIBRADOS_INCLUDE_DIRS) AND (LIBRADOS_LIBRARIES)) set(LIBRADOS_FOUND True) endif() if((NOT LIBRADOS_VERSION) AND (LIBRADOS_FOUND)) file(STRINGS "${LIBRADOS_INCLUDE_DIR}/librados.h" _contents REGEX "#define LIBRADOS_VER_[A-Z]+[ \t]+") if(_contents) string(REGEX REPLACE ".*#define LIBRADOS_VER_MAJOR[ \t]+([0-9]+).*" "\\1" LIBRADOS_MAJOR_VERSION "${_contents}") string(REGEX REPLACE ".*#define LIBRADOS_VER_MINOR[ \t]+([0-9]+).*" "\\1" LIBRADOS_MINOR_VERSION "${_contents}") string(REGEX REPLACE ".*#define LIBRADOS_VER_EXTRA[ \t]+([0-9]+).*" "\\1" LIBRADOS_EXTRA_VERSION "${_contents}") set(LIBRADOS_VERSION ${LIBRADOS_MAJOR_VERSION}.${LIBRADOS_MINOR_VERSION}.${LIBRADOS_EXTRA_VERSION}) endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBRADOS FOUND_VAR LIBRADOS_FOUND REQUIRED_VARS LIBRADOS_FOUND LIBRADOS_INCLUDE_DIRS LIBRADOS_LIBRARIES VERSION_VAR LIBRADOS_VERSION ) mark_as_advanced(LIBRADOS_INCLUDE_DIR LIBRADOS_LIBRARY) mod_tile-0.7.1/configure.ac000066400000000000000000000052061457537455600156310ustar00rootroot00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # Define mod_tile version number m4_define([mod_tile_version], [0.7.1]) AC_PREREQ([2.61]) AX_CONFIG_NICE AC_INIT([mod_tile], [mod_tile_version], [http://trac.openstreetmap.org]) AM_INIT_AUTOMAKE([subdir-objects]) LT_INIT AC_CONFIG_SRCDIR([src/convert_meta.c]) AC_CONFIG_HEADERS([includes/config.h]) AC_CONFIG_MACRO_DIR([m4]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CC_C99 dnl Find C++ compiler AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no) if test "$HAVE_CXX" = "no" then AC_MSG_ERROR([Could not find a c++ compiler]); fi # Checks for libraries. PKG_CHECK_MODULES([GLIB], [glib-2.0]) # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h utime.h paths.h sys/cdefs.h sys/loadavg.h iniparser.h iniparser/iniparser.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_SIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_MKTIME AX_PTHREAD(,[AC_MSG_ERROR([no])]) AC_SEARCH_LIBS(socket, socket) AC_SEARCH_LIBS(inet_ntoa, nsl) AC_SEARCH_LIBS(gethostbyname, resolv nsl) AC_SEARCH_LIBS(pow,m) AC_SEARCH_LIBS(clock_gettime,[rt posix4]) PKG_CHECK_MODULES([MAPNIK], [libmapnik >= 4], [ AC_DEFINE([HAVE_MAPNIK], [1]) AC_SUBST([MAPNIK_LDFLAGS], [${MAPNIK_LIBS}]) ], [AX_LIB_MAPNIK] ) AX_ENABLE_LIBMEMCACHED LIBCURL_CHECK_CONFIG AC_CHECK_LIB(rados, rados_version, [ AC_DEFINE([HAVE_LIBRADOS], [1], [Have found librados]) LIBRADOS_LDFLAGS='-lrados' AC_SUBST(LIBRADOS_LDFLAGS) ][]) AC_CHECK_LIB(iniparser, iniparser_load, [ INIPARSER_LDFLAGS='-liniparser' AC_SUBST(INIPARSER_LDFLAGS) ], [AC_MSG_ERROR([Unable to find libiniparser])]) AC_CHECK_FUNCS([bzero gethostbyname gettimeofday inet_ntoa memset mkdir pow select socket strchr strdup strerror strrchr strstr strtol strtoul utime],[],[AC_MSG_ERROR([One of the required functions was not found])]) AC_CHECK_FUNCS([daemon getloadavg],[],[]) AC_ARG_WITH(apxs, [ --with-apxs=PATH path to Apache apxs], [ if test "$withval" = "yes"; then AC_CHECK_PROGS(APXS, apxs apxs2 /opt/local/apache2/bin/apxs, reject) else APXS=$withval AC_SUBST(APXS) fi ], [ AC_CHECK_PROGS(APXS, apxs apxs2 /opt/local/apache2/bin/apxs, reject) ]) if test "$APXS" = "reject"; then AC_MSG_ERROR([Could not find apxs on the path.]) fi AC_CONFIG_FILES(Makefile) AC_OUTPUT mod_tile-0.7.1/docker/000077500000000000000000000000001457537455600146075ustar00rootroot00000000000000mod_tile-0.7.1/docker/.env000066400000000000000000000002671457537455600154050ustar00rootroot00000000000000COMPOSE_PROJECT_NAME=mod_tile DOWNLOAD_PBF=https://download.geofabrik.de/europe/germany/nordrhein-westfalen/koeln-regbez-latest.osm.pbf PGDATABASE=gis PGHOST=postgres PGUSER=renderer mod_tile-0.7.1/docker/README.md000066400000000000000000000040311457537455600160640ustar00rootroot00000000000000# Docker-based building & testing For your convenience, we have provided a Docker-based building and testing method to help get started with development & testing. ### The following distributions are currently supported: - archlinux _(Arch Linux)_ [[Dockerfile](/docker/archlinux/Dockerfile)] - centos-7 _(CentOS 7)_ [[Dockerfile](/docker/centos/7/Dockerfile)] - centos-stream-8 _(CentOS Stream 8)_ [[Dockerfile](/docker/centos/stream/Dockerfile)] - centos-stream-9 _(CentOS Stream 9)_ [[Dockerfile](/docker/centos/stream/Dockerfile)] - debian-10 _(Debian 10)_ [[Dockerfile](/docker/debian/Dockerfile)] - debian-11 _(Debian 11)_ [[Dockerfile](/docker/debian/Dockerfile)] - debian-12 _(Debian 12)_ [[Dockerfile](/docker/debian/Dockerfile)] - debian-testing _(Debian Testing)_ [[Dockerfile](/docker/debian/Dockerfile)] - fedora-34 _(Fedora 34)_ [[Dockerfile](/docker/fedora/Dockerfile)] - fedora-35 _(Fedora 35)_ [[Dockerfile](/docker/fedora/Dockerfile)] - fedora-36 _(Fedora 36)_ [[Dockerfile](/docker/fedora/Dockerfile)] - fedora-37 _(Fedora 37)_ [[Dockerfile](/docker/fedora/Dockerfile)] - fedora-38 _(Fedora 38)_ [[Dockerfile](/docker/fedora/Dockerfile)] - fedora-39 _(Fedora 39)_ [[Dockerfile](/docker/fedora/Dockerfile)] - fedora-rawhide _(Fedora Rawhide)_ [[Dockerfile](/docker/fedora/Dockerfile)] - opensuse-leap-15 _(openSUSE Leap 15)_ [[Dockerfile](/docker/opensuse/Dockerfile)] - opensuse-tumbleweed _(openSUSE Tumbleweed)_ [[Dockerfile](/docker/opensuse/Dockerfile)] - ubuntu-20.04 _(Ubuntu 20.04)_ [[Dockerfile](/docker/ubuntu/Dockerfile)] - ubuntu-22.04 _(Ubuntu 22.04)_ [[Dockerfile](/docker/ubuntu/Dockerfile)] - ubuntu-devel _(Ubuntu Devel)_ [[Dockerfile](/docker/ubuntu/Dockerfile)] ### Requirements: - [Docker](https://docs.docker.com/get-docker/) - [Docker Compose](https://github.com/docker/compose) ### Usage: ```shell $ # Use any "{distribution}" value from the list above $ # I.E. docker-compose up --build ubuntu-devel $ cd docker $ docker-compose up --build {distribution} ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docker/archlinux/000077500000000000000000000000001457537455600166045ustar00rootroot00000000000000mod_tile-0.7.1/docker/archlinux/Dockerfile000066400000000000000000000071731457537455600206060ustar00rootroot00000000000000# Arguments ARG runner_additional_packages # Builder FROM archlinux:latest as builder ## Install builder dependencies RUN --mount=id=archlinux:latest-/var/cache/pacman/pkg,sharing=locked,target=/var/cache/pacman/pkg,type=cache \ --mount=id=archlinux:latest-/var/lib/pacman/sync,sharing=locked,target=/var/lib/pacman/sync,type=cache \ pacman --sync --refresh --sysupgrade --noconfirm \ apache \ apr \ boost \ cairo \ cmake \ curl \ extra-cmake-modules \ gcc \ git \ glib2 \ iniparser \ lcov \ libmemcached \ make \ mapnik \ memcached \ pkgconf ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest --output-on-failure && \ (cmake --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM archlinux:latest as runner ## Arguments ARG runner_additional_packages ## Install runner dependencies RUN --mount=id=archlinux:latest-/var/cache/pacman/pkg,sharing=locked,target=/var/cache/pacman/pkg,type=cache \ --mount=id=archlinux:latest-/var/lib/pacman/sync,sharing=locked,target=/var/lib/pacman/sync,type=cache \ pacman --sync --refresh --sysupgrade --noconfirm ${runner_additional_packages} \ apache \ cairo \ curl \ glib2 \ iniparser \ libmemcached \ mapnik \ memcached \ # GDAL optional dependencies arrow \ cfitsio \ hdf5 \ libheif \ libjxl \ mariadb-libs \ netcdf \ openexr \ openjpeg2 \ podofo \ poppler ## Copy files from builder(s) ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/httpd/conf/extra/httpd-tile-renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Enable module & site RUN printf '\nInclude conf/extra/httpd-tile.conf\n' >> /etc/httpd/conf/httpd.conf && \ printf '\nInclude conf/extra/httpd-tile-renderd-example-map.conf\n' >> /etc/httpd/conf/httpd.conf ## Start services CMD httpd -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/centos/000077500000000000000000000000001457537455600161025ustar00rootroot00000000000000mod_tile-0.7.1/docker/centos/7/000077500000000000000000000000001457537455600162505ustar00rootroot00000000000000mod_tile-0.7.1/docker/centos/7/Dockerfile000066400000000000000000000142461457537455600202510ustar00rootroot00000000000000# Arguments ARG mapnik_version=3.1.0 # Mapnik Builder FROM centos:centos7 as mapnik-builder ## Arguments ARG mapnik_version ## Install mapnik-builder dependencies RUN --mount=id=centos:centos7-/var/cache/yum,target=/var/cache/yum,type=cache,sharing=locked \ ulimit -n 40000; \ echo "install_weak_deps=0" >> /etc/yum.conf && \ sed --in-place 's/keepcache=0/keepcache=1/g' /etc/yum.conf && \ yum --assumeyes install epel-release centos-release-scl && \ yum --assumeyes upgrade && \ yum --assumeyes install \ boost169-devel \ bzip2 \ cairo-devel \ devtoolset-9-gcc \ devtoolset-9-gcc-c++ \ freetype-devel \ gdal-devel \ harfbuzz-devel \ libicu-devel \ libjpeg-devel \ libpng-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ make \ patch \ postgresql-devel \ proj-devel \ python3 \ sqlite-devel \ tar \ zlib-devel ## Download, Build & Install `Mapnik` WORKDIR /tmp/mapnik_src RUN --mount=id=centos:centos7-mapnik:${mapnik_version},target=/tmp/mapnik_src,type=cache \ export DESTDIR="/tmp/mapnik"; \ export GDAL_DATA="$(gdal-config --datadir)"; \ export JOBS="$(nproc)"; \ export PROJ_LIB="/usr/share/proj"; \ export PYTHON="python3"; \ mkdir --parents ${GDAL_DATA} ${PROJ_LIB}; \ if [ ! -f SConstruct ]; then \ curl --silent --location https://github.com/mapnik/mapnik/releases/download/v${mapnik_version}/mapnik-v${mapnik_version}.tar.bz2 \ | tar --extract --bzip2 --strip-components=1 --file=-; \ sed -i 's#BOOST_APPEND = match.groups()\[0\]#BOOST_APPEND = ""#g' SConstruct; \ fi; \ source /opt/rh/devtoolset-9/enable; \ export CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; \ export CUSTOM_LDFLAGS="-L/usr/lib64/boost169"; \ bash configure \ CPP_TESTS=False \ CUSTOM_CFLAGS="${CUSTOM_CFLAGS:-}" \ CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS:-}" \ CUSTOM_DEFINES="${CUSTOM_DEFINES:-}" \ CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS:-}" \ DEMO=False \ DESTDIR="${DESTDIR}" \ FAST=True \ INPUT_PLUGINS=all \ LIBDIR_SCHEMA=lib64 \ OPTIMIZATION=2 \ PREFIX=/usr \ SVG2PNG=True \ XMLPARSER=libxml2 && \ make PYTHON="${PYTHON}" && \ make install PYTHON="${PYTHON}" # Builder FROM centos:centos7 as builder ## Install builder dependencies RUN --mount=id=centos:centos7-/var/cache/yum,target=/var/cache/yum,type=cache,sharing=locked \ ulimit -n 40000; \ echo "install_weak_deps=0" >> /etc/yum.conf && \ sed --in-place 's/keepcache=0/keepcache=1/g' /etc/yum.conf && \ yum --assumeyes install epel-release centos-release-scl && \ yum --assumeyes upgrade && \ yum --assumeyes install \ boost169-devel \ cairo-devel \ cmake3 \ devtoolset-9-gcc \ devtoolset-9-gcc-c++ \ gdal \ glib2-devel \ harfbuzz-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libicu-devel \ libjpeg \ libmemcached-devel \ librados2-devel \ libtiff \ libwebp \ make \ proj ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN source /opt/rh/devtoolset-9/enable && \ export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ export CFLAGS="-I/usr/include/boost169" && \ export CXXFLAGS="-I/usr/include/boost169" && \ cmake3 -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake3 --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest3 --output-on-failure && \ (cmake3 --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM centos:centos7 as runner ## Install runner dependencies RUN --mount=id=centos:centos7-/var/cache/yum,target=/var/cache/yum,type=cache,sharing=locked \ ulimit -n 40000; \ echo "install_weak_deps=0" >> /etc/yum.conf && \ sed --in-place 's/keepcache=0/keepcache=1/g' /etc/yum.conf && \ yum --assumeyes install epel-release && \ yum --assumeyes upgrade && \ yum --assumeyes install \ boost169-filesystem \ boost169-program-options \ boost169-regex \ cairo \ gdal \ harfbuzz \ httpd \ iniparser \ libicu \ libmemcached \ librados2 \ libtiff \ libwebp \ proj ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --chown=apache:apache --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/httpd/conf.d/renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Start services CMD httpd -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/centos/stream/000077500000000000000000000000001457537455600173755ustar00rootroot00000000000000mod_tile-0.7.1/docker/centos/stream/Dockerfile000066400000000000000000000157141457537455600213770ustar00rootroot00000000000000# Arguments ARG centos_stream_version ARG extra_repository ARG mapnik_version=3.1.0 # Mapnik Builder FROM quay.io/centos/centos:stream${centos_stream_version} as mapnik-builder ## Arguments ARG centos_stream_version ARG extra_repository ARG mapnik_version ## Install mapnik-builder dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost-devel \ bzip2 \ cairo-devel \ freetype-devel \ gcc \ gcc-c++ \ gdal-devel \ harfbuzz-devel \ libicu-devel \ libjpeg-devel \ libpng-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ make \ patch \ postgresql-devel \ proj-devel \ python3 \ sqlite-devel \ tar \ zlib-devel ## Download, Build & Install `Mapnik` WORKDIR /tmp/mapnik_src RUN --mount=id=centos:stream${centos_stream_version}-mapnik:${mapnik_version},target=/tmp/mapnik_src,type=cache \ export DESTDIR="/tmp/mapnik"; \ export GDAL_DATA="$(gdal-config --datadir)"; \ export JOBS="$(nproc)"; \ export PROJ_LIB="/usr/share/proj"; \ export PYTHON="python3"; \ mkdir --parents ${GDAL_DATA} ${PROJ_LIB}; \ if [ ! -f SConstruct ]; then \ curl --silent --location https://github.com/mapnik/mapnik/releases/download/v${mapnik_version}/mapnik-v${mapnik_version}.tar.bz2 \ | tar --extract --bzip2 --strip-components=1 --file=-; \ if [ "${centos_stream_version}" = "9" ]; then \ curl --silent --location https://github.com/mapnik/mapnik/commit/8944e81367d2b3b91a41e24116e1813c01491e5d.patch \ | patch -Np1; \ curl --silent --location https://github.com/mapnik/mapnik/commit/83779b7b6bdd229740b1b5e12a4a8fe27114cb7d.patch \ | patch -F3 -Np1; \ fi \ fi; \ if [ "${centos_stream_version}" = "8" ]; then \ export CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; \ fi; \ bash configure \ CPP_TESTS=False \ CUSTOM_CFLAGS="${CUSTOM_CFLAGS:-}" \ CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS:-}" \ CUSTOM_DEFINES="${CUSTOM_DEFINES:-}" \ CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS:-}" \ DEMO=False \ DESTDIR="${DESTDIR}" \ FAST=True \ INPUT_PLUGINS=all \ LIBDIR_SCHEMA=lib64 \ OPTIMIZATION=2 \ PREFIX=/usr \ SVG2PNG=True \ XMLPARSER=libxml2 && \ make PYTHON="${PYTHON}" && \ make install PYTHON="${PYTHON}" # Builder FROM quay.io/centos/centos:stream${centos_stream_version} as builder ## Arguments ARG centos_stream_version ARG extra_repository ## Install builder dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost-devel \ cairo-devel \ cmake3 \ gcc \ gcc-c++ \ gdal \ glib2-devel \ harfbuzz-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libicu-devel \ libjpeg \ libmemcached-devel \ librados2-devel \ libtiff \ libwebp \ make \ procps \ proj ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest --output-on-failure && \ (cmake --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM quay.io/centos/centos:stream${centos_stream_version} as runner ## Arguments ARG centos_stream_version ARG extra_repository ## Install runner dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost-filesystem \ boost-program-options \ boost-regex \ cairo \ gdal \ harfbuzz \ httpd \ iniparser \ libicu \ libmemcached \ librados2 \ libtiff \ libwebp \ proj ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --chown=apache:apache --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/httpd/conf.d/renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Start services CMD httpd -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/centos/stream/Dockerfile.autotools000066400000000000000000000161341457537455600234240ustar00rootroot00000000000000# Arguments ARG centos_stream_version ARG extra_repository ARG mapnik_version=3.1.0 # Mapnik Builder FROM quay.io/centos/centos:stream${centos_stream_version} as mapnik-builder ## Arguments ARG centos_stream_version ARG extra_repository ARG mapnik_version ## Install mapnik-builder dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost-devel \ bzip2 \ cairo-devel \ freetype-devel \ gcc \ gcc-c++ \ gdal-devel \ harfbuzz-devel \ libicu-devel \ libjpeg-devel \ libpng-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ make \ patch \ postgresql-devel \ proj-devel \ python3 \ sqlite-devel \ tar \ zlib-devel ## Download, Build & Install `Mapnik` WORKDIR /tmp/mapnik_src RUN --mount=id=centos:stream${centos_stream_version}-mapnik:${mapnik_version},target=/tmp/mapnik_src,type=cache \ export DESTDIR="/tmp/mapnik"; \ export GDAL_DATA="$(gdal-config --datadir)"; \ export JOBS="$(nproc)"; \ export PROJ_LIB="/usr/share/proj"; \ export PYTHON="python3"; \ mkdir --parents ${GDAL_DATA} ${PROJ_LIB}; \ if [ ! -f SConstruct ]; then \ curl --silent --location https://github.com/mapnik/mapnik/releases/download/v${mapnik_version}/mapnik-v${mapnik_version}.tar.bz2 \ | tar --extract --bzip2 --strip-components=1 --file=-; \ if [ "${centos_stream_version}" = "9" ]; then \ curl --silent --location https://github.com/mapnik/mapnik/commit/8944e81367d2b3b91a41e24116e1813c01491e5d.patch \ | patch -Np1; \ curl --silent --location https://github.com/mapnik/mapnik/commit/83779b7b6bdd229740b1b5e12a4a8fe27114cb7d.patch \ | patch -F3 -Np1; \ fi \ fi; \ if [ "${centos_stream_version}" = "8" ]; then \ export CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; \ fi; \ bash configure \ CPP_TESTS=False \ CUSTOM_CFLAGS="${CUSTOM_CFLAGS:-}" \ CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS:-}" \ CUSTOM_DEFINES="${CUSTOM_DEFINES:-}" \ CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS:-}" \ DEMO=False \ DESTDIR="${DESTDIR}" \ FAST=True \ INPUT_PLUGINS=all \ LIBDIR_SCHEMA=lib64 \ OPTIMIZATION=2 \ PREFIX=/usr \ SVG2PNG=True \ XMLPARSER=libxml2 && \ make PYTHON="${PYTHON}" && \ make install PYTHON="${PYTHON}" # Builder FROM quay.io/centos/centos:stream${centos_stream_version} as builder ## Arguments ARG centos_stream_version ARG extra_repository ## Install builder dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ automake \ boost-devel \ cairo-devel \ gcc \ gcc-c++ \ gdal \ glib2-devel \ harfbuzz-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libicu-devel \ libjpeg-devel \ libmemcached-devel \ librados2-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ make \ proj-devel \ redhat-rpm-config \ sqlite-devel ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_src RUN export DESTDIR=/tmp/mod_tile && \ ./autogen.sh && \ ./configure && \ make DESTDIR=${DESTDIR} install install-mod_tile RUN make test # Runner FROM quay.io/centos/centos:stream${centos_stream_version} as runner ## Arguments ARG centos_stream_version ARG extra_repository ## Install runner dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost-filesystem \ boost-program-options \ boost-regex \ cairo \ gdal \ harfbuzz \ httpd \ iniparser \ libicu \ libmemcached \ librados2 \ libtiff \ libwebp \ proj ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --chown=apache:apache --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/httpd/conf.d/renderd-example-map.conf ## Fix mapnik directories RUN sed \ --expression "s#/usr/lib/mapnik/3.1/input#$(find /usr -mindepth 1 -type d -name input)#g" \ --expression "s#/usr/share/fonts/truetype#/usr/share/fonts#g" \ /usr/local/etc/renderd.conf > /etc/renderd.conf ## Add configuration RUN printf "LoadModule tile_module $(find /usr -name mod_tile.so)\n" > /etc/httpd/conf.modules.d/11-tile.conf RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Create missing directories RUN mkdir --parents /run/renderd /var/cache/renderd/tiles ## Start services CMD httpd -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/centos/stream/Dockerfile.mapnik-latest000066400000000000000000000147661457537455600241550ustar00rootroot00000000000000# Arguments ARG centos_stream_version=9 ARG extra_repository=crb # Mapnik Builder FROM quay.io/centos/centos:stream${centos_stream_version} as mapnik-builder ## Arguments ARG centos_stream_version ARG extra_repository ## Install mapnik-builder dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost1.78-devel \ bzip2 \ cairo-devel \ cmake3 \ freetype-devel \ gcc \ gcc-c++ \ gdal-devel \ git \ harfbuzz-devel \ libicu-devel \ libjpeg-devel \ libpng-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ make \ patch \ postgresql-devel \ proj-devel \ python3 \ sqlite-devel \ tar \ zlib-devel ## Download, Build & Install `Mapnik` WORKDIR /tmp/mapnik_src RUN --mount=id=centos:stream${centos_stream_version}-mapnik-src:latest,target=/tmp/mapnik_src,type=cache \ if [ ! -f CMakeLists.txt ]; then \ git clone --depth 1 --jobs 8 --recurse-submodules https://github.com/mapnik/mapnik.git /tmp/mapnik_src; \ fi WORKDIR /tmp/mapnik_build RUN --mount=id=centos:stream${centos_stream_version}-mapnik-src:latest,target=/tmp/mapnik_src,type=cache \ --mount=id=centos:stream${centos_stream_version}-mapnik-build:latest,target=/tmp/mapnik_build,type=cache \ export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mapnik && \ cmake -B . -S /tmp/mapnik_src \ -DBUILD_DEMO_VIEWER:BOOL=OFF \ -DBUILD_TESTING:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_CXX_STANDARD:STRING=17 \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DMAPNIK_PKGCONF_DIR:PATH=/usr/share/pkgconfig && \ cmake --build . && \ (cmake --install . --prefix /usr --strip || make DESTDIR=${DESTDIR} install/strip) # Builder FROM quay.io/centos/centos:stream${centos_stream_version} as builder ## Arguments ARG centos_stream_version ARG extra_repository ## Install builder dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost1.78-devel \ cairo-devel \ cmake3 \ freetype-devel \ gcc \ gcc-c++ \ gdal \ glib2-devel \ harfbuzz-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libicu-devel \ libjpeg-devel \ libmemcached-devel \ libpng-devel \ librados2-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ make \ pkg-config \ proj-devel ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ## Build & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES:PATH=/usr/include/boost1.78 \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest --output-on-failure && \ (cmake --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM quay.io/centos/centos:stream${centos_stream_version} as runner ## Arguments ARG centos_stream_version ARG extra_repository ## Install runner dependencies RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install "dnf-command(config-manager)" && \ dnf config-manager --save \ --setopt=${extra_repository}.enabled=1 && \ dnf --assumeyes install epel-release && \ dnf --assumeyes upgrade && \ dnf --assumeyes install \ boost1.78-filesystem \ boost1.78-program-options \ boost1.78-regex \ cairo \ gdal \ harfbuzz \ httpd \ iniparser \ libicu \ libmemcached \ librados2 \ libtiff \ libwebp \ proj ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --chown=apache:apache --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/httpd/conf.d/renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Start services CMD httpd -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/debian/000077500000000000000000000000001457537455600160315ustar00rootroot00000000000000mod_tile-0.7.1/docker/debian/Dockerfile000066400000000000000000000070701457537455600200270ustar00rootroot00000000000000# Arguments ARG debian_version=12 ARG libmapnik_version=3.1 # Builder FROM debian:${debian_version} as builder ## Arguments ARG debian_version ## Install builder dependencies RUN --mount=id=debian:${debian_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=debian:${debian_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install \ apache2 \ apache2-dev \ cmake \ curl \ g++ \ gcc \ libcairo2-dev \ libcurl4-openssl-dev \ libglib2.0-dev \ libiniparser-dev \ libmapnik-dev \ libmemcached-dev \ librados-dev \ netbase ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest --output-on-failure && \ (cmake --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM debian:${debian_version} as runner ## Arguments ARG debian_version ARG libmapnik_version ## Install runner dependencies RUN --mount=id=debian:${debian_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=debian:${debian_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install \ apache2 \ libcairo2 \ libcurl4 \ libglib2.0 \ libiniparser1 \ libmapnik${libmapnik_version} \ libmemcached11 \ libmemcachedutil2 \ librados2 ## Copy files from builder(s) ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/apache2/sites-available/renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Enable module & site RUN a2enmod tile && \ a2ensite renderd-example-map ## Start services CMD apachectl -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/debian/Dockerfile.autotools000066400000000000000000000071071457537455600220600ustar00rootroot00000000000000# Arguments ARG debian_version=12 ARG libmapnik_version=3.1 # Builder FROM debian:${debian_version} as builder ## Arguments ARG debian_version ## Install builder dependencies RUN --mount=id=debian:${debian_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=debian:${debian_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install \ apache2 \ apache2-dev \ curl \ g++ \ gcc \ libcairo2-dev \ libcurl4-openssl-dev \ libglib2.0-dev \ libiniparser-dev \ libmapnik-dev \ libmemcached-dev \ librados-dev \ netbase ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_src RUN export DESTDIR=/tmp/mod_tile && \ ./autogen.sh && \ ./configure && \ make DESTDIR=${DESTDIR} install install-mod_tile RUN make test # Runner FROM debian:${debian_version} as runner ## Arguments ARG debian_version ARG libmapnik_version ## Install runner dependencies RUN --mount=id=debian:${debian_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=debian:${debian_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install \ apache2 \ libcairo2 \ libcurl4 \ libglib2.0 \ libiniparser1 \ libmapnik${libmapnik_version} \ libmemcached11 \ librados2 ## Copy files from builder(s) ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/apache2/sites-available/renderd-example-map.conf ## Fix mapnik directories RUN sed \ --expression "s#/usr/lib/mapnik/3.1/input#$(find /usr -mindepth 1 -type d -name input)#g" \ --expression "s#/usr/share/fonts/truetype#/usr/share/fonts#g" \ /usr/local/etc/renderd.conf > /etc/renderd.conf ## Add configuration RUN printf "LoadModule tile_module $(find /usr -name mod_tile.so)\n" > /etc/apache2/mods-available/tile.load RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Create missing directories RUN mkdir --parents /run/renderd /var/cache/renderd/tiles ## Enable module & site RUN a2enmod tile && \ a2ensite renderd-example-map ## Start services CMD apachectl -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/docker-compose.yml000066400000000000000000000170241457537455600202500ustar00rootroot00000000000000--- version: "3.8" x-mod_tile: build_defaults: &build_defaults context: .. build_defaults_centos_stream: &build_defaults_centos_stream <<: *build_defaults dockerfile: docker/centos/stream/Dockerfile build_defaults_debian: &build_defaults_debian <<: *build_defaults dockerfile: docker/debian/Dockerfile build_defaults_fedora: &build_defaults_fedora <<: *build_defaults dockerfile: docker/fedora/Dockerfile build_defaults_opensuse: &build_defaults_opensuse <<: *build_defaults dockerfile: docker/opensuse/Dockerfile build_defaults_ubuntu: &build_defaults_ubuntu <<: *build_defaults dockerfile: docker/ubuntu/Dockerfile service_defaults: &service_defaults env_file: .env ports: - 8081:8081 services: archlinux: <<: *service_defaults build: <<: *build_defaults dockerfile: docker/archlinux/Dockerfile archlinux-full: <<: *service_defaults build: <<: *build_defaults args: runner_additional_packages: >- curl gdal git npm osm2pgsql postgresql python-psycopg2 python-pyaml unzip dockerfile: docker/archlinux/Dockerfile depends_on: postgres: condition: service_healthy entrypoint: /entrypoint.sh volumes: - data:/opt/data - fonts:/opt/fonts - styles:/opt/styles - tiles:/var/cache/renderd/tiles - ./full-entrypoint.sh:/entrypoint.sh:ro centos-7: <<: *service_defaults build: <<: *build_defaults dockerfile: docker/centos/7/Dockerfile ulimits: nofile: 40000 centos-stream-8: <<: *service_defaults build: <<: *build_defaults_centos_stream args: centos_stream_version: "8" extra_repository: powertools centos-stream-8-autotools: <<: *service_defaults build: <<: *build_defaults_centos_stream args: centos_stream_version: "8" extra_repository: powertools dockerfile: docker/centos/stream/Dockerfile.autotools centos-stream-9: <<: *service_defaults build: <<: *build_defaults_centos_stream args: centos_stream_version: "9" extra_repository: crb centos-stream-9-autotools: <<: *service_defaults build: <<: *build_defaults_centos_stream args: centos_stream_version: "9" extra_repository: crb dockerfile: docker/centos/stream/Dockerfile.autotools centos-stream-9-mapnik-latest: <<: *service_defaults build: <<: *build_defaults_centos_stream args: centos_stream_version: "9" extra_repository: crb dockerfile: docker/centos/stream/Dockerfile.mapnik-latest debian-10: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.0" debian_version: "10" debian-10-autotools: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.0" debian_version: "10" dockerfile: docker/debian/Dockerfile.autotools debian-11: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.1" debian_version: "11" debian-11-autotools: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.1" debian_version: "11" dockerfile: docker/debian/Dockerfile.autotools debian-12: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.1" debian_version: "12" debian-12-autotools: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.1" debian_version: "12" dockerfile: docker/debian/Dockerfile.autotools debian-testing: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.1" debian_version: testing debian-testing-autotools: <<: *service_defaults build: <<: *build_defaults_debian args: libmapnik_version: "3.1" debian_version: testing dockerfile: docker/debian/Dockerfile.autotools fedora-34: <<: *service_defaults build: <<: *build_defaults_fedora args: fedora_version: "34" fedora-35: <<: *service_defaults build: <<: *build_defaults_fedora args: fedora_version: "35" fedora-36: <<: *service_defaults build: <<: *build_defaults_fedora args: fedora_version: "36" fedora-37: <<: *service_defaults build: <<: *build_defaults_fedora args: fedora_version: "37" fedora-38: <<: *service_defaults build: <<: *build_defaults_fedora args: fedora_version: "38" fedora-39: <<: *service_defaults build: <<: *build_defaults_fedora args: fedora_version: "39" fedora-rawhide: <<: *service_defaults build: <<: *build_defaults_fedora args: fedora_version: "rawhide" opensuse-leap-15: <<: *service_defaults build: <<: *build_defaults_opensuse args: boost_version: "1_75_0" opensuse_version: "leap:15" opensuse-tumbleweed: <<: *service_defaults build: <<: *build_defaults_opensuse args: opensuse_version: "tumbleweed" ubuntu-20.04: <<: *service_defaults build: <<: *build_defaults_ubuntu args: libmapnik_version: "3.0" ubuntu_version: "20.04" ubuntu-20.04-autotools: <<: *service_defaults build: <<: *build_defaults_ubuntu args: libmapnik_version: "3.0" ubuntu_version: "20.04" dockerfile: docker/ubuntu/Dockerfile.autotools ubuntu-22.04: <<: *service_defaults build: <<: *build_defaults_ubuntu args: libmapnik_version: "3.1" ubuntu_version: "22.04" ubuntu-22.04-autotools: <<: *service_defaults build: <<: *build_defaults_ubuntu args: libmapnik_version: "3.1" ubuntu_version: "22.04" dockerfile: docker/ubuntu/Dockerfile.autotools ubuntu-devel: <<: *service_defaults build: <<: *build_defaults_ubuntu args: libmapnik_version: "3.1" ubuntu_version: "devel" ubuntu-devel-autotools: <<: *service_defaults build: <<: *build_defaults_ubuntu args: libmapnik_version: "3.1" ubuntu_version: "devel" dockerfile: docker/ubuntu/Dockerfile.autotools ubuntu-devel-full: <<: *service_defaults build: <<: *build_defaults_ubuntu args: libmapnik_version: "3.1" runner_additional_packages: >- curl gdal-bin git npm osm2pgsql postgresql-client python3-psycopg2 python3-yaml unzip ubuntu_version: "devel" depends_on: postgres: condition: service_healthy entrypoint: /entrypoint.sh volumes: - data:/opt/data - fonts:/opt/fonts - styles:/opt/styles - tiles:/var/cache/renderd/tiles - ./full-entrypoint.sh:/entrypoint.sh:ro postgres: env_file: .env environment: POSTGRES_DB: ${PGDATABASE} POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_USER: ${PGUSER} healthcheck: test: ["CMD", "psql", "--quiet", "--list"] image: postgis/postgis ports: - 65432:5432 volumes: - pgdata:/var/lib/postgresql/data shm_size: 1gb volumes: data: fonts: pgdata: styles: tiles: mod_tile-0.7.1/docker/fedora/000077500000000000000000000000001457537455600160475ustar00rootroot00000000000000mod_tile-0.7.1/docker/fedora/Dockerfile000066400000000000000000000060761457537455600200520ustar00rootroot00000000000000# Arguments ARG fedora_version=38 # Builder FROM fedora:${fedora_version} as builder ## Arguments ARG fedora_version ## Install builder dependencies RUN --mount=id=fedora:${fedora_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install \ cairo-devel \ cmake \ gcc \ gcc-c++ \ glib2-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libmemcached-devel \ librados-devel \ mapnik-devel \ procps ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest --output-on-failure && \ (cmake --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM fedora:${fedora_version} as runner ## Arguments ARG fedora_version ## Install runner dependencies RUN --mount=id=fedora:${fedora_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \ echo "keepcache=True" >> /etc/dnf/dnf.conf && \ dnf --assumeyes install \ cairo \ glib2 \ httpd \ iniparser \ libcurl \ libmemcached \ librados2 \ mapnik ## Copy files from builder(s) ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --chown=apache:apache --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/httpd/conf.d/renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Start services CMD httpd -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/full-entrypoint.sh000077500000000000000000000037641457537455600203330ustar00rootroot00000000000000#!/usr/bin/env sh if [ ! -f /opt/styles/mapnik.xml ] then git clone https://github.com/gravitystorm/openstreetmap-carto.git --depth 1 /opt/openstreetmap-carto cp --archive /opt/openstreetmap-carto/patterns /opt/openstreetmap-carto/symbols /opt/styles/ python3 /opt/openstreetmap-carto/scripts/get-external-data.py --cache --config /opt/openstreetmap-carto/external-data.yml --data /opt/data cd /opt && /opt/openstreetmap-carto/scripts/get-fonts.sh && cd - psql --command "CREATE EXTENSION postgis;" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}" psql --command "CREATE EXTENSION hstore;" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}" psql --command "ALTER TABLE geometry_columns OWNER TO ${PGUSER};" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}" psql --command "ALTER TABLE spatial_ref_sys OWNER TO ${PGUSER};" --dbname "${PGDATABASE}" --host "${PGHOST}" --user "${PGUSER}" if [ ! -f /opt/data/region.osm.pbf ] then curl --location "${DOWNLOAD_PBF:-http://download.geofabrik.de/asia/vietnam-latest.osm.pbf}" --output /opt/data/region.osm.pbf fi osm2pgsql \ --create \ --database "${PGDATABASE}" \ --host "${PGHOST}" \ --hstore \ --number-processes "$(nproc)" \ --slim \ --tag-transform-script /opt/openstreetmap-carto/openstreetmap-carto.lua \ --user "${PGUSER}" \ -G \ -S /opt/openstreetmap-carto/openstreetmap-carto.style \ /opt/data/region.osm.pbf psql --dbname "${PGDATABASE}" --file /opt/openstreetmap-carto/indexes.sql --host "${PGHOST}" --user "${PGUSER}" npm install --global carto carto /opt/openstreetmap-carto/project.mml > /opt/styles/mapnik.xml fi sed -i \ -e 's#/usr/share/renderd/example-map/mapnik.xml#/opt/styles/mapnik.xml#g' \ -e 's/pid_file=/num_threads=-1\npid_file=/g' \ -e 's#font_dir=.*#font_dir=/opt/fonts#g' \ /etc/renderd.conf apachectl -e debug -k start renderd --foreground mod_tile-0.7.1/docker/opensuse/000077500000000000000000000000001457537455600164505ustar00rootroot00000000000000mod_tile-0.7.1/docker/opensuse/Dockerfile000066400000000000000000000150061457537455600204440ustar00rootroot00000000000000# Arguments ARG boost_version ARG opensuse_version=leap:15 # Mapnik Builder FROM opensuse/${opensuse_version} as mapnik-builder ## Arguments ARG boost_version ARG opensuse_version ## Install mapnik-builder dependencies RUN --mount=id=opensuse:${opensuse_version}-/var/cache/zypp,target=/var/cache/zypp,type=cache,sharing=locked \ zypper modifyrepo --all --keep-packages && \ zypper --non-interactive update && \ zypper --non-interactive install \ cairo-devel \ cmake \ freetype-devel \ gcc \ gcc-c++ \ gdal-devel \ git \ harfbuzz-devel \ libboost_atomic${boost_version}-devel \ libboost_filesystem${boost_version}-devel \ libboost_headers${boost_version}-devel \ libboost_program_options${boost_version}-devel \ libboost_regex${boost_version}-devel \ libboost_system${boost_version}-devel \ libicu-devel \ libjpeg8-devel \ libpng16-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ postgresql-devel \ proj-devel \ python3 \ sqlite3-devel \ tar \ zlib-devel ## Download, Build & Install `Mapnik` WORKDIR /tmp/mapnik_src RUN --mount=id=opensuse:${opensuse_version}-mapnik-src:latest,target=/tmp/mapnik_src,type=cache \ if [ ! -f CMakeLists.txt ]; then \ git clone --depth 1 --jobs 8 --recurse-submodules https://github.com/mapnik/mapnik.git /tmp/mapnik_src; \ fi WORKDIR /tmp/mapnik_build RUN --mount=id=opensuse:${opensuse_version}-mapnik-src:latest,target=/tmp/mapnik_src,type=cache \ --mount=id=opensuse:${opensuse_version}-mapnik-build:latest,target=/tmp/mapnik_build,type=cache \ export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mapnik && \ cmake -B . -S /tmp/mapnik_src \ -DBUILD_DEMO_VIEWER:BOOL=OFF \ -DBUILD_TESTING:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DMAPNIK_PKGCONF_DIR:PATH=/usr/share/pkgconfig && \ cmake --build . && \ (cmake --install . --prefix /usr --strip || make DESTDIR=${DESTDIR} install/strip) # Builder FROM opensuse/${opensuse_version} as builder ## Arguments ARG boost_version ARG opensuse_version ## Install builder dependencies RUN --mount=id=opensuse:${opensuse_version}-/var/cache/zypp,target=/var/cache/zypp,type=cache,sharing=locked \ zypper modifyrepo --all --keep-packages && \ zypper --non-interactive update && \ zypper --non-interactive install \ apache2-devel \ cairo-devel \ cmake \ curl \ gcc \ gcc-c++ \ gdal \ glib2-devel \ harfbuzz-devel \ libboost_atomic${boost_version}-devel \ libboost_filesystem${boost_version}-devel \ libboost_headers${boost_version}-devel \ libboost_program_options${boost_version}-devel \ libboost_regex${boost_version}-devel \ libboost_system${boost_version}-devel \ libcurl-devel \ libicu-devel \ libiniparser-devel \ libjpeg8-devel \ libmemcached-devel \ librados-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ proj-devel \ tar ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ## Create `nobody` user and group RUN id nobody || useradd --home-dir / --no-create-home --shell /usr/sbin/nologin --system --user-group nobody ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest --output-on-failure && \ (cmake --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM opensuse/${opensuse_version} as runner ## Arguments ARG boost_version ARG opensuse_version ## Install runner dependencies RUN --mount=id=opensuse:${opensuse_version}-/var/cache/zypp,target=/var/cache/zypp,type=cache,sharing=locked \ zypper modifyrepo --all --keep-packages && \ zypper --non-interactive update && \ zypper --non-interactive install \ apache2 \ apache2-utils \ cairo-devel \ gdal \ harfbuzz-devel \ libboost_atomic${boost_version}-devel \ libboost_filesystem${boost_version}-devel \ libboost_program_options${boost_version}-devel \ libboost_regex${boost_version}-devel \ libboost_system${boost_version}-devel \ libicu-devel \ libiniparser-devel \ libjpeg8-devel \ libmemcached-devel \ librados-devel \ libtiff-devel \ libwebp-devel \ proj ## Copy files from builder(s) ### Mapnik COPY --from=mapnik-builder /tmp/mapnik / ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --chown=apache:apache --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/apache2/conf.d/renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Enable `mod_access_compat` RUN sed -i 's/^APACHE_MODULES="actions/APACHE_MODULES="access_compat actions/g' /etc/sysconfig/apache2 ## Start services CMD apachectl -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/ubuntu/000077500000000000000000000000001457537455600161315ustar00rootroot00000000000000mod_tile-0.7.1/docker/ubuntu/Dockerfile000066400000000000000000000071751457537455600201350ustar00rootroot00000000000000# Arguments ARG libmapnik_version=3.1 ARG runner_additional_packages ARG ubuntu_version=22.04 # Builder FROM ubuntu:${ubuntu_version} as builder ## Arguments ARG ubuntu_version ## Install builder dependencies RUN --mount=id=ubuntu:${ubuntu_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=ubuntu:${ubuntu_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install \ apache2 \ apache2-dev \ cmake \ curl \ g++ \ gcc \ libcairo2-dev \ libcurl4-openssl-dev \ libglib2.0-dev \ libiniparser-dev \ libmapnik-dev \ libmemcached-dev \ librados-dev \ netbase ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_build RUN export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \ cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON && \ cmake --build . RUN export CTEST_PARALLEL_LEVEL=$(nproc) && \ export DESTDIR=/tmp/mod_tile && \ ctest --output-on-failure && \ (cmake --install . --strip || make DESTDIR=${DESTDIR} install/strip) # Runner FROM ubuntu:${ubuntu_version} as runner ## Arguments ARG libmapnik_version ARG runner_additional_packages ARG ubuntu_version ## Install runner dependencies RUN --mount=id=ubuntu:${ubuntu_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=ubuntu:${ubuntu_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install ${runner_additional_packages} \ apache2 \ libcairo2 \ libcurl4 \ libglib2.0-0 \ libiniparser1 \ libmapnik${libmapnik_version} \ libmemcached11 \ librados2 ## Copy files from builder(s) ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/apache2/sites-available/renderd-example-map.conf ## Add configuration RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Enable module & site RUN a2enmod tile && \ a2ensite renderd-example-map ## Start services CMD apachectl -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docker/ubuntu/Dockerfile.autotools000066400000000000000000000071141457537455600221560ustar00rootroot00000000000000# Arguments ARG libmapnik_version=3.1 ARG ubuntu_version=22.04 # Builder FROM ubuntu:${ubuntu_version} as builder ## Arguments ARG ubuntu_version ## Install builder dependencies RUN --mount=id=ubuntu:${ubuntu_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=ubuntu:${ubuntu_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install \ apache2 \ apache2-dev \ curl \ g++ \ gcc \ libcairo2-dev \ libcurl4-openssl-dev \ libglib2.0-dev \ libiniparser-dev \ libmapnik-dev \ libmemcached-dev \ librados-dev \ netbase ## Build, Test & Install `mod_tile` COPY . /tmp/mod_tile_src WORKDIR /tmp/mod_tile_src RUN export DESTDIR=/tmp/mod_tile && \ ./autogen.sh && \ ./configure && \ make DESTDIR=${DESTDIR} install install-mod_tile RUN make test # Runner FROM ubuntu:${ubuntu_version} as runner ## Arguments ARG libmapnik_version ARG ubuntu_version ## Install runner dependencies RUN --mount=id=ubuntu:${ubuntu_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \ --mount=id=ubuntu:${ubuntu_version}-/var/lib/apt,sharing=locked,target=/var/lib/apt,type=cache \ export DEBIAN_FRONTEND=noninteractive && \ apt-get --yes update && \ apt-get --yes upgrade && \ apt-get --no-install-recommends --yes install \ apache2 \ libcairo2 \ libcurl4 \ libglib2.0-0 \ libiniparser1 \ libmapnik${libmapnik_version} \ libmemcached11 \ librados2 ## Copy files from builder(s) ### mod_tile COPY --from=builder /tmp/mod_tile / COPY --from=builder \ /tmp/mod_tile_src/utils/example-map \ /usr/share/renderd/example-map COPY --from=builder \ /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \ /etc/apache2/sites-available/renderd-example-map.conf ## Fix mapnik directories RUN sed \ --expression "s#/usr/lib/mapnik/3.1/input#$(find /usr -mindepth 1 -type d -name input)#g" \ --expression "s#/usr/share/fonts/truetype#/usr/share/fonts#g" \ /usr/local/etc/renderd.conf > /etc/renderd.conf ## Add configuration RUN printf "LoadModule tile_module $(find /usr -name mod_tile.so)\n" > /etc/apache2/mods-available/tile.load RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-png32]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf RUN printf '\n[example-map-webp]\nMAXZOOM=20\nMINZOOM=0\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf ## Create missing directories RUN mkdir --parents /run/renderd /var/cache/renderd/tiles ## Enable module & site RUN a2enmod tile && \ a2ensite renderd-example-map ## Start services CMD apachectl -e debug -k start; \ G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground mod_tile-0.7.1/docs/000077500000000000000000000000001457537455600142705ustar00rootroot00000000000000mod_tile-0.7.1/docs/build/000077500000000000000000000000001457537455600153675ustar00rootroot00000000000000mod_tile-0.7.1/docs/build/building_on_centos.md000066400000000000000000000062461457537455600215650ustar00rootroot00000000000000# Building on CentOS This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. A Docker-based building & testing setup pipeline is also available [here](/docker) for your convenience. _CentOS does not provide a `mapnik`/`mapnik-devel` package, so it will first need to be built & installed, which is beyond the scope of this document, please visit the project's [installation document on GitHub](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) or our [Continuous Integration script](/.github/actions/dependencies/build-and-install/mapnik/action.yml) for more information._ ## CentOS 7 ```shell #!/usr/bin/env bash # Update installed packages sudo yum --assumeyes update # Install build dependencies # (libmemcached-devel & librados2-devel are optional) sudo yum --assumeyes install epel-release sudo yum --assumeyes --setopt=install_weak_deps=False install \ boost169-devel \ cairo-devel \ cmake3 \ gcc \ gcc-c++ \ gdal \ git \ glib2-devel \ harfbuzz-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libicu-devel \ libjpeg \ libmemcached-devel \ librados2-devel \ libtiff \ libwebp \ make \ proj # Download, Build, Test & Install `mod_tile` export CFLAGS="-I/usr/include/boost169" export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) export CXXFLAGS="-I/usr/include/boost169" rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake3 -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake3 --build . ctest3 sudo cmake --install . --strip # Create /usr/share/renderd directory sudo mkdir --parents /usr/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map # Add configuration sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /etc/httpd/conf.d/renderd-example-map.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Start services sudo httpd sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/build/building_on_centos_stream.md000066400000000000000000000070731457537455600231370ustar00rootroot00000000000000# Building on CentOS Stream This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. A Docker-based building & testing setup pipeline is also available [here](/docker) for your convenience. _CentOS Stream does not provide a `mapnik`/`mapnik-devel` package, so it will first need to be built & installed, which is beyond the scope of this document, please visit the project's [installation document on GitHub](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) or our [Continuous Integration script](/.github/actions/dependencies/build-and-install/mapnik/action.yml) for more information._ ## CentOS Stream 8 ```shell #!/usr/bin/env bash # Update config-manager DNF plugin sudo dnf --assumeyes install "dnf-command(config-manager)" # Enable PowerTools Repository sudo dnf config-manager --save --setopt=powertools.enabled=1 ``` ## CentOS Stream 9 ```shell #!/usr/bin/env bash # Update config-manager DNF plugin sudo dnf --assumeyes install "dnf-command(config-manager)" # Enable CRB Repository sudo dnf config-manager --save --setopt=crb.enabled=1 ``` ## CentOS Stream 8/9 ```shell #!/usr/bin/env bash # Update installed packages sudo dnf --assumeyes update # Install build dependencies # (libmemcached-devel & librados2-devel are optional) sudo dnf --assumeyes install epel-release sudo dnf --assumeyes --setopt=install_weak_deps=False install \ boost-devel \ cairo-devel \ cmake3 \ gcc \ gcc-c++ \ gdal \ git \ glib2-devel \ harfbuzz-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libicu-devel \ libjpeg \ libmemcached-devel \ librados2-devel \ libtiff \ libwebp \ make \ proj # Download, Build, Test & Install `mod_tile` export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake --build . ctest sudo cmake --install . --strip # Create /usr/share/renderd directory sudo mkdir --parents /usr/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map # Add configuration sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /etc/httpd/conf.d/renderd-example-map.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Start services sudo httpd sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/build/building_on_debian.md000066400000000000000000000053301457537455600215050ustar00rootroot00000000000000# Building on Debian This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. A Docker-based building & testing setup pipeline is also available [here](/docker) for your convenience. ## Debian 10/11/12 ```shell #!/usr/bin/env bash # Update installed packages sudo apt update && sudo apt --yes upgrade sudo apt --yes install --reinstall ca-certificates # Install build dependencies # (libmemcached-dev & librados-dev are optional) sudo apt --no-install-recommends --yes install \ apache2 \ apache2-dev \ cmake \ curl \ g++ \ gcc \ git \ libcairo2-dev \ libcurl4-openssl-dev \ libglib2.0-dev \ libiniparser-dev \ libmapnik-dev \ libmemcached-dev \ librados-dev # Download, Build, Test & Install `mod_tile` export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake --build . ctest sudo cmake --install . --strip # Create /usr/share/renderd directory sudo mkdir --parents /usr/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map # Add configuration sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Enable configuration a2enmod tile a2ensite renderd-example-map # Start services sudo apache2ctl start sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/build/building_on_fedora.md000066400000000000000000000051001457537455600215160ustar00rootroot00000000000000# Building on Fedora This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. A Docker-based building & testing setup pipeline is also available [here](/docker) for your convenience. ## Fedora 34/35/36/37/38/39 ```shell #!/usr/bin/env bash # Update installed packages sudo dnf --assumeyes update # Install build dependencies # (libmemcached-devel & librados-devel are optional) sudo dnf --assumeyes --setopt=install_weak_deps=False install \ cairo-devel \ cmake \ gcc \ gcc-c++ \ git \ glib2-devel \ httpd-devel \ iniparser-devel \ libcurl-devel \ libmemcached-devel \ librados-devel \ mapnik-devel # Download, Build, Test & Install `mod_tile` export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake --build . ctest sudo cmake --install . --strip # Create /usr/share/renderd directory sudo mkdir --parents /usr/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map # Add configuration sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /etc/httpd/conf.d/renderd-example-map.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Start services sudo httpd sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/build/building_on_freebsd.md000066400000000000000000000051421457537455600216760ustar00rootroot00000000000000# Building on FreeBSD This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. ## FreeBSD 12/13/14 ```shell #!/usr/bin/env sh # Mapnik is not in the `quarterly` repository (2023.10.12) sudo mkdir -p /usr/local/etc/pkg/repos sudo sed 's#/quarterly#/latest#g' /etc/pkg/FreeBSD.conf > /usr/local/etc/pkg/repos/FreeBSD.conf # Update installed packages sudo pkg upgrade --yes # Install build dependencies # (libmemcached & ceph14 are optional) sudo pkg install --yes \ apache24 \ cairo \ ceph14 \ cmake \ coreutils \ curl \ git \ glib \ iniparser \ libmemcached \ mapnik \ pkgconf # Download, Build, Test & Install `mod_tile` export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu) export LIBRARY_PATH="/usr/local/lib" rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake --build . ctest sudo cmake --install . --strip # Create /usr/share/renderd directory sudo mkdir -p /usr/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map # Add configuration sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /usr/local/etc/apache24/Includes/renderd-example-map.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Start services sudo httpd sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/build/building_on_macos.md000066400000000000000000000053221457537455600213660ustar00rootroot00000000000000# Building on macOS This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. ## macOS 11/12/13 ```shell #!/usr/bin/env bash # Update installed packages brew upgrade # Install build dependencies # (libmemcached is optional) brew install \ apr \ cairo \ cmake \ coreutils \ curl \ glib \ httpd \ iniparser \ libmemcached \ mapnik \ pkg-config # Download, Build, Test & Install `mod_tile` export CFLAGS="-Wno-implicit-function-declaration" export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) export ICU_ROOT=$(brew --prefix icu4c) export LDFLAGS="-undefined dynamic_lookup" export LIBRARY_PATH="/usr/local/lib" rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake --build . ctest sudo cmake --install . --strip # Create /usr/local/share/renderd directory sudo mkdir -p /usr/local/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/local/share/renderd/example-map # Add configuration sed 's#/usr/share/#/usr/local/share/#g' /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf | sudo tee /usr/local/etc/httpd/extra/renderd-example-map.conf printf '\nInclude /usr/local/etc/httpd/extra/httpd-tile.conf\nInclude /usr/local/etc/httpd/extra/renderd-example-map.conf\n' | sudo tee -a /usr/local/etc/httpd/httpd.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/local/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Start services httpd sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/build/building_on_opensuse.md000066400000000000000000000070111457537455600221220ustar00rootroot00000000000000# Building on openSUSE This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. A Docker-based building & testing setup pipeline is also available [here](/docker) for your convenience. _openSUSE does not provide a `mapnik`/`mapnik-devel` package, so it will first need to be built & installed, which is beyond the scope of this document, please visit the project's [installation document on GitHub](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) or our [Continuous Integration script](/.github/actions/dependencies/build-and-install/mapnik/action.yml) for more information._ ## openSUSE Leap 15/Tumbleweed ```shell #!/usr/bin/env bash # Update installed packages sudo zypper --non-interactive update # Install build dependencies # (libmemcached-devel & librados-devel are optional) sudo zypper --non-interactive install \ apache2-devel \ cairo-devel \ cmake \ curl \ gcc \ gcc-c++ \ gdal \ glib2-devel \ harfbuzz-devel \ libboost_atomic-devel \ libboost_filesystem-devel \ libboost_headers-devel \ libboost_program_options-devel \ libboost_regex-devel \ libboost_system-devel \ libcurl-devel \ libicu-devel \ libiniparser-devel \ libjpeg8-devel \ libmemcached-devel \ librados-devel \ libtiff-devel \ libwebp-devel \ libxml2-devel \ proj-devel \ tar # Create `nobody` user and group sudo useradd --home-dir / --no-create-home --shell /usr/sbin/nologin --system --user-group nobody # Download, Build, Test & Install `mod_tile` export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake --build . ctest sudo cmake --install . --strip # Create /usr/share/renderd directory sudo mkdir --parents /usr/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map # Add configuration sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /etc/apache2/conf.d/renderd-example-map.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Enable `mod_access_compat` sudo sed -i 's/^APACHE_MODULES="actions/APACHE_MODULES="access_compat actions/g' /etc/sysconfig/apache2 # Start services sudo apache2ctl start sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/build/building_on_ubuntu.md000066400000000000000000000053321457537455600216070ustar00rootroot00000000000000# Building on Ubuntu This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`. Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details. A Docker-based building & testing setup pipeline is also available [here](/docker) for your convenience. # Ubuntu 20.04/22.04 ```shell #!/usr/bin/env bash # Update installed packages sudo apt update && sudo apt --yes upgrade sudo apt --yes install --reinstall ca-certificates # Install build dependencies # (libmemcached-dev & librados-dev are optional) sudo apt --no-install-recommends --yes install \ apache2 \ apache2-dev \ cmake \ curl \ g++ \ gcc \ git \ libcairo2-dev \ libcurl4-openssl-dev \ libglib2.0-dev \ libiniparser-dev \ libmapnik-dev \ libmemcached-dev \ librados-dev # Download, Build, Test & Install `mod_tile` export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) rm -rf /tmp/mod_tile_src /tmp/mod_tile_build mkdir /tmp/mod_tile_src /tmp/mod_tile_build cd /tmp/mod_tile_src git clone --depth 1 https://github.com/openstreetmap/mod_tile.git . cd /tmp/mod_tile_build cmake -B . -S /tmp/mod_tile_src \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DENABLE_TESTS:BOOL=ON cmake --build . ctest sudo cmake --install . --strip # Create /usr/share/renderd directory sudo mkdir --parents /usr/share/renderd # Copy files of example map sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map # Add configuration sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf # Enable configuration a2enmod tile a2ensite renderd-example-map # Start services sudo apache2ctl start sudo renderd -f ``` Then you can visit: `http://localhost:8081/renderd-example-map` mod_tile-0.7.1/docs/man/000077500000000000000000000000001457537455600150435ustar00rootroot00000000000000mod_tile-0.7.1/docs/man/convert_meta.1000066400000000000000000000027731457537455600176240ustar00rootroot00000000000000.TH CONVERT_META "1" "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME convert_meta \- A conversion program from .png map tiles to a more efficient conglomerate format (.meta). .SH SYNOPSIS .B convert_meta .RI [ options ] .BR .SH DESCRIPTION This manual page documents briefly the .B convert_meta command. .PP .B convert_meta converts individual .png map tiles into the more efficient .meta file format. The .meta format stores a grid of 8x8 tiles in a single meta tile, reducing the number of files by a factor of 64. .PP .SH OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP \fB\-t\fR|\-\-tile-dir Specify the base directory where the tiles are stored. The default is /var/cache/renderd/tiles .TP \fB\-m\fR|\-\-map Specify the map style to convert. This specifies the full path to the files and is relative to the tile directory. The default is "default" and results in a full path of /var/cache/renderd/tiles/default to search for the tiles to convert .TP \fB\-u\fR|\-\-unpack Unpack the .meta files back to PNGs .TP \fB\-z\fR|\-\-min-zoom Specify the smallest zoom level to process. The default is 0. .TP \fB\-Z\fR|\-\-max-zoom Specify the largest zoom level up to which to process tiles. The default is 18. .PP .SH AUTHOR convert_meta was written by Jon Burgess and other OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/docs/man/openstreetmap-tiles-update-expire.1000066400000000000000000000034321457537455600237050ustar00rootroot00000000000000.TH TILES-UPDATE-EXPIRE "1" "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME openstreetmap-tiles-update-expire \- updates a map database from the OSM diff stream. .SH SYNOPSIS .B openstreetmap-tiles-update-expire .RI [ YYYY-MM-DD ] .BR .SH DESCRIPTION This manual page documents briefly the .B openstreetmap-tiles-update-expire command. .PP .B openstreetmap-tiles-update-expire is a helper script to keep a mod_tile based openstreetmap tile server up to date. It downloads a diff stream from OpenStreetMap using osmosis, then applies it to your database using osm2pgsql and finally marks changed tiles on disk as "dirty". .BR Each time you call this script, it does one update cycle. If your db is further behind than the maximum duration for which osmosis is configured to fetch diffs, the db will not be fully up-to-date at the end of this script and it will be necessary to call it multiple times for a fully up-to-date database. .BR This script can be used in conjunction with cron to automatically keep your database in sync with the OSM diff stream. .PP The first time this script needs to be called with a date to initialise the process. Thereafter, the script gets called without arguments. .PP .SH OPTIONS .TP \fBYYYY-MM-DD generation date of the planet file used for import. It initialises osmosis diff processing to this date. It is safe to set this date earlier than the actual date, as one can reapply diffs multiple times. This ensures that there is no missing data due to a gap between the generation of the planet file and the start of the diff processing. .PP .SH SEE ALSO .BR renderd(1) .BR .SH AUTHOR openstreetmap-tiles-update-expire was written by OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/docs/man/render_expired.1000066400000000000000000000064311457537455600201300ustar00rootroot00000000000000.TH RENDER_EXPIRED "1" "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME render_expired \- expires a list of map tiles so that they get re-rendered. .SH SYNOPSIS .B render_expired .RI [ options ] < "expire.list" .BR .SH DESCRIPTION This manual page documents briefly the .B render_expired command. .PP .B render_expired is a helper utility that takes a list of map tiles from stdin and expires them such that they will get re-rendered. Render_expired has three potential strategies of how to expire map tiles: .BR 1) Render tiles directly: Render_expired can connect to the renderd socket and submit rendering requests for expired tiles directly .BR 2) Delete tiles: Render_expired can delete expired tiles from disk. The next time the tile then gets viewed it will get re-rendered, assuming a dynamic rendering setup like mod_tile is installed .BR 3) Mark tiles as dirty: A dynamic tile rendering system like mod_tile decides if a tile needs re-rendering by comparing the timestamp of the tile with the time of the planet-import-complet timestamp. Render_expired can set the timestamp of a tile back many years, ensuring it is older than the db import time, thus causeing the tile to be considered dirty and in need for re-render. .PP These three strategies can be combined and applied at different zoom levels. E.g. Zoom level 17-18 get deleted, z11 - z16 get marked dirty and z6 - z10 get rendered directly. .PP Render_expired takes a list of tiles from stdin which should be expired. The format of the list is one tile per line specified as z/x/y. .BR 1/0/1 .BR 1/1/1 .BR 1/0/0 .BR 1/1/0 .PP render_expired will automatically expand the list to cover the effected tiles at other zoom levels. .PP .SH OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP \fB\-m\fR|\-\-map=MAP Specify the style-sheet for which to expire tiles. The default is "default". .TP \fB\-s\fR|\-\-socket=SOCKET|HOSTNAME:PORT Specify the location of the renderd socket or hostname and port to connect to. .TP \fB\-n\fR|\-\-num-threads=N Specify the number of parallel requests to renderd. Should renderd have less threads active, requests will be queued. The default is 1. default if \fB\-\-append\fR is not specified. .TP \fB\-t\fR|\-\-tile-dir=DIR Specify the base directory where the rendered tiles are. The default is '/var/cache/renderd/tiles' .TP \fB\-z\fR|\-\-min-zoom=ZOOM Filter input to only render tiles greater or equal to this zoom level (default is 0) .TP \fB\-Z\fR|\-\-max-zoom=ZOOM Filter input to only render tiles less than or equal to this zoom level (default is 18) .TP \fB\-d\fR|\-\-delete-from=ZOOM When expiring tiles of ZOOM or higher, delete them instead of re-rendering (default is off) .TP \fB\-T\fR|\-\-touch-from=ZOOM when expiring tiles of ZOOM or higher, touch them instead of re-rendering (default is off) .TP \-\-no-progress Disable display of progress messages (default is off) .TP \fB\-h\fR|\-\-help Print out a help text for render_expired .TP \fB\-V\fR|\-\-version Print out the version number for render_expired .PP .SH SEE ALSO .BR renderd(1) .BR .SH AUTHOR render_expire was written by OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/docs/man/render_list.1000066400000000000000000000044331457537455600174430ustar00rootroot00000000000000.TH RENDER_LIST "1" "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME render_list \- renders a list of map tiles by sending requests to a rendering daemon. .SH SYNOPSIS .B render_list .RI [ options ] < "render.list" .BR .SH DESCRIPTION This manual page briefly documents the .B render_list command. .PP .B render_list is a helper utility that takes a list of map tiles from stdin and sends the requests to a rendering daemon .PP .SH OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP \fB\-a\fR|\-\-all Render all tiles in given zoom level range instead of reading from STDIN. .TP \fB\-f\fR|\-\-force Render tiles even if they seem current. .TP \fB\-m\fR|\-\-map=MAP Render tiles in this map (defaults to 'default'). .TP \fB\-l\fR|\-\-max-load=LOAD Sleep if load is this high (defaults to 16). .TP \fB\-s\fR|\-\-socket=SOCKET|HOSTNAME:PORT Unix domain socket name or hostname and port for contacting renderd (default is '/run/renderd/renderd.sock'). .TP \fB\-n\fR|\-\-num-threads=N The number of parallel request threads (default 1). .TP \fB\-t\fR|\-\-tile-dir Tile cache directory (defaults to '/var/cache/renderd/tiles'). .TP \fB\-z\fR|\-\-min-zoom=ZOOM Filter input to only render tiles greater or equal to this zoom level (default is 0). .TP \fB\-Z\fR|\-\-max-zoom=ZOOM Filter input to only render tiles less than or equal to this zoom level (default is 20). .PP If you are using --all, you can restrict the tile range by adding these options: .BR -x, --min-x=X minimum X tile coordinate .BR -X, --max-x=X maximum X tile coordinate .BR -y, --min-y=Y minimum Y tile coordinate .BR -Y, --max-y=Y maximum Y tile coordinate .PP Without --all, send a list of tiles to be rendered from STDIN in the format: .BR X Y Z .BR e.g. .BR 0 0 1 .BR 0 1 1 .BR 1 0 1 .BR 1 1 1 .BR The above would cause all 4 tiles at zoom 1 to be rendered .TP \fB\-h\fR|\-\-help Print out a help text for render_list .TP \fB\-V\fR|\-\-version Print out the version number for render_list .PP .SH SEE ALSO .BR renderd(1) .BR .SH AUTHOR render_list was written by OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/docs/man/render_old.1000066400000000000000000000012041457537455600172370ustar00rootroot00000000000000.TH RENDER_OLD "1" "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME render_old \- renders a list of map tiles by sending requests to a rendering daemon. .SH SYNOPSIS .B render_list .RI [ options ] < "render.list" .BR .SH DESCRIPTION This manual page documents briefly the .B render_old command. .PP .B render_old is a helper utility that pre renders expired map tiles by sending appropriate requests to a rendering daemon .PP .SH SEE ALSO .BR renderd(1) .BR .SH AUTHOR render_expire was written by OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/docs/man/render_speedtest.1000066400000000000000000000026331457537455600204700ustar00rootroot00000000000000.TH RENDER_SPEEDTEST "1" "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME render_speedtest \- Benchmark tile rendering with renderd. .SH SYNOPSIS .B render_speedtest .RI [ options ] .SH DESCRIPTION This manual page documents briefly the .B render_speedtest command. .PP .B render_speedtest renders a bunch of tiles at various zoom levels to benchmark the speed of the rendering. .PP .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP \fB\-s\fR|\-\-socket=SOCKET|HOSTNAME:PORT Specify the location of the renderd socket or hostname and port to connect to. .TP \fB\-m\fR|\-\-map=MAP Specify the rendering style to test. The default is "default" .TP \fB\-n\fR|\-\-num-threads=N The number of parallel request threads (default 1). .TP \fB\-z\fR|\-\-min-zoom=ZOOM Only render tiles greater or equal to this zoom level (default is 0). .TP \fB\-Z\fR|\-\-max-zoom=ZOOM Only render tiles less than or equal to this zoom level (default is 20). .TP \fB\-h\fR|\-\-help Print out a help text for render_speedtest .TP \fB\-V\fR|\-\-version Print out the version number for render_speedtest .PP .SH SEE ALSO .BR renderd(1) .BR .SH AUTHOR render_speedtest was written by Jon Burgess and other OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/docs/man/renderd.1000066400000000000000000000032221457537455600165470ustar00rootroot00000000000000.TH RENDERD "1" "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME renderd \- Rendering daemon for rendering OpenStreetMap tiles. .SH SYNOPSIS .B renderd .RI [ options ] .BR .SH DESCRIPTION This manual page documents briefly the .B renderd command. .PP .B renderd is a rendering daemon for map tiles with the mapnik library. It receives render requests on a socket. Renderd queues requests in a number of different queues to manage load while rendering the requests with the mapnik library. By default renderd will start as a daemon. It will log information in the syslog. .PP .SH OPTIONS This programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP \fB\-f\fR|\-\-foreground Run renderd in the foreground for debugging purposes. .TP \fB\-c\fR|\-\-config Set the location of the config file used to configure the various parameters of renderd, like the mapnik style sheet. The default is /etc/renderd.conf .TP \fB\-s\fR|\-\-slave Renderd can be used in a distributed fashion across multiple rendering servers. The master renderd handles queuing and passes requests to the slaves. This parameter specifies which of the slave sections of renderd.conf applies to this instance of renderd. The default is to use the master section .TP \fB\-h\fR|\-\-help Print out a help text for renderd .TP \fB\-V\fR|\-\-version Print out the version number for renderd .PP .SH SEE ALSO .BR renderd.conf(5) .BR .SH AUTHOR renderd was written by Jon Burgess, and other OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/docs/man/renderd.conf.5000066400000000000000000000155451457537455600175120ustar00rootroot00000000000000.TH RENDERD.CONF 5 "2024-03-16" "mod_tile v0.7.1" .\" Please adjust this date whenever revising the manpage. .SH NAME renderd.conf \- Configuration file of rendering daemon for rendering OpenStreetMap tiles. .SH SYNOPSIS renderd.conf .SH DESCRIPTION This manual page documents briefly the \fBrenderd.conf\fR configuration file. .PP \fBrenderd.conf\fR is an INI configuration file for use with \fBrenderd(1)\fR. .PP The default location is \fB'/etc/renderd.conf'\fR (macro definition \fB'RENDERD_CONFIG'\fR). .PP All option names are \fBcase-insensitive\fR unless otherwise specified. .SH RENDERD Options belonging to a \fB[renderd]\fR section. .PP There must be at least one \fB[renderd]\fR section (e.g. \fB[renderd]\fR or \fB[renderd0]\fR). .PP By default, there can be up to \fB5\fR (macro definition \fB'MAX_SLAVES'\fR) \fB[renderd]\fR sections (e.g. \fB[renderd0]\fR - \fB[renderd4]\fR). .PP \fB[renderd]\fR section names must begin with \fB[renderd]\fR. .TP .B iphostname Specify the IP address/hostname to be used for communication with \fBrenderd\fR. This must be specified in combination with \fBipport\fR. This option and \fBsocketname\fR are mutually exclusive. .TP .B ipport Specify the port number to be used for communication with \fBrenderd\fR. This must be specified in combination with \fBiphostname\fR. This option and \fBsocketname\fR are mutually exclusive. .TP .B num_threads Specify the number of threads to be used for \fBrenderd\fR. The default value is \fB'4'\fR (macro definition \fB'NUM_THREADS'\fR). .TP .B pid_file Specify the file path into which the PID will be written by \fBrenderd\fR. It is only written to when \fBrenderd\fR is not running in \fBforeground\fR mode (e.g. without \fB'--foreground'\fR / \fB'-f')\fR. The default value is \fB'/run/renderd/renderd.pid'\fR (macro definition \fB'RENDERD_PIDFILE'\fR). .TP .B socketname Specify the file path to be used as a unix domain socket for communication with \fBrenderd\fR. This option and \fBiphostname\fR / \fBipport\fR are mutually exclusive. The default value is \fB'/run/renderd/renderd.sock'\fR (macro definition \fB'RENDERD_SOCKET'\fR). .TP .B stats_file Specify the file path into which statistics will be written by \fBrenderd\fR. By default, a stats file will not be created. .TP .B tile_dir Specify the directory path into which tiles will be written by \fBrenderd\fR. The default value is \fB'/var/cache/renderd/tiles'\fR (macro definition \fB'RENDERD_TILE_DIR'\fR). .SH MAPNIK Options belonging to the \fB[mapnik]\fR section. .PP There can be only one \fB[mapnik]\fR section. .PP \fB[mapnik]\fR section name must be equal to \fB[mapnik]\fR. .TP .B font_dir Specify the directory path where fonts are searched for by \fBlibmapnik\fR. The default value is the output of \fB'mapnik-config --fonts'\fR / \fB'pkgconf --variable=fonts_dir libmapnik'\fR (macro definition \fB'MAPNIK_FONTS_DIR'\fR). .TP .B font_dir_recurse Specify whether or not to recurse the \fBfont_dir\fR when searching for fonts by \fBlibmapnik\fR. The default value is \fB'false'\fR / \fB'0'\fR (macro definition \fB'MAPNIK_FONTS_DIR_RECURSE'\fR). .TP .B plugins_dir Specify the directory path where input plugins are searched for by \fBlibmapnik\fR. The default value is the output of \fB'mapnik-config --input-plugins'\fR / \fB'pkgconf --variable=plugins_dir libmapnik'\fR (macro definition \fB'MAPNIK_PLUGINS_DIR'\fR). .SH MAP SECTION Options belonging a \fB[map]\fR section. .PP There must be at least one \fB[map]\fR section. .PP \fB[map]\fR section names can neither begin with \fB[renderd]\fR nor be equal to \fB[mapnik]\fR. .PP \fB[map]\fR section names can be anything else, but they must all be unique. .TP .B ASPECTX Specify the X aspect to be used by \fBmod_tile\fR. Only used by \fBmod_tile\fR. The default value is \fB'1'\fR. This option name is \fBcase-sensitive\fR. .TP .B ASPECTY Specify the Y aspect to be used by \fBmod_tile\fR. Only used by \fBmod_tile\fR. The default value is \fB'1'\fR. This option name is \fBcase-sensitive\fR. .TP .B ATTRIBUTION Specify the data attribution to be provided by \fBmod_tile\fR as \fBTileJSON\fR (via \fB{URI}/tile-layer.json\fR). Only used by \fBmod_tile\fR. The default value is \fB'©OpenStreetMap and contributors, (ODbL)'\fR (macro definition \fB'DEFAULT_ATTRIBUTION'\fR). This option name is \fBcase-sensitive\fR. .TP .B CORS Specify the CORS configuration for \fBmod_tile\fR. Only used by \fBmod_tile\fR. This option name is \fBcase-sensitive\fR. .TP .B DESCRIPTION Specify the description to be provided by \fBmod_tile\fR as \fBTileJSON\fR (via \fB{URI}/tile-layer.json\fR). Only used by \fBmod_tile\fR. This option name is \fBcase-sensitive\fR. .TP .B htcphost Specify the IP address/hostname of the HTCP Host to be used by \fBrenderd\fR for HTCP cache expiry. Only used by \fBrenderd\fR. .TP .B host Specify the IP address/hostname of the Host to be used by \fBrenderd\fR for HTCP cache expiry. Only used by \fBrenderd\fR. .TP .B MAXZOOM Specify the maximum zoom level for this section. The default value is \fB'20'\fR (macro definition \fB'MAX_ZOOM'\fR). This option name is \fBcase-sensitive\fR. .TP .B MINZOOM Specify the minimum zoom level for this section. The default value is \fB'0'\fR. This option name is \fBcase-sensitive\fR. .TP .B PARAMETERIZE_STYLE Specify the parameterization style/function to be used for this section. The value of \fB'language'\fR seems to be the only one supported. This option name is \fBcase-sensitive\fR. .TP .B SERVER_ALIAS Specify a URL alias of this server to be provided by \fBmod_tile\fR as \fBTileJSON\fR (via \fB{URI}/tile-layer.json\fR). Only used by \fBmod_tile\fR. This option name is \fBcase-sensitive\fR. .TP .B scale Specify the scale for this section. Only used by \fBrenderd\fR. The default value is \fB'1.0'\fR. .TP .B TILEDIR Specify the directory path into which tiles will be written by \fBrenderd\fR. The default value is \fB'/var/cache/renderd/tiles'\fR (macro definition \fB'RENDERD_TILE_DIR'\fR). This option name is \fBcase-sensitive\fR. .TP .B tilesize Specify the tile size for this section. Only used by \fBrenderd\fR. The default value is \fB'256'\fR. .TP .B TYPE Specify the tile configuration (in the format \fB' '\fR) for this section (e.g. \fB'png image/png png256'\fR). This option name is \fBcase-sensitive\fR. .TP .B URI Specify the URI prefix with which tiles can be accessed for this section. This option name is \fBcase-sensitive\fR. .TP .B xml Specify the file path of the Mapnik configuration XML file for this section. Only used by \fBrenderd\fR. .SH SEE ALSO .BR renderd(1) .BR .SH AUTHOR renderd was written by Jon Burgess, and other OpenStreetMap project members. .PP This manual page was written by OpenStreetMap authors. mod_tile-0.7.1/etc/000077500000000000000000000000001457537455600141135ustar00rootroot00000000000000mod_tile-0.7.1/etc/apache2/000077500000000000000000000000001457537455600154165ustar00rootroot00000000000000mod_tile-0.7.1/etc/apache2/renderd-example-map.conf000066400000000000000000000203511457537455600221150ustar00rootroot00000000000000Alias /renderd-example-map /usr/share/renderd/example-map Redirect /renderd-example-map/leaflet/leaflet.css https://unpkg.com/leaflet/dist/leaflet.css Redirect /renderd-example-map/leaflet/leaflet.min.js https://unpkg.com/leaflet/dist/leaflet.js Options +FollowSymLinks AllowOverride All Order Allow,Deny Allow from all Require all granted Listen 8081 ModTileTileDir /var/cache/renderd/tiles # You can manually configure each tile set with AddTileConfig or AddTileMimeConfig. # The first argument is the URL path relative to this virtual host # under which a tile set is served. The second argument specifies the # name of the tile set. This is used in the communication with renderd # and is the directory under which (meta)tiles are stored on disk. # # By default (AddTileConfig) mod_tile assumes you are serving png files, however, # mod_tile can also serve arbitrary other tile types such as javascript vector tiles, # assuming the backend render daemon can handle the file type. # To this purpose AddTileMimeConfig takes a 3rd agument, the file extension and it # will guess the correct mimetype from it. If the mime type is not set correctly automatically, # you need to use the configuration file route, where you can specify the mimetype and file extension # independently. # #AddTileConfig /folder/ TileSetName #AddTileMimeConfig /folder2/ TileSetName2 js # Alternatively (or in addition) you can load all the tile sets defined in the configuration file into this virtual host LoadTileConfigFile /etc/renderd.conf # Specify if mod_tile should keep tile delivery stats, which can be accessed from the URL /mod_tile # The default is On. As keeping stats needs to take a lock, this might have some performance impact, # but for nearly all intents and purposes this should be negligable and so it is safe to keep this turned on. ModTileEnableStats On # Turns on bulk mode. In bulk mode, mod_tile does not request any dirty tiles to be rerendered. Missing tiles # are always requested in the lowest priority. The default is Off. ModTileBulkMode Off # Timeout before giving up for a tile to be rendered ModTileRequestTimeout 3 # Timeout before giving up for a tile to be rendered that is otherwise missing ModTileMissingRequestTimeout 10 # If tile is out of date, don't re-render it if past this load threshold (users gets old tile) ModTileMaxLoadOld 2 # If tile is missing, don't render it if past this load threshold (user gets 404 error) ModTileMaxLoadMissing 5 # Socket where we connect to the rendering daemon ModTileRenderdSocketName /run/renderd/renderd.sock # Options controlling the cache proxy expiry headers. All values are in seconds. # # Caching is both important to reduce the load and bandwidth of the server, as # well as reduce the load time for the user. The site loads fastest if tiles can be # taken from the users browser cache and no round trip through the internet is needed. # With minutely or hourly updates, however there is a trade-off between cacheability # and freshness. As one can't predict the future, these are only heuristics, that # need tuning. # If there is a known update schedule such as only using weekly planet dumps to update the db, # this can also be taken into account through the constant PLANET_INTERVAL in render_config.h # but requires a recompile of mod_tile # The values in this sample configuration are not the same as the defaults # that apply if the config settings are left out. The defaults are more conservative # and disable most of the heuristics. # Caching is always a trade-off between being up to date and reducing server load or # client side latency and bandwidth requirements. Under some conditions, like poor # network conditions it might be more important to have good caching rather than the latest tiles. # Therefor the following config options allow to set a special hostheader for which the caching # behaviour is different to the normal heuristics # # The CacheExtended parameters overwrite all other caching parameters (including CacheDurationMax) # for tiles being requested via the hostname CacheExtendedHostname # #ModTileCacheExtendedHostname cache.tile.openstreetmap.org #ModTileCacheExtendedDuration 2592000 # Upper bound on the length a tile will be set cacheable, which takes # precedence over other settings of cacheing ModTileCacheDurationMax 604800 # Sets the time tiles can be cached for that are known to by outdated and have been # sent to renderd to be rerendered. This should be set to a value corresponding # roughly to how long it will take renderd to get through its queue. There is an additional # fuzz factor on top of this to not have all tiles expire at the same time ModTileCacheDurationDirty 900 # Specify the minimum time mod_tile will set the cache expiry to for fresh tiles. There # is an additional fuzz factor of between 0 and 3 hours on top of this. ModTileCacheDurationMinimum 10800 # Lower zoom levels are less likely to change noticeable, so these could be cached for longer # without users noticing much. # The heuristic offers three levels of zoom, Low, Medium and High, for which different minimum # cacheing times can be specified. #Specify the zoom level below which Medium starts and the time in seconds for which they can be cached ModTileCacheDurationMediumZoom 13 86400 #Specify the zoom level below which Low starts and the time in seconds for which they can be cached ModTileCacheDurationLowZoom 9 518400 # A further heuristic to determine cacheing times is when was the last time a tile has changed. # If it hasn't changed for a while, it is less likely to change in the immediate future, so the # tiles can be cached for longer. # For example, if the factor is 0.20 and the tile hasn't changed in the last 5 days, it can be cached # for up to one day without having to re-validate. ModTileCacheLastModifiedFactor 0.20 # Tile Throttling # Tile scrapers can often download large numbers of tiles and overly strain tileserver resources # mod_tile therefore offers the ability to automatically throttle requests from ip addresses that have # requested a lot of tiles. # The mechanism uses a token bucket approach to shape traffic. I.e. there is an initial pool of n tiles # per ip that can be requested arbitrarily fast. After that this pool gets filled up at a constant rate # The algorithm has two metrics. One based on overall tiles served to an ip address and a second one based on # the number of requests to renderd / tirex to render a new tile. # Overall enable or disable tile throttling ModTileEnableTileThrottling Off # Specify if you want to use the connecting IP for throtteling, or use the X-Forwarded-For header to determin the # 1 - use the client IP address, i.e. the first entry in the X-Forwarded-For list. This works through a cascade of proxies. # However, as the X-Forwarded-For is written by the client this is open to manipulation and can be used to circumvent the throttling # 2 - use the last specified IP in the X-Forwarded-For list. If you know all requests come through a reverse proxy # that adds an X-Forwarded-For header, you can trust this IP to be the IP the reverse proxy saw for the request ModTileEnableTileThrottlingXForward 0 # Parameters (poolsize in tiles and topup rate in tiles per second) for throttling tile serving. ModTileThrottlingTiles 10000 1 # Parameters (poolsize in tiles and topup rate in tiles per second) for throttling render requests. ModTileThrottlingRenders 128 0.2 # Enable the .../Z/X/Y.ext/status URL, which shows details of that tile. # Off = a 404 is returned for that url instead. # Default: On #ModTileEnableStatusURL Off # Enable the .../Z/X/Y.ext/dirty URL, which marks that tile as dirty. # Off = a 404 is returned for that url instead. # Default: On #ModTileEnableDirtyURL Off mod_tile-0.7.1/etc/apache2/tile.load.in000066400000000000000000000000761457537455600176240ustar00rootroot00000000000000LoadModule tile_module @CMAKE_INSTALL_MODULESDIR@/mod_tile.so mod_tile-0.7.1/etc/renderd/000077500000000000000000000000001457537455600155365ustar00rootroot00000000000000mod_tile-0.7.1/etc/renderd/renderd.conf000066400000000000000000000005071457537455600200320ustar00rootroot00000000000000; BASIC AND SIMPLE CONFIGURATION: [renderd] pid_file=/run/renderd/renderd.pid stats_file=/run/renderd/renderd.stats socketname=/run/renderd/renderd.sock num_threads=4 tile_dir=/var/cache/renderd/tiles [mapnik] plugins_dir=/usr/lib/mapnik/3.1/input font_dir=/usr/share/fonts/truetype font_dir_recurse=true ; ADD YOUR LAYERS: mod_tile-0.7.1/etc/renderd/renderd.conf.examples000066400000000000000000000046551457537455600216570ustar00rootroot00000000000000; EXAMPLES FOR BASIC CONFIGURATION OPTIONS [renderd] pid_file=/run/renderd/renderd.pid stats_file=/run/renderd/renderd.stats socketname=/run/renderd/renderd.sock num_threads=4 tile_dir=/var/cache/renderd/tiles ;[renderd] ;iphostname=::1 ;ipport=7654 ;num_threads=4 ;tile_dir=rados://tiles/etc/ceph/ceph.conf ;pid_file=/run/renderd/renderd_rados.pid ;stats_file=/run/renderd/renderd.stats ;[renderd] ;iphostname=::1 ;ipport=7654 ;num_threads=8 ;tile_dir=memcached:// ;pid_file=/run/renderd/renderd_memcached.pid ;stats_file=/run/renderd/renderd.stats ; EXAMPLE FOR MAPNIK CONFIGURATION OPTION [mapnik] plugins_dir=/usr/lib/mapnik/3.0/input font_dir=/usr/share/fonts/truetype font_dir_recurse=true ; EXAMPLES FOR LAYER CONFIGURATION OPTIONS [example-map] URI=/tiles/renderd-example XML=/var/www/example-map/mapnik.xml ;[style1] ;URI=/osm_tiles/ ;TILEDIR=/var/cache/renderd/tiles ;XML=/usr/share/renderd/openstreetmap/osm-local.xml ;HOST=tile.openstreetmap.org ;TILESIZE=256 ;HTCPHOST=proxy.openstreetmap.org ;** config options used by mod_tile, but not renderd ** ;MINZOOM=0 ;MAXZOOM=18 ;TYPE=png image/png png256 ; Values are: (for more information about output format see https://github.com/mapnik/mapnik/wiki/Image-IO) ;DESCRIPTION=This is a description of the tile layer used in the tile json request ;ATTRIBUTION=©OpenStreetMap and contributors, ODbL ;SERVER_ALIAS=http://localhost/ ;CORS=http://www.openstreetmap.org ;ASPECTX=1 ;ASPECTY=1 ;SCALE=1.0 ;[style2] ;URI=/osm_tiles2/ ;TILEDIR=rados://tiles/etc/ceph/ceph.conf ;TILESIZE=512 ;XML=/usr/share/renderd/openstreetmap/osm-local2.xml ;HOST=tile.openstreetmap.org ;HTCPHOST=proxy.openstreetmap.org ;** config options used by mod_tile, but not renderd ** ;MINZOOM=0 ;MAXZOOM=22 ;TYPE=png image/png png256 ; Values are: (for more information about output format see https://github.com/mapnik/mapnik/wiki/Image-IO) ;DESCRIPTION=This is a description of the tile layer used in the tile json request ;ATTRIBUTION=©OpenStreetMap and contributors, ODbL ;SERVER_ALIAS=http://localhost/ ;CORS=* mod_tile-0.7.1/etc/renderd/renderd.conf.in000066400000000000000000000003731457537455600204400ustar00rootroot00000000000000[renderd] pid_file=@RENDERD_PIDFILE@ socketname=@RENDERD_SOCKET@ stats_file=@RENDERD_RUN_DIR@/renderd.stats tile_dir=@RENDERD_TILE_DIR@ [mapnik] font_dir=@MAPNIK_FONTS_DIR@ font_dir_recurse=@MAPNIK_FONTS_DIR_RECURSE@ plugins_dir=@MAPNIK_PLUGINS_DIR@ mod_tile-0.7.1/includes/000077500000000000000000000000001457537455600151465ustar00rootroot00000000000000mod_tile-0.7.1/includes/cache_expire.h000066400000000000000000000020101457537455600177270ustar00rootroot00000000000000/* * Copyright (c) 2007 - 2023 by mod_tile contributors (see AUTHORS file) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; If not, see http://www.gnu.org/licenses/. */ #ifndef CACHEEXPIRE_H #define CACHEEXPIRE_H #ifdef __cplusplus extern "C" { #endif #define HTCP_EXPIRE_CACHE 1 #define HTCP_EXPIRE_CACHE_PORT "4827" void cache_expire(int sock, char * host, char * uri, int x, int y, int z); int init_cache_expire(char * htcphost); #ifdef __cplusplus } #endif #endif mod_tile-0.7.1/includes/catch/000077500000000000000000000000001457537455600162305ustar00rootroot00000000000000mod_tile-0.7.1/includes/catch/catch.hpp000066400000000000000000024040031457537455600200260ustar00rootroot00000000000000/* * Catch v2.13.10 * Generated: 2022-10-16 11:01:23.452308 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED #define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED // start catch.hpp #define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MINOR 13 #define CATCH_VERSION_PATCH 10 #ifdef __clang__ # pragma clang system_header #elif defined __GNUC__ # pragma GCC system_header #endif // start catch_suppress_warnings.h #ifdef __clang__ # ifdef __ICC // icpc defines the __clang__ macro # pragma warning(push) # pragma warning(disable: 161 1682) # else // __ICC # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wswitch-enum" # pragma clang diagnostic ignored "-Wcovered-switch-default" # endif #elif defined __GNUC__ // Because REQUIREs trigger GCC's -Wparentheses, and because still // supported version of g++ have only buggy support for _Pragmas, // Wparentheses have to be suppressed globally. # pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-variable" # pragma GCC diagnostic ignored "-Wpadded" #endif // end catch_suppress_warnings.h #if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) # define CATCH_IMPL # define CATCH_CONFIG_ALL_PARTS #endif // In the impl file, we want to have access to all parts of the headers // Can also be used to sanely support PCHs #if defined(CATCH_CONFIG_ALL_PARTS) # define CATCH_CONFIG_EXTERNAL_INTERFACES # if defined(CATCH_CONFIG_DISABLE_MATCHERS) # undef CATCH_CONFIG_DISABLE_MATCHERS # endif # if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) # define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER # endif #endif #if !defined(CATCH_CONFIG_IMPL_ONLY) // start catch_platform.h // See e.g.: // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ # include # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) # define CATCH_PLATFORM_MAC # elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) # define CATCH_PLATFORM_IPHONE # endif #elif defined(linux) || defined(__linux) || defined(__linux__) # define CATCH_PLATFORM_LINUX #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) # define CATCH_PLATFORM_WINDOWS #endif // end catch_platform.h #ifdef CATCH_IMPL # ifndef CLARA_CONFIG_MAIN # define CLARA_CONFIG_MAIN_NOT_DEFINED # define CLARA_CONFIG_MAIN # endif #endif // start catch_user_interfaces.h namespace Catch { unsigned int rngSeed(); } // end catch_user_interfaces.h // start catch_tag_alias_autoregistrar.h // start catch_common.h // start catch_compiler_capabilities.h // Detect a number of compiler features - by compiler // The following features are defined: // // CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? // CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? // CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? // CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? // **************** // Note to maintainers: if new toggles are added please document them // in configuration.md, too // **************** // In general each macro has a _NO_ form // (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. // Many features, at point of detection, define an _INTERNAL_ macro, so they // can be combined, en-mass, with the _NO_ forms later. #ifdef __cplusplus # if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) # define CATCH_CPP14_OR_GREATER # endif # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) # define CATCH_CPP17_OR_GREATER # endif #endif // Only GCC compiler should be used in this block, so other compilers trying to // mask themselves as GCC should be ignored. #if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) #endif #if defined(__clang__) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) // As of this writing, IBM XL's implementation of __builtin_constant_p has a bug // which results in calls to destructors being emitted for each temporary, // without a matching initialization. In practice, this can result in something // like `std::string::~string` being called on an uninitialized value. // // For example, this code will likely segfault under IBM XL: // ``` // REQUIRE(std::string("12") + "34" == "1234") // ``` // // Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. # if !defined(__ibmxl__) && !defined(__CUDACC__) # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ # endif # define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) # define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) # define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) # define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wunused-template\"" ) #endif // __clang__ //////////////////////////////////////////////////////////////////////////////// // Assume that non-Windows platforms support posix signals by default #if !defined(CATCH_PLATFORM_WINDOWS) #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS #endif //////////////////////////////////////////////////////////////////////////////// // We know some environments not to support full POSIX signals #if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS #endif #ifdef __OS400__ # define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS # define CATCH_CONFIG_COLOUR_NONE #endif //////////////////////////////////////////////////////////////////////////////// // Android somehow still does not support std::to_string #if defined(__ANDROID__) # define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING # define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE #endif //////////////////////////////////////////////////////////////////////////////// // Not all Windows environments support SEH properly #if defined(__MINGW32__) # define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH #endif //////////////////////////////////////////////////////////////////////////////// // PS4 #if defined(__ORBIS__) # define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE #endif //////////////////////////////////////////////////////////////////////////////// // Cygwin #ifdef __CYGWIN__ // Required for some versions of Cygwin to declare gettimeofday // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin # define _BSD_SOURCE // some versions of cygwin (most) do not support std::to_string. Use the libstd check. // https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 # if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) # define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING # endif #endif // __CYGWIN__ //////////////////////////////////////////////////////////////////////////////// // Visual C++ #if defined(_MSC_VER) // Universal Windows platform does not support SEH // Or console colours (or console at all...) # if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) # define CATCH_CONFIG_COLOUR_NONE # else # define CATCH_INTERNAL_CONFIG_WINDOWS_SEH # endif # if !defined(__clang__) // Handle Clang masquerading for msvc // MSVC traditional preprocessor needs some workaround for __VA_ARGS__ // _MSVC_TRADITIONAL == 0 means new conformant preprocessor // _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor # if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) # define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR # endif // MSVC_TRADITIONAL // Only do this if we're not using clang on Windows, which uses `diagnostic push` & `diagnostic pop` # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) ) # endif // __clang__ #endif // _MSC_VER #if defined(_REENTRANT) || defined(_MSC_VER) // Enable async processing, as -pthread is specified or no additional linking is required # define CATCH_INTERNAL_CONFIG_USE_ASYNC #endif // _MSC_VER //////////////////////////////////////////////////////////////////////////////// // Check if we are compiled with -fno-exceptions or equivalent #if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) # define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED #endif //////////////////////////////////////////////////////////////////////////////// // DJGPP #ifdef __DJGPP__ # define CATCH_INTERNAL_CONFIG_NO_WCHAR #endif // __DJGPP__ //////////////////////////////////////////////////////////////////////////////// // Embarcadero C++Build #if defined(__BORLANDC__) #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN #endif //////////////////////////////////////////////////////////////////////////////// // Use of __COUNTER__ is suppressed during code analysis in // CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly // handled by it. // Otherwise all supported compilers support COUNTER macro, // but user still might want to turn it off #if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) #define CATCH_INTERNAL_CONFIG_COUNTER #endif //////////////////////////////////////////////////////////////////////////////// // RTX is a special version of Windows that is real time. // This means that it is detected as Windows, but does not provide // the same set of capabilities as real Windows does. #if defined(UNDER_RTSS) || defined(RTX64_BUILD) #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH #define CATCH_INTERNAL_CONFIG_NO_ASYNC #define CATCH_CONFIG_COLOUR_NONE #endif #if !defined(_GLIBCXX_USE_C99_MATH_TR1) #define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER #endif // Various stdlib support checks that require __has_include #if defined(__has_include) // Check if string_view is available and usable #if __has_include() && defined(CATCH_CPP17_OR_GREATER) # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW #endif // Check if optional is available and usable # if __has_include() && defined(CATCH_CPP17_OR_GREATER) # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) // Check if byte is available and usable # if __has_include() && defined(CATCH_CPP17_OR_GREATER) # include # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) # define CATCH_INTERNAL_CONFIG_CPP17_BYTE # endif # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) // Check if variant is available and usable # if __has_include() && defined(CATCH_CPP17_OR_GREATER) # if defined(__clang__) && (__clang_major__ < 8) // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 // fix should be in clang 8, workaround in libstdc++ 8.2 # include # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) # define CATCH_CONFIG_NO_CPP17_VARIANT # else # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) # else # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT # endif // defined(__clang__) && (__clang_major__ < 8) # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) #endif // defined(__has_include) #if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) # define CATCH_CONFIG_COUNTER #endif #if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) # define CATCH_CONFIG_WINDOWS_SEH #endif // This is set by default, because we assume that unix compilers are posix-signal-compatible by default. #if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) # define CATCH_CONFIG_POSIX_SIGNALS #endif // This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. #if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) # define CATCH_CONFIG_WCHAR #endif #if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) # define CATCH_CONFIG_CPP11_TO_STRING #endif #if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) # define CATCH_CONFIG_CPP17_OPTIONAL #endif #if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) # define CATCH_CONFIG_CPP17_STRING_VIEW #endif #if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) # define CATCH_CONFIG_CPP17_VARIANT #endif #if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE) # define CATCH_CONFIG_CPP17_BYTE #endif #if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) # define CATCH_INTERNAL_CONFIG_NEW_CAPTURE #endif #if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) # define CATCH_CONFIG_NEW_CAPTURE #endif #if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) # define CATCH_CONFIG_DISABLE_EXCEPTIONS #endif #if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) # define CATCH_CONFIG_POLYFILL_ISNAN #endif #if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) # define CATCH_CONFIG_USE_ASYNC #endif #if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE) # define CATCH_CONFIG_ANDROID_LOGWRITE #endif #if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) # define CATCH_CONFIG_GLOBAL_NEXTAFTER #endif // Even if we do not think the compiler has that warning, we still have // to provide a macro that can be used by the code. #if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION #endif #if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION #endif #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS #endif // The goal of this macro is to avoid evaluation of the arguments, but // still have the compiler warn on problems inside... #if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) #endif #if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) # undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #elif defined(__clang__) && (__clang_major__ < 5) # undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) # define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #endif #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) #define CATCH_TRY if ((true)) #define CATCH_CATCH_ALL if ((false)) #define CATCH_CATCH_ANON(type) if ((false)) #else #define CATCH_TRY try #define CATCH_CATCH_ALL catch (...) #define CATCH_CATCH_ANON(type) catch (type) #endif #if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) #define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #endif // end catch_compiler_capabilities.h #define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line #define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) #ifdef CATCH_CONFIG_COUNTER # define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) #else # define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) #endif #include #include #include // We need a dummy global operator<< so we can bring it into Catch namespace later struct Catch_global_namespace_dummy {}; std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); namespace Catch { struct CaseSensitive { enum Choice { Yes, No }; }; class NonCopyable { NonCopyable( NonCopyable const& ) = delete; NonCopyable( NonCopyable && ) = delete; NonCopyable& operator = ( NonCopyable const& ) = delete; NonCopyable& operator = ( NonCopyable && ) = delete; protected: NonCopyable(); virtual ~NonCopyable(); }; struct SourceLineInfo { SourceLineInfo() = delete; SourceLineInfo( char const* _file, std::size_t _line ) noexcept : file( _file ), line( _line ) {} SourceLineInfo( SourceLineInfo const& other ) = default; SourceLineInfo& operator = ( SourceLineInfo const& ) = default; SourceLineInfo( SourceLineInfo&& ) noexcept = default; SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; bool empty() const noexcept { return file[0] == '\0'; } bool operator == ( SourceLineInfo const& other ) const noexcept; bool operator < ( SourceLineInfo const& other ) const noexcept; char const* file; std::size_t line; }; std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); // Bring in operator<< from global namespace into Catch namespace // This is necessary because the overload of operator<< above makes // lookup stop at namespace Catch using ::operator<<; // Use this in variadic streaming macros to allow // >> +StreamEndStop // as well as // >> stuff +StreamEndStop struct StreamEndStop { std::string operator+() const; }; template T const& operator + ( T const& value, StreamEndStop ) { return value; } } #define CATCH_INTERNAL_LINEINFO \ ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) // end catch_common.h namespace Catch { struct RegistrarForTagAliases { RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); }; } // end namespace Catch #define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION // end catch_tag_alias_autoregistrar.h // start catch_test_registry.h // start catch_interfaces_testcase.h #include namespace Catch { class TestSpec; struct ITestInvoker { virtual void invoke () const = 0; virtual ~ITestInvoker(); }; class TestCase; struct IConfig; struct ITestCaseRegistry { virtual ~ITestCaseRegistry(); virtual std::vector const& getAllTests() const = 0; virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; }; bool isThrowSafe( TestCase const& testCase, IConfig const& config ); bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); std::vector const& getAllTestCasesSorted( IConfig const& config ); } // end catch_interfaces_testcase.h // start catch_stringref.h #include #include #include #include namespace Catch { /// A non-owning string class (similar to the forthcoming std::string_view) /// Note that, because a StringRef may be a substring of another string, /// it may not be null terminated. class StringRef { public: using size_type = std::size_t; using const_iterator = const char*; private: static constexpr char const* const s_empty = ""; char const* m_start = s_empty; size_type m_size = 0; public: // construction constexpr StringRef() noexcept = default; StringRef( char const* rawChars ) noexcept; constexpr StringRef( char const* rawChars, size_type size ) noexcept : m_start( rawChars ), m_size( size ) {} StringRef( std::string const& stdString ) noexcept : m_start( stdString.c_str() ), m_size( stdString.size() ) {} explicit operator std::string() const { return std::string(m_start, m_size); } public: // operators auto operator == ( StringRef const& other ) const noexcept -> bool; auto operator != (StringRef const& other) const noexcept -> bool { return !(*this == other); } auto operator[] ( size_type index ) const noexcept -> char { assert(index < m_size); return m_start[index]; } public: // named queries constexpr auto empty() const noexcept -> bool { return m_size == 0; } constexpr auto size() const noexcept -> size_type { return m_size; } // Returns the current start pointer. If the StringRef is not // null-terminated, throws std::domain_exception auto c_str() const -> char const*; public: // substrings and searches // Returns a substring of [start, start + length). // If start + length > size(), then the substring is [start, size()). // If start > size(), then the substring is empty. auto substr( size_type start, size_type length ) const noexcept -> StringRef; // Returns the current start pointer. May not be null-terminated. auto data() const noexcept -> char const*; constexpr auto isNullTerminated() const noexcept -> bool { return m_start[m_size] == '\0'; } public: // iterators constexpr const_iterator begin() const { return m_start; } constexpr const_iterator end() const { return m_start + m_size; } }; auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { return StringRef( rawChars, size ); } } // namespace Catch constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { return Catch::StringRef( rawChars, size ); } // end catch_stringref.h // start catch_preprocessor.hpp #define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ #define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) #define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) #ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ // MSVC needs more evaluations #define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) #define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) #else #define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) #endif #define CATCH_REC_END(...) #define CATCH_REC_OUT #define CATCH_EMPTY() #define CATCH_DEFER(id) id CATCH_EMPTY() #define CATCH_REC_GET_END2() 0, CATCH_REC_END #define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 #define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 #define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT #define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) #define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) #define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) #define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) #define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) #define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) #define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) #define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) // Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, // and passes userdata as the first parameter to each invocation, // e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) #define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) #define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) #define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) #define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ #define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ #define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF #define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ #define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) #else // MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF #define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) #define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ #define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) #endif #define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ #define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) #define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) #define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) #else #define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) #define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) #endif #define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) #define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) #define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) #define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) #define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) #define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) #define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) #define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6) #define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) #define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) #define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) #define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) #define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N #define INTERNAL_CATCH_TYPE_GEN\ template struct TypeList {};\ template\ constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ template class...> struct TemplateTypeList{};\ template class...Cs>\ constexpr auto get_wrapper() noexcept -> TemplateTypeList { return {}; }\ template\ struct append;\ template\ struct rewrap;\ template class, typename...>\ struct create;\ template class, typename>\ struct convert;\ \ template \ struct append { using type = T; };\ template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ struct append, L2, Rest...> { using type = typename append, Rest...>::type; };\ template< template class L1, typename...E1, typename...Rest>\ struct append, TypeList, Rest...> { using type = L1; };\ \ template< template class Container, template class List, typename...elems>\ struct rewrap, List> { using type = TypeList>; };\ template< template class Container, template class List, class...Elems, typename...Elements>\ struct rewrap, List, Elements...> { using type = typename append>, typename rewrap, Elements...>::type>::type; };\ \ template