├── mapproxy ├── debian │ ├── compat │ ├── ctt-vts-mapproxy.docs │ ├── ctt-vts-mapproxy-tools.docs │ ├── source │ │ └── format │ ├── vts-mapproxy.install │ ├── README │ ├── .gitignore │ ├── ctt-vts-mapproxy.copyright │ ├── ctt-vts-mapproxy-tools.copyright │ ├── fix-shlibs.sh │ ├── jammy │ │ └── control │ ├── focal │ │ └── control │ ├── jessie │ │ └── control │ ├── xenial │ │ └── control │ ├── wheezy │ │ ├── control.footer │ │ └── control │ ├── stretch │ │ └── control │ ├── buster │ │ └── control │ ├── bullseye │ │ └── control │ ├── bionic │ │ └── control │ ├── templates │ │ └── control.template │ └── rules ├── Makefile ├── buildsys ├── src │ ├── geo │ ├── half │ ├── qmf │ ├── http │ ├── math │ ├── dbglog │ ├── geometry │ ├── imgproc │ ├── jsoncpp │ ├── miniball │ ├── pydbglog │ ├── semantic │ ├── service │ ├── shtools │ ├── utility │ ├── vts-libs │ ├── pysupport │ ├── gdal-drivers │ ├── mapproxy │ │ ├── cesium │ │ │ ├── melown-technologies-logo-28.png │ │ │ └── cesium.html │ │ ├── generator │ │ │ ├── files │ │ │ │ ├── defaultstyle.json │ │ │ │ ├── defaultstyle.mesh.json │ │ │ │ ├── cesiumreadme.md │ │ │ │ └── wmtsreadme.md │ │ │ ├── files.hpp │ │ │ ├── tms-raster-patchwork.hpp │ │ │ ├── tms-raster-solid.hpp │ │ │ ├── registry.cpp │ │ │ ├── tms-bing.hpp │ │ │ ├── factory.hpp │ │ │ ├── files.cpp │ │ │ ├── surface-meta.hpp │ │ │ ├── geodata-vector.hpp │ │ │ ├── geodata-vector-tiled.hpp │ │ │ ├── surface-spheroid.hpp │ │ │ └── geodata-mesh.hpp │ │ ├── browser2d │ │ │ └── index.html │ │ ├── ol │ │ │ ├── ol.html │ │ │ └── ol.js │ │ ├── test │ │ │ └── CMakeLists.txt │ │ ├── gdalsupport │ │ │ ├── workrequest.cpp │ │ │ ├── workrequestfwd.hpp │ │ │ ├── requestbase.hpp │ │ │ ├── datasetcache.cpp │ │ │ ├── datasetcache.hpp │ │ │ ├── operations.hpp │ │ │ └── workrequest.hpp │ │ ├── ol.hpp │ │ ├── cesium.hpp │ │ ├── browser2d.hpp │ │ ├── definition.hpp │ │ ├── definition │ │ │ ├── geodata-vector.cpp │ │ │ ├── options.hpp │ │ │ ├── parse.hpp │ │ │ ├── options.cpp │ │ │ ├── tms-raster-patchwork.cpp │ │ │ ├── tms-common.cpp │ │ │ ├── factory.cpp │ │ │ ├── surface-meta.hpp │ │ │ ├── tms-bing.cpp │ │ │ ├── tms-raster-solid.cpp │ │ │ ├── parse.cpp │ │ │ ├── tms-raster-remote.cpp │ │ │ ├── factory.hpp │ │ │ ├── tms-windyty.cpp │ │ │ ├── surface-spheroid.cpp │ │ │ ├── surface-meta.cpp │ │ │ └── tms-raster-synthetic.cpp │ │ ├── support │ │ │ ├── aborter.hpp │ │ │ ├── atlas.hpp │ │ │ ├── revision.hpp │ │ │ ├── wmts.hpp │ │ │ ├── cesiumconf.hpp │ │ │ ├── cesiumconf.cpp │ │ │ ├── coverage.hpp │ │ │ ├── layerenancer.hpp │ │ │ ├── srs.hpp │ │ │ ├── atlas.cpp │ │ │ ├── mmapped │ │ │ │ ├── tilesetindex.cpp │ │ │ │ ├── tileflags.hpp │ │ │ │ ├── tilesetindex.hpp │ │ │ │ └── memory-impl.hpp │ │ │ ├── grid.hpp │ │ │ ├── fileclass.cpp │ │ │ └── tilejson.hpp │ │ ├── ol.cpp │ │ ├── browser2d.cpp │ │ ├── resourcebackend │ │ │ ├── conffile.hpp │ │ │ ├── factory.hpp │ │ │ └── python.hpp │ │ ├── core.hpp │ │ ├── cesium.cpp │ │ ├── mapproxy.hpp │ │ └── error.hpp │ ├── rf-mask │ │ ├── CMakeLists.txt │ │ ├── ogrsupport.hpp │ │ └── ogrsupport.cpp │ ├── setup-resource │ │ └── CMakeLists.txt │ ├── tools │ │ └── CMakeLists.txt │ ├── calipers │ │ └── CMakeLists.txt │ ├── generatevrtwo │ │ ├── CMakeLists.txt │ │ └── io.hpp │ └── tiling │ │ ├── CMakeLists.txt │ │ └── tiling.hpp ├── common.mk ├── .gitignore ├── examples │ └── examples.conf └── README.md ├── .gitignore ├── LICENSE └── .gitmodules /mapproxy/debian/compat: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /mapproxy/debian/ctt-vts-mapproxy.docs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mapproxy/Makefile: -------------------------------------------------------------------------------- 1 | buildsys/cmake/cmake.mk -------------------------------------------------------------------------------- /mapproxy/buildsys: -------------------------------------------------------------------------------- 1 | ../externals/buildsys/ -------------------------------------------------------------------------------- /mapproxy/debian/ctt-vts-mapproxy-tools.docs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mapproxy/src/geo: -------------------------------------------------------------------------------- 1 | ../../externals/libgeo/geo -------------------------------------------------------------------------------- /mapproxy/src/half: -------------------------------------------------------------------------------- 1 | ../../externals/half/half -------------------------------------------------------------------------------- /mapproxy/src/qmf: -------------------------------------------------------------------------------- 1 | ../../externals/libqmf/qmf -------------------------------------------------------------------------------- /mapproxy/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /mapproxy/src/http: -------------------------------------------------------------------------------- 1 | ../../externals/libhttp/http -------------------------------------------------------------------------------- /mapproxy/src/math: -------------------------------------------------------------------------------- 1 | ../../externals/libmath/math -------------------------------------------------------------------------------- /mapproxy/src/dbglog: -------------------------------------------------------------------------------- 1 | ../../externals/libdbglog/dbglog -------------------------------------------------------------------------------- /mapproxy/src/geometry: -------------------------------------------------------------------------------- 1 | ../../externals/libgeometry/geometry -------------------------------------------------------------------------------- /mapproxy/src/imgproc: -------------------------------------------------------------------------------- 1 | ../../externals/libimgproc/imgproc -------------------------------------------------------------------------------- /mapproxy/src/jsoncpp: -------------------------------------------------------------------------------- 1 | ../../externals/libjsoncpp/jsoncpp -------------------------------------------------------------------------------- /mapproxy/src/miniball: -------------------------------------------------------------------------------- 1 | ../../externals/libminiball/miniball -------------------------------------------------------------------------------- /mapproxy/src/pydbglog: -------------------------------------------------------------------------------- 1 | ../../externals/libpydbglog/pydbglog -------------------------------------------------------------------------------- /mapproxy/src/semantic: -------------------------------------------------------------------------------- 1 | ../../externals/libsemantic/semantic -------------------------------------------------------------------------------- /mapproxy/src/service: -------------------------------------------------------------------------------- 1 | ../../externals/libservice/service -------------------------------------------------------------------------------- /mapproxy/src/shtools: -------------------------------------------------------------------------------- 1 | ../../externals/libshtools/shtools -------------------------------------------------------------------------------- /mapproxy/src/utility: -------------------------------------------------------------------------------- 1 | ../../externals/libutility/utility -------------------------------------------------------------------------------- /mapproxy/src/vts-libs: -------------------------------------------------------------------------------- 1 | ../../externals/vts-libs/vts-libs -------------------------------------------------------------------------------- /mapproxy/src/pysupport: -------------------------------------------------------------------------------- 1 | ../../externals/libpysupport/pysupport -------------------------------------------------------------------------------- /mapproxy/src/gdal-drivers: -------------------------------------------------------------------------------- 1 | ../../externals/gdal-drivers/gdal-drivers -------------------------------------------------------------------------------- /mapproxy/debian/vts-mapproxy.install: -------------------------------------------------------------------------------- 1 | munin/mapproxy_ /opt/vts/munin 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.changes 2 | /*.upload 3 | /*.buildinfo 4 | /*.deb 5 | *~ 6 | DEADJOE 7 | *.sw* 8 | -------------------------------------------------------------------------------- /mapproxy/common.mk: -------------------------------------------------------------------------------- 1 | # we want debian release in version 2 | USE_DEBIAN_RELEASE_IN_VERSION=YES 3 | -------------------------------------------------------------------------------- /mapproxy/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | build 3 | build.* 4 | lib 5 | obj-* 6 | core 7 | vgcore.* 8 | tmp 9 | *.log 10 | *.pid 11 | gdalwmscache 12 | .gdb_history 13 | output 14 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/cesium/melown-technologies-logo-28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melowntech/vts-mapproxy/HEAD/mapproxy/src/mapproxy/cesium/melown-technologies-logo-28.png -------------------------------------------------------------------------------- /mapproxy/debian/README: -------------------------------------------------------------------------------- 1 | The Debian Package ctt-vts-mapproxy 2 | ------------------------------- 3 | 4 | VTS MapProxy. 5 | 6 | -- Vaclav Blazek Fri, 13 May 2016 15:21:00 +0200 7 | -------------------------------------------------------------------------------- /mapproxy/debian/.gitignore: -------------------------------------------------------------------------------- 1 | *debhelper* 2 | *.substvars 3 | /vts-mapproxy 4 | /vts-mapproxy-tools 5 | /vts-mapproxy-dbg 6 | files 7 | 8 | /control 9 | /ctt-vts-mapproxy-dbg/ 10 | /ctt-vts-mapproxy-tools/ 11 | /ctt-vts-mapproxy/ 12 | 13 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/files/defaultstyle.json: -------------------------------------------------------------------------------- 1 | { 2 | "layers": { 3 | "lines": { 4 | "line-width": 5, 5 | "line": true, 6 | "line-color": [237, 16, 204, 255], 7 | "zbuffer-offset": [-1, 0, 0] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /mapproxy/debian/ctt-vts-mapproxy.copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Disclaimer: 3 | This package is not part of the GNU/Linux Debian distribution. 4 | 5 | Files: * 6 | Copyright: 2011-2017 Melown Technologies. All rights reserved. 7 | -------------------------------------------------------------------------------- /mapproxy/debian/ctt-vts-mapproxy-tools.copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Disclaimer: 3 | This package is not part of the GNU/Linux Debian distribution. 4 | 5 | Files: * 6 | Copyright: 2011-2017 Melown Technologies SE. All rights reserved. 7 | -------------------------------------------------------------------------------- /mapproxy/debian/fix-shlibs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function fix_focal() { 4 | # change to base distro version 5 | sed -i 's/4.2.0+melown/4.2.0+dfsg-5/g' $1 6 | } 7 | 8 | function fix() { 9 | case ${DEB_RELEASE} in 10 | focal) fix_focal $1;; 11 | esac 12 | } 13 | 14 | for file in debian/*.substvars; do 15 | fix ${file} 16 | done 17 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/files/defaultstyle.mesh.json: -------------------------------------------------------------------------------- 1 | { 2 | "layers": { 3 | "polygons": { 4 | "polygon": true, 5 | "polygon-style": "flatshade", 6 | "polygon-use-stencil": false, 7 | "polygon-culling": "back", 8 | "polygon-color": [204, 204, 204, 255], 9 | "zbuffer-offset": [-10, 0, 0] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /mapproxy/examples/examples.conf: -------------------------------------------------------------------------------- 1 | [store] 2 | path = ./tmp/store 3 | 4 | [resource-backend] 5 | type = conffile 6 | path = examples/example.json 7 | root = ./tmp/datasets 8 | 9 | [http] 10 | enableBrowser = true 11 | 12 | [log] 13 | mask = VERBOSE 14 | file = mp.log 15 | file.truncate = true 16 | 17 | [gdal] 18 | tmpRoot = tmp/tmp 19 | 20 | [max-age] 21 | config = -1 22 | support = -1 23 | registry = -1 24 | data = -1 25 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/cesium/cesium.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 |
17 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/browser2d/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Map viewer 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/ol/ol.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WMTS 6 | 7 | 8 | 13 | 14 | 15 | 16 |
17 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # test program 2 | define_module(BINARY generate-tileindex 3 | DEPENDS mapproxy-core 4 | vts-libs imgproc service gdal-drivers geometry 5 | Boost_FILESYSTEM 6 | Boost_PROGRAM_OPTIONS 7 | Boost_REGEX) 8 | 9 | set(generate-tileindex_SOURCES 10 | generate-tileindex.cpp 11 | ) 12 | 13 | add_executable(mapproxy-generate-tileindex ${generate-tileindex_SOURCES}) 14 | target_link_libraries(mapproxy-generate-tileindex ${MODULE_LIBRARIES}) 15 | target_compile_definitions(mapproxy-generate-tileindex PRIVATE ${MODULE_DEFINITIONS}) 16 | buildsys_binary(mapproxy-generate-tileindex) 17 | set_target_version(mapproxy-generate-tileindex ${vts-mapproxy_VERSION}) 18 | -------------------------------------------------------------------------------- /mapproxy/debian/jammy/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 9.20160115ubuntu3), libboost-all-dev 6 | , libopencv-core-dev (>= 4.2) 7 | , libopencv-highgui-dev (>= 4.2) 8 | , libopencv-photo-dev (>= 4.2) 9 | , libopencv-imgproc-dev (>= 4.2) 10 | , libeigen3-dev (>= 3.1.0-1) 11 | , libgdal-dev (>= 3.0), libproj-dev (>= 6.0) 12 | , libopenmesh-dev (>= 8.0) 13 | , libgeographic-dev (>= 1.45-2) 14 | , libjsoncpp-dev (>= 1.7.2-1) 15 | , libprotobuf-dev (>= 2.6.1) 16 | , protobuf-compiler 17 | , libprocps-dev (>= 3.3.12) 18 | , libmagic-dev (>= 5.25) 19 | , gawk}}})m4_dnl 20 | -------------------------------------------------------------------------------- /mapproxy/debian/focal/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 9.20160115ubuntu3), libboost1.71-all-dev 6 | , libopencv-core-dev (>= 4.2) 7 | , libopencv-highgui-dev (>= 4.2) 8 | , libopencv-photo-dev (>= 4.2) 9 | , libopencv-imgproc-dev (>= 4.2) 10 | , libeigen3-dev (>= 3.1.0-1) 11 | , libgdal-dev (>= 3.0), libproj-dev (>= 6.0) 12 | , libopenmesh-dev (>= 8.0) 13 | , libgeographic-dev (>= 1.45-2) 14 | , libjsoncpp-dev (>= 1.7.2-1) 15 | , libprotobuf-dev (>= 2.6.1) 16 | , protobuf-compiler 17 | , libprocps-dev (>= 3.3.12) 18 | , libmagic-dev (>= 5.25) 19 | , gawk}}})m4_dnl 20 | -------------------------------------------------------------------------------- /mapproxy/debian/jessie/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 9.20150101+deb8u2), libboost1.55-all-dev 6 | , libopencv-core-dev (>= 2.4.9) 7 | , libopencv-highgui-dev (>= 2.4.9) 8 | , libopencv-photo-dev (>= 2.4.9) 9 | , libopencv-imgproc-dev (>= 2.4.9) 10 | , libeigen3-dev (>= 3.1.0-1) 11 | , libgdal-dev (>= 2.1), libproj-dev (>= 4.9) 12 | , libopenmesh-dev (>= 6.3) 13 | , libgeographic-dev (>= 1.37) 14 | , libjsoncpp-dev (>= 1.7.2) 15 | , libprotobuf-dev (>= 2.6.1) 16 | , protobuf-compiler 17 | , libprocps3-dev (>= 3.3.9) 18 | , libmagic-dev (>= 5.25) 19 | , gawk}}})m4_dnl 20 | -------------------------------------------------------------------------------- /mapproxy/src/rf-mask/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # test program 2 | define_module(BINARY rf-mask 3 | DEPENDS vts-libs imgproc service gdal-drivers geometry 4 | Boost_FILESYSTEM 5 | Boost_PROGRAM_OPTIONS 6 | Boost_REGEX) 7 | 8 | set(rf-mask_SOURCES 9 | main.cpp 10 | ogrsupport.hpp ogrsupport.cpp 11 | ) 12 | 13 | add_executable(mapproxy-rf-mask ${rf-mask_SOURCES}) 14 | target_link_libraries(mapproxy-rf-mask ${MODULE_LIBRARIES}) 15 | target_compile_definitions(mapproxy-rf-mask PRIVATE ${MODULE_DEFINITIONS}) 16 | buildsys_binary(mapproxy-rf-mask) 17 | set_target_version(mapproxy-rf-mask ${vts-mapproxy_VERSION}) 18 | 19 | # ------------------------------------------------------------------------ 20 | # --- installation 21 | # ------------------------------------------------------------------------ 22 | 23 | # binaries 24 | install(TARGETS mapproxy-rf-mask RUNTIME DESTINATION bin 25 | COMPONENT tools) 26 | -------------------------------------------------------------------------------- /mapproxy/debian/xenial/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 9.20160115ubuntu3), libboost1.58-all-dev 6 | , libopencv-core-dev (>= 2.4.9) 7 | , libopencv-highgui-dev (>= 2.4.9) 8 | , libopencv-photo-dev (>= 2.4.9) 9 | , libopencv-imgproc-dev (>= 2.4.9) 10 | , libeigen3-dev (>= 3.1.0-1) 11 | , libgdal-dev (>= 2.1), libproj-dev (>= 4.9) 12 | , libopenmesh-dev (>= 6.3) 13 | , libgeographic-dev (>= 1.45-2) 14 | , libjsoncpp-dev (>= 1.7.2-1) 15 | , libprotobuf-dev (>= 2.6.1) 16 | , protobuf-compiler 17 | , libprocps4-dev (>= 3.3.10) 18 | , libmagic-dev (>= 5.25) 19 | , libicu-dev (>= 55.1-7ubuntu0.4) 20 | , libtinyxml2-dev 21 | , libmarkdown2-dev 22 | , gawk}}})m4_dnl 23 | -------------------------------------------------------------------------------- /mapproxy/debian/wheezy/control.footer: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Added at the end of control file 3 | m4_dnl ############################################################### 4 | 5 | Package: ctt-vts-mapproxy 6 | Architecture: any 7 | Depends: vts-mapproxy (= ${binary:Version}) 8 | Description: VTS MapProxy backend server (transitional package) 9 | Package rename ctt-vts-mapproxy -> vts-mapproxy 10 | 11 | Package: ctt-vts-mapproxy-tools 12 | Architecture: any 13 | Depends: vts-mapproxy-tools (= ${binary:Version}) 14 | Description: VTS MapProxy backend server (transitional package) 15 | Package rename ctt-vts-mapproxy-tools -> vts-mapproxy-tools 16 | 17 | Package: ctt-vts-mapproxy-dbg 18 | Architecture: any 19 | Depends: vts-mapproxy-dbg (= ${binary:Version}) 20 | Description: VTS MapProxy backend server (transitional package) 21 | Package rename ctt-vts-mapproxy-dbg -> vts-mapproxy-dbg 22 | -------------------------------------------------------------------------------- /mapproxy/debian/stretch/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 9.20150101+deb8u2), libboost1.62-all-dev 6 | , libopencv-core-dev (>= 2.4.9) 7 | , libopencv-highgui-dev (>= 2.4.9) 8 | , libopencv-photo-dev (>= 2.4.9) 9 | , libopencv-imgproc-dev (>= 2.4.9) 10 | , libeigen3-dev (>= 3.1.0-1) 11 | , libgdal-dev (>= 2.1), libproj-dev (>= 4.9) 12 | , libopenmesh-dev (>= 6.3) 13 | , libgeographic-dev (>= 1.37) 14 | , libjsoncpp-dev (>= 1.7.2) 15 | , libprotobuf-dev (>= 2.6.1) 16 | , protobuf-compiler 17 | , libprocps-dev (>= 3.3.9) 18 | , libmagic-dev (>= 5.25) 19 | , libtinyxml2-dev 20 | , libmarkdown2-dev 21 | , libfftw3-dev, liblapack-dev, libblas-dev 22 | , gawk, pandoc, gfortran}}})m4_dnl 23 | -------------------------------------------------------------------------------- /mapproxy/debian/buster/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 12.1), devscripts 6 | , libboost1.67-all-dev 7 | , libopencv-core-dev (>= 2.4.9) 8 | , libopencv-highgui-dev (>= 2.4.9) 9 | , libopencv-photo-dev (>= 2.4.9) 10 | , libopencv-imgproc-dev (>= 2.4.9) 11 | , libeigen3-dev (>= 3.1.0-1) 12 | , libgdal-dev (>= 2.1), libproj-dev (>= 4.9) 13 | , libopenmesh-dev (>= 6.3) 14 | , libgeographic-dev (>= 1.37) 15 | , libjsoncpp-dev (>= 1.7.2) 16 | , libprotobuf-dev (>= 2.6.1) 17 | , protobuf-compiler 18 | , libprocps-dev (>= 3.3.9) 19 | , libmagic-dev (>= 5.25) 20 | , libtinyxml2-dev 21 | , libmarkdown2-dev 22 | , libfftw3-dev, liblapack-dev, libblas-dev 23 | , gawk, pandoc, gfortran}}})m4_dnl 24 | -------------------------------------------------------------------------------- /mapproxy/debian/wheezy/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 7.0.50~), libboost-all-dev (>= 1.49) 6 | , libopencv2.4-dev (>= 2.4.3), libopencv-contrib-dev (>= 2.4.3) 7 | , libopencv-video-dev (>= 2.4.3), libopencv-legacy-dev (>= 2.4.3) 8 | , libopencv-nonfree-dev (>= 2.4.3), libopencv-objdetect-dev (>= 2.4.3) 9 | , libopencv-photo-dev (>= 2.4.3), libeigen3-dev (>= 3.1.0-1) 10 | , libopencv-gpu2.4 (>= 2.4.3), liblapack-dev (>= 3.4.1-6) 11 | , libblas-dev (>= 1.2.20110419-5), libcrypto++-dev (>= 5.6) 12 | , libgdal-dev (>= 2.0), libproj-dev (>= 4.9) 13 | , libmysql++-dev (>= 3.0.9-1+b1), libopenmesh-dev (>= 2.3.1-2) 14 | , libtinyxml2-dev 15 | , libmarkdown2-dev 16 | , libgeographiclib-dev (>= 1.21-1), pandoc}}})m4_dnl 17 | -------------------------------------------------------------------------------- /mapproxy/debian/bullseye/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 12.1), devscripts 6 | , libboost1.74-all-dev 7 | , libopencv-core-dev (>= 2.4.9) 8 | , libopencv-highgui-dev (>= 2.4.9) 9 | , libopencv-photo-dev (>= 2.4.9) 10 | , libopencv-imgproc-dev (>= 2.4.9) 11 | , libeigen3-dev (>= 3.1.0-1) 12 | , libgdal-dev (>= 2.1), libproj-dev (>= 4.9) 13 | , libopenmesh-dev (>= 6.3) 14 | , libgeographic-dev (>= 1.37) 15 | , libjsoncpp-dev (>= 1.7.2) 16 | , libprotobuf-dev (>= 2.6.1) 17 | , protobuf-compiler 18 | , libprocps-dev (>= 3.3.9) 19 | , libmagic-dev (>= 5.25) 20 | , libtinyxml2-dev 21 | , libmarkdown2-dev 22 | , libfftw3-dev, liblapack-dev, libblas-dev 23 | , gawk, pandoc, gfortran}}})m4_dnl 24 | -------------------------------------------------------------------------------- /mapproxy/src/setup-resource/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # test program 2 | define_module(BINARY setup-resource 3 | DEPENDS mp-tiling mp-generatevrtwo mp-calipers mapproxy-core 4 | vts-libs imgproc service gdal-drivers geometry 5 | Boost_FILESYSTEM 6 | Boost_PROGRAM_OPTIONS 7 | Boost_REGEX) 8 | 9 | set(setup-resource_SOURCES 10 | main.cpp 11 | ) 12 | 13 | add_executable(mapproxy-setup-resource ${setup-resource_SOURCES}) 14 | target_link_libraries(mapproxy-setup-resource ${MODULE_LIBRARIES}) 15 | target_compile_definitions(mapproxy-setup-resource PRIVATE ${MODULE_DEFINITIONS}) 16 | buildsys_binary(mapproxy-setup-resource) 17 | set_target_version(mapproxy-setup-resource ${vts-mapproxy_VERSION}) 18 | 19 | # ------------------------------------------------------------------------ 20 | # --- installation 21 | # ------------------------------------------------------------------------ 22 | 23 | # binaries 24 | install(TARGETS mapproxy-setup-resource RUNTIME DESTINATION bin 25 | COMPONENT tools) 26 | -------------------------------------------------------------------------------- /mapproxy/debian/bionic/control: -------------------------------------------------------------------------------- 1 | m4_dnl ############################################################### 2 | m4_dnl ## Build dependencies 3 | m4_dnl ############################################################### 4 | m4_dnl 5 | m4_define({{{VAR_BuildDepends}}},{{{debhelper (>= 11), libboost1.65-all-dev 6 | , libopencv-core-dev (>= 3.2.0) 7 | , libopencv-highgui-dev (>= 3.2.0) 8 | , libopencv-photo-dev (>= 3.2.0) 9 | , libopencv-imgproc-dev (>= 3.2.0) 10 | , libeigen3-dev (>= 3.3.4) 11 | , libgdal-dev (>= 2.2.3), libproj-dev (>= 4.9.3) 12 | , libopenmesh-dev (>= 7.0) 13 | , libgeographic-dev (>= 1.49) 14 | , libjsoncpp-dev (>= 1.7.4) 15 | , libprotobuf-dev (>= 3.0.0) 16 | , protobuf-compiler (>= 3.0.0) 17 | , libprocps-dev (>= 3.3.12) 18 | , libmagic-dev (>= 5.32) 19 | , libicu-dev (>= 60.2-3ubuntu3) 20 | , libtinyxml2-dev 21 | , libmarkdown2-dev 22 | , libfftw3-dev, liblapack-dev, libblas-dev 23 | , gawk, pandoc, gfortran}}})m4_dnl 24 | -------------------------------------------------------------------------------- /mapproxy/src/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # tools 2 | define_module(BINARY tools 3 | DEPENDS mapproxy-core service 4 | 5 | Boost_FILESYSTEM 6 | Boost_PROGRAM_OPTIONS 7 | ) 8 | 9 | # ---------------------------------------------------------------------- 10 | # vts::TileIndex to mapproxy's mapped::TileIndex 11 | set(mapproxy-ti2mmti_SOURCES 12 | ti2mmti.cpp 13 | ) 14 | 15 | add_executable(mapproxy-ti2mmti ${mapproxy-ti2mmti_SOURCES}) 16 | target_link_libraries(mapproxy-ti2mmti ${MODULE_LIBRARIES}) 17 | target_compile_definitions(mapproxy-ti2mmti PRIVATE ${MODULE_DEFINITIONS}) 18 | buildsys_binary(mapproxy-ti2mmti) 19 | set_target_version(mapproxy-ti2mmti ${vts-mapproxy_VERSION}) 20 | 21 | # ---------------------------------------------------------------------- 22 | # vts::TileIndex and mapped::TileIndex query tool 23 | set(mapproxy-querymmti_SOURCES 24 | querymmti.cpp 25 | ) 26 | 27 | add_executable(mapproxy-querymmti ${mapproxy-querymmti_SOURCES}) 28 | target_link_libraries(mapproxy-querymmti ${MODULE_LIBRARIES}) 29 | target_compile_definitions(mapproxy-querymmti PRIVATE ${MODULE_DEFINITIONS}) 30 | buildsys_binary(mapproxy-querymmti) 31 | set_target_version(mapproxy-querymmti ${vts-mapproxy_VERSION}) 32 | -------------------------------------------------------------------------------- /mapproxy/debian/templates/control.template: -------------------------------------------------------------------------------- 1 | Source: vts-mapproxy 2 | Section: misc 3 | Priority: extra 4 | Maintainer: Vaclav Blazek 5 | Build-Depends: VAR_BuildDepends 6 | Standards-Version: 3.8.4 7 | Homepage: https://www.melown.com/maps 8 | 9 | Package: vts-mapproxy 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends}, vts-registry (>= 1.25) 12 | , vts-mapproxy-tools (= ${binary:Version}) 13 | Replaces: ctt-vts-mapproxy (<< 1.0) 14 | Breaks: ctt-vts-mapproxy (<< 1.0) 15 | Description: VTS MapProxy backend server 16 | Backend HTTP daemon. 17 | 18 | Package: vts-mapproxy-tools 19 | Architecture: any 20 | Depends: ${shlibs:Depends}, ${misc:Depends}, vts-registry (>= 1.25) 21 | Replaces: ctt-vts-mapproxy-tools (<< 1.0) 22 | Breaks: ctt-vts-mapproxy-tools (<< 1.0) 23 | Description: VTS MapProxy backend server tools 24 | Contains collection of tools for mapproxy dataset preparation. 25 | 26 | Package: vts-mapproxy-dbg 27 | Architecture: any 28 | Depends: ${misc:Depends}, vts-mapproxy (= ${binary:Version}) 29 | , vts-mapproxy-tools (= ${binary:Version}) 30 | Replaces: ctt-vts-mapproxy-dbg (<< 1.0) 31 | Breaks: ctt-vts-mapproxy-dbg (<< 1.0) 32 | Description: Debug Symbols for vts-mapproxy* 33 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/files/cesiumreadme.md: -------------------------------------------------------------------------------- 1 | # VTS Mapproxy resource Cesium Terrain Provider interface 2 | 3 | ## General info 4 | 5 | Cesium Terrain Proviver interface allows a VTS surface resource to be used in 6 | any Cesium application as a terrain provider. 7 | 8 | For every terrain-enabled reference frame mapproxy provides a 9 | [layer.json](layer.json) file containing layer description and appropriate 10 | terrain files in the [quantized 11 | mesh](https://github.com/AnalyticalGraphicsInc/quantized-mesh) format. 12 | 13 | If the original dataset doesn't cover whole Earth the undefined height is 14 | replaced with zero height. 15 | 16 | There's an [interactive browser](browser.html) provided by mapproxy for testing 17 | and evaluation. Preview: 18 | 19 | 20 | You can the use the [URL of this directory](.) to add this resource as a terrain 21 | provider to your Cesium application. 22 | 23 | var terrainProvider = new Cesium.CesiumTerrainProvider({ 24 | url: "{{{url}}}" 25 | }); 26 | 27 | --- 28 | 29 | *Nota bene*: The above code snippet uses `http.externalUrl` configuration 30 | option, currently set to: 31 | 32 | [http] 33 | externalUrl = {{{externalUrl}}} 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Melown Technologies SE 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /mapproxy/README.md: -------------------------------------------------------------------------------- 1 | vts/mapproxy 2 | 3 | --- 4 | 5 | generatevrtwo: Generate virtual GDAL dataset with overviews. 6 | 7 | Dataset format: 8 | * directory with: 9 | * original: symlink to original dataset (anything user provided) 10 | * dataset: virtual dataset itself (VRT driver); use this file as an entry point 11 | * 0-N: directory with overview level 12 | - ovr.vrt: virtual dataset encapsulating individual tiles 13 | - x-y.tif: file with tile at (x, y) 14 | - bg.solid: (optional) dataset with uniform vaulu used in place of missing tiles 15 | 16 | NB: symlink to original dataset is used to ease remapping of "vrtwo" dataset 17 | when moving around filesystems/machines. 18 | 19 | --- 20 | 21 | Windyty driver 22 | 23 | Dataset format: 24 | 25 | ```conf 26 | # windyty dataset 27 | [windyty] 28 | # Base time in seconds from Epoch (Unix timestamp) 29 | base = 0 30 | # Period - forcast is available each 'period' seconds from 'base' 31 | period = 10800 32 | # Source TMS URL template. Uses strftime(3) for time formatting. 33 | urlTemplate = http://origin-backup.windyty.com/ecmwf-hres/%Y/%m/%d/%H/256mt${z}/${y}/${x}/clouds2-surface.png 34 | # Source data SRS as EPSG code 35 | srs = EPSG:4326 36 | # Source data extents. 37 | extents = -180,-90:180,90 38 | # Source (maximum) level of detail in source data. 39 | maxLod = 8 40 | # Number of overviews to generate. 41 | overviews = 8 42 | # Transparent images? 43 | transparent = true 44 | ``` 45 | -------------------------------------------------------------------------------- /mapproxy/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- gnumakefile -*- 3 | 4 | # include common debian support 5 | include buildsys/common/include/debian.mk 6 | 7 | # list of packages to build 8 | PACKAGES=MAPPROXY MAPPROXY_TOOLS 9 | 10 | # package names 11 | DEB_PACKAGE_MAPPROXY=$(DEB_SOURCE) 12 | DEB_PACKAGE_MAPPROXY_TOOLS=$(DEB_SOURCE)-tools 13 | 14 | PREFIX=/opt/vts 15 | 16 | # install components 17 | INSTALL_COMPONENTS_MAPPROXY=main 18 | INSTALL_COMPONENTS_MAPPROXY_TOOLS=tools 19 | 20 | # do not build VTS tools provided by vts-libs 21 | CMAKE_FLAGS=-DBUILDSYS_NOBUILD_TARGET_vts-tools=TRUE 22 | 23 | # include cmake debian support 24 | include buildsys/cmake/include/debian.mk 25 | 26 | # ignore these: 27 | override_dh_auto_test: 28 | override_dh_installcatalogs: 29 | override_dh_installcron: 30 | override_dh_installdebconf: 31 | override_dh_installemacsen: 32 | override_dh_installifupdown: 33 | override_dh_installinfo: 34 | override_dh_pysupport: 35 | override_dh_installmenu: 36 | override_dh_installmime: 37 | override_dh_installmodules: 38 | override_dh_installlogcheck: 39 | override_dh_installpam: 40 | override_dh_installppp: 41 | override_dh_installudev: 42 | override_dh_installwm: 43 | override_dh_installxfonts: 44 | override_dh_installgsettings: 45 | override_dh_bugfiles: 46 | override_dh_ucf: 47 | override_dh_lintian: 48 | override_dh_gconf: 49 | override_dh_icons: 50 | override_dh_perl: 51 | override_dh_usrlocal: 52 | override_dh_installexamples: 53 | 54 | override_dh_shlibdeps: 55 | dh_shlibdeps 56 | debian/fix-shlibs.sh 57 | -------------------------------------------------------------------------------- /mapproxy/src/calipers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # program 2 | define_module(BINARY mp-calipers 3 | DEPENDS vts-libs service gdal-drivers geometry geo mapproxy-core 4 | Boost_FILESYSTEM 5 | Boost_PROGRAM_OPTIONS) 6 | 7 | set(mp-calipers_SOURCES 8 | calipers.hpp calipers.cpp 9 | ) 10 | 11 | add_library(mp-calipers ${mp-calipers_SOURCES}) 12 | target_link_libraries(mp-calipers ${MODULE_LIBRARIES}) 13 | target_compile_definitions(mp-calipers PRIVATE ${MODULE_DEFINITIONS}) 14 | buildsys_library(mp-calipers) 15 | 16 | # ------------------------------------------------------------------------ 17 | # --- installation 18 | # ------------------------------------------------------------------------ 19 | 20 | # program 21 | define_module(BINARY mapproxy-calipers 22 | DEPENDS vts-libs service gdal-drivers geometry geo 23 | Boost_FILESYSTEM 24 | Boost_PROGRAM_OPTIONS) 25 | 26 | set(mapproxy-calipers_SOURCES 27 | main.cpp 28 | ) 29 | 30 | add_executable(mapproxy-calipers ${mapproxy-calipers_SOURCES}) 31 | target_link_libraries(mapproxy-calipers mp-calipers ${MODULE_LIBRARIES}) 32 | target_compile_definitions(mapproxy-calipers PRIVATE ${MODULE_DEFINITIONS}) 33 | buildsys_binary(mapproxy-calipers) 34 | set_target_version(mapproxy-calipers ${vts-mapproxy_VERSION}) 35 | 36 | # ------------------------------------------------------------------------ 37 | # --- installation 38 | # ------------------------------------------------------------------------ 39 | 40 | # binaries 41 | install(TARGETS mapproxy-calipers RUNTIME DESTINATION bin 42 | COMPONENT tools) 43 | -------------------------------------------------------------------------------- /mapproxy/src/generatevrtwo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # test program 2 | define_module(BINARY mp-generatevrtwo 3 | DEPENDS vts-libs service gdal-drivers geometry geo 4 | Boost_FILESYSTEM 5 | Boost_PROGRAM_OPTIONS) 6 | 7 | set(mp-generatevrtwo_SOURCES 8 | generatevrtwo.hpp generatevrtwo.cpp 9 | ) 10 | 11 | add_library(mp-generatevrtwo ${mp-generatevrtwo_SOURCES}) 12 | target_link_libraries(mp-generatevrtwo ${MODULE_LIBRARIES}) 13 | target_compile_definitions(mp-generatevrtwo PRIVATE ${MODULE_DEFINITIONS}) 14 | buildsys_library(mp-generatevrtwo) 15 | 16 | # ------------------------------------------------------------------------ 17 | # --- installation 18 | # ------------------------------------------------------------------------ 19 | 20 | # test program 21 | define_module(BINARY generatevrtwo 22 | DEPENDS vts-libs service gdal-drivers geometry geo 23 | Boost_FILESYSTEM 24 | Boost_PROGRAM_OPTIONS) 25 | 26 | set(generatevrtwo_SOURCES 27 | main.cpp 28 | ) 29 | 30 | add_executable(generatevrtwo ${generatevrtwo_SOURCES}) 31 | target_link_libraries(generatevrtwo mp-generatevrtwo ${MODULE_LIBRARIES}) 32 | target_compile_definitions(generatevrtwo PRIVATE ${MODULE_DEFINITIONS}) 33 | buildsys_binary(generatevrtwo) 34 | set_target_version(generatevrtwo ${vts-mapproxy_VERSION}) 35 | 36 | # ------------------------------------------------------------------------ 37 | # --- installation 38 | # ------------------------------------------------------------------------ 39 | 40 | # binaries 41 | install(TARGETS generatevrtwo RUNTIME DESTINATION bin 42 | COMPONENT tools) 43 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/gdalsupport/workrequest.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "workrequest.hpp" 28 | 29 | WorkRequest::~WorkRequest() {} 30 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/ol.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_ol_hpp_included_ 28 | #define mapproxy_ol_hpp_included_ 29 | 30 | #include "vts-libs/storage/support.hpp" 31 | 32 | namespace ol { 33 | 34 | extern const vtslibs::storage::SupportFile::Files supportFiles; 35 | 36 | } // namespace ol 37 | 38 | #endif // mapproxy_ol_hpp_included_ 39 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/cesium.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_cesium_hpp_included_ 28 | #define mapproxy_cesium_hpp_included_ 29 | 30 | #include "vts-libs/storage/support.hpp" 31 | 32 | namespace cesium { 33 | 34 | extern const vtslibs::storage::SupportFile::Files supportFiles; 35 | 36 | } // namespace cesium 37 | 38 | #endif // mapproxy_cesium_hpp_included_ 39 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/gdalsupport/workrequestfwd.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_gdalsupport_workrequestfwd_hpp_included_ 28 | #define mapproxy_gdalsupport_workrequestfwd_hpp_included_ 29 | 30 | class WorkRequest; 31 | struct WorkRequestParams; 32 | using WorkResponse = std::shared_ptr; 33 | 34 | #endif // mapproxy_gdalsupport_workrequestfwd_hpp_included_ 35 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/browser2d.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_browser2d_hpp_included_ 28 | #define mapproxy_browser2d_hpp_included_ 29 | 30 | #include "vts-libs/storage/support.hpp" 31 | 32 | namespace browser2d { 33 | 34 | extern const vtslibs::storage::SupportFile::Files supportFiles; 35 | 36 | } // namespace browser2d 37 | 38 | #endif // mapproxy_browser2d_hpp_included_ 39 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_definition_hpp_included_ 28 | #define mapproxy_definition_hpp_included_ 29 | 30 | #include "definition/factory.hpp" 31 | #include "definition/tms.hpp" 32 | #include "definition/surface.hpp" 33 | #include "definition/surface-meta.hpp" 34 | #include "definition/geodata.hpp" 35 | #include "definition/geodata-semantic.hpp" 36 | 37 | #endif // mapproxy_definition_hpp_included_ 38 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/gdalsupport/requestbase.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_gdalsupport_requestbase_hpp_included_ 28 | #define mapproxy_gdalsupport_requestbase_hpp_included_ 29 | 30 | #include "types.hpp" 31 | 32 | class ShRequestBase { 33 | public: 34 | virtual ~ShRequestBase() {} 35 | 36 | void done() { done_impl(); } 37 | 38 | private: 39 | virtual void done_impl() = 0; 40 | }; 41 | 42 | #endif // mapproxy_gdalsupport_requestsbase_hpp_included_ 43 | -------------------------------------------------------------------------------- /mapproxy/src/tiling/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # test program 2 | define_module(BINARY mp-tiling 3 | DEPENDS vts-libs service gdal-drivers geometry geo 4 | Boost_FILESYSTEM 5 | Boost_PROGRAM_OPTIONS) 6 | 7 | set(mp-tiling_SOURCES 8 | tiling.hpp tiling.cpp 9 | ) 10 | 11 | add_library(mp-tiling ${mp-tiling_SOURCES}) 12 | target_link_libraries(mp-tiling ${MODULE_LIBRARIES}) 13 | target_compile_definitions(mp-tiling PRIVATE ${MODULE_DEFINITIONS}) 14 | buildsys_library(mp-tiling) 15 | 16 | # ------------------------------------------------------------------------ 17 | # --- installation 18 | # ------------------------------------------------------------------------ 19 | 20 | # test program 21 | define_module(BINARY mapproxy-tiling 22 | DEPENDS vts-libs service gdal-drivers geometry geo 23 | Boost_FILESYSTEM 24 | Boost_PROGRAM_OPTIONS) 25 | 26 | set(mapproxy-tiling_SOURCES 27 | main.cpp 28 | ) 29 | 30 | add_executable(mapproxy-tiling ${mapproxy-tiling_SOURCES}) 31 | target_link_libraries(mapproxy-tiling mp-tiling ${MODULE_LIBRARIES}) 32 | target_compile_definitions(mapproxy-tiling PRIVATE ${MODULE_DEFINITIONS}) 33 | buildsys_binary(mapproxy-tiling) 34 | set_target_version(mapproxy-tiling ${vts-mapproxy_VERSION}) 35 | 36 | set(sub-tiling_SOURCES 37 | sub-tiling.cpp 38 | ) 39 | 40 | add_executable(mapproxy-sub-tiling ${sub-tiling_SOURCES}) 41 | target_link_libraries(mapproxy-sub-tiling mp-tiling ${MODULE_LIBRARIES}) 42 | target_compile_definitions(mapproxy-sub-tiling PRIVATE ${MODULE_DEFINITIONS}) 43 | buildsys_binary(mapproxy-sub-tiling) 44 | set_target_version(mapproxy-sub-tiling ${vts-mapproxy_VERSION}) 45 | 46 | # ------------------------------------------------------------------------ 47 | # --- installation 48 | # ------------------------------------------------------------------------ 49 | 50 | # binaries 51 | install(TARGETS mapproxy-tiling RUNTIME DESTINATION bin 52 | COMPONENT tools) 53 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/gdalsupport/datasetcache.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "../error.hpp" 28 | #include "datasetcache.hpp" 29 | 30 | geo::GeoDataset& DatasetCache::operator()(const std::string &path) 31 | { 32 | ++hits_; 33 | 34 | auto fdatasets(datasets_.find(path)); 35 | if (fdatasets != datasets_.end()) { return fdatasets->second; } 36 | 37 | return datasets_.insert(Cache::value_type 38 | (path, geo::GeoDataset::open(path))).first->second; 39 | } 40 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/geodata-vector.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "geodata.hpp" 28 | #include "factory.hpp" 29 | 30 | namespace resource { 31 | 32 | constexpr Resource::Generator::Type GeodataVector::type; 33 | constexpr char GeodataVector::driverName[]; 34 | 35 | MAPPROXY_DEFINITION_REGISTER(GeodataVector) 36 | 37 | bool GeodataVector::frozenCredits_impl() const { return false; } 38 | 39 | bool GeodataVector::needsRanges_impl() const { return false; } 40 | 41 | } // namespace resource 42 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/aborter.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_aborter_hpp_included_ 28 | #define mapproxy_support_aborter_hpp_included_ 29 | 30 | #include 31 | 32 | /** Aborter helper. 33 | */ 34 | struct Aborter { 35 | typedef std::function AbortedCallback; 36 | 37 | virtual ~Aborter() {} 38 | 39 | /** Defaults to dummy aborter 40 | */ 41 | virtual void setAborter(const AbortedCallback&) {}; 42 | }; 43 | 44 | #endif // mapproxy_support_aborter_hpp_included_ 45 | 46 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/files/wmtsreadme.md: -------------------------------------------------------------------------------- 1 | # VTS Mapproxy resource WMTS interface 2 | 3 | ## General info 4 | 5 | WMTS interface allows a VTS raster resource to be used in WMTS enabled WWW 6 | clients or GIS tool. 7 | 8 | For every WMTS-enabled reference frame mapproxy provides a 9 | [WMTSCapabilities.xml](WMTSCapabilities.xml) file containing single layer for 10 | this particular resource. 11 | 12 | There's an [interactive browser](browser.html) provided by mapproxy for testing 13 | and evaluation. Preview: 14 | 15 | 16 | You can the use the [URL of this directory](.) in tools like 17 | [GDAL](https://www.gdal.org/) or [QGIS](https://qgis.org/en/site/). 18 | 19 | ## Examples 20 | 21 | ### GDAL 22 | 23 | * GDAL: warp whole dataset into a TIF file 1024 px wide with aspect ratio kept 24 | 25 | # gdalwarp wmts:{{{url}}}WMTSCapabilities.xml output.tif -ts 1024 0 -r cubic 26 | 27 | (please notice the `wmts:` URL prefix) 28 | 29 | ### QGIS 30 | In QGIS desktop application: 31 | 32 | * Open the "Add Layer(s) from a WM(T)S Server" dialog: 33 | * either via menu: `Layer` -> `Add Layer` -> `Add WMT/WMTS Layer...` 34 | * or by keyboard shortcut: `Ctrl+Shift+W` 35 | * Click the `New` button to add new server connection 36 | * Choose name for new server in tha `Name` field 37 | * Paste the use [WMTSCapabilities.xml URL](WMTSCapabilities.xml) in the `URL` field 38 | * Click OK to save the connection 39 | * New server connection should become selected in the drop-down list 40 | * Click the `Connect` button 41 | * Select the only layer available 42 | * Click the `Add` button 43 | 44 | --- 45 | 46 | *Nota bene*: If you want to use the WMTS interface outside of introspection 47 | browser you have to have properly configured the `http.externalUrl` mapproxy 48 | configuration options. Currently set to: 49 | 50 | [http] 51 | externalUrl = {{{externalUrl}}} 52 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/options.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_definition_options_hpp_included_ 28 | #define mapproxy_definition_options_hpp_included_ 29 | 30 | #include 31 | 32 | namespace resource { 33 | 34 | bool optionsChanged(const boost::any &l, const boost::any &r); 35 | 36 | template 37 | bool optionsChanged(const T &l, const T &r) { 38 | return optionsChanged(l.options, r.options); 39 | } 40 | 41 | } // namespace resource 42 | 43 | #endif // mapproxy_definition_options_hpp_included_ 44 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/parse.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_definition_parse_hpp_included_ 28 | #define mapproxy_definition_parse_hpp_included_ 29 | 30 | #include "geo/vectorformat.hpp" 31 | 32 | // fwd 33 | namespace Json { class Value; } 34 | 35 | namespace resource { 36 | 37 | void parse(geo::vectorformat::Config &config, geo::VectorFormat format 38 | , const Json::Value &value); 39 | void build(Json::Value &value, const geo::vectorformat::Config &config); 40 | 41 | } // namespace resource 42 | 43 | #endif // mapproxy_definition_parse_hpp_included_ 44 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/gdalsupport/datasetcache.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_datasetcache_hpp_included_ 28 | #define mapproxy_datasetcache_hpp_included_ 29 | 30 | #include 31 | 32 | #include "geo/geodataset.hpp" 33 | 34 | class DatasetCache { 35 | public: 36 | DatasetCache() : hits_() {} 37 | 38 | geo::GeoDataset& operator()(const std::string &path); 39 | 40 | private: 41 | typedef std::map Cache; 42 | 43 | Cache datasets_; 44 | 45 | std::size_t hits_; 46 | }; 47 | 48 | #endif // mapproxy_dataset_hpp_included_ 49 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/atlas.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_atlas_hpp_included_ 28 | #define mapproxy_support_atlas_hpp_included_ 29 | 30 | #include 31 | 32 | #include "../resource.hpp" 33 | #include "../sink.hpp" 34 | 35 | /** Sends image from cv::Mat into sink in given format. If atlas is set it 36 | * generates single-image VTS atlas (always JPEG). 37 | */ 38 | void sendImage(const cv::Mat &image, const Sink::FileInfo &sfi 39 | , RasterFormat format, bool atlas, Sink &sink); 40 | 41 | #endif // mapproxy_support_atlas_hpp_included_ 42 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/options.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "jsoncpp/json.hpp" 28 | 29 | #include "options.hpp" 30 | 31 | namespace resource { 32 | 33 | bool optionsChanged(const boost::any &l, const boost::any &r) 34 | { 35 | const auto *lopt(boost::any_cast(&l)); 36 | const auto *ropt(boost::any_cast(&r)); 37 | 38 | // different availability -> changed 39 | if (bool(lopt) != bool(ropt)) { return true; } 40 | 41 | if (!lopt) { return false; } 42 | 43 | // compare value-wise 44 | return *lopt != *ropt; 45 | } 46 | 47 | } // namespace resource 48 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/files.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_files_hpp_included_ 28 | #define mapproxy_generator_files_hpp_included_ 29 | 30 | #include "vts-libs/storage/support.hpp" 31 | 32 | namespace vs = vtslibs::storage; 33 | 34 | namespace files { 35 | 36 | extern const vtslibs::storage::SupportFile defaultStyle; 37 | 38 | extern const vtslibs::storage::SupportFile defaultMeshStyle; 39 | 40 | extern const vtslibs::storage::SupportFile wmtsReadme; 41 | 42 | extern const vtslibs::storage::SupportFile cesiumReadme; 43 | 44 | } // namespace files 45 | 46 | #endif // mapproxy_generator_files_hpp_included_ 47 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/ol.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "ol.hpp" 28 | 29 | #include "ol/ol.html.hpp" 30 | #include "ol/ol.js.hpp" 31 | 32 | namespace ol { 33 | 34 | const vtslibs::storage::SupportFile::Files supportFiles = 35 | { 36 | { "browser.html" 37 | , { 38 | ol_html 39 | , sizeof(ol_html) 40 | , ol_html_attr_lastModified 41 | , "text/html; charset=utf-8" 42 | } 43 | }, { "ol.js" 44 | , { 45 | ol_js 46 | , sizeof(ol_js) 47 | , ol_js_attr_lastModified 48 | , "application/javascript; charset=utf-8" 49 | } 50 | } 51 | }; 52 | 53 | } // namespace ol 54 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/tms-raster-patchwork.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_tms_raster_patchwork_hpp_included_ 28 | #define mapproxy_generator_tms_raster_patchwork_hpp_included_ 29 | 30 | #include "tms-raster-synthetic.hpp" 31 | 32 | namespace generator { 33 | 34 | class TmsRasterPatchwork : public TmsRasterSynthetic { 35 | public: 36 | TmsRasterPatchwork(const Params ¶ms); 37 | 38 | typedef resource::TmsRasterPatchwork Definition; 39 | 40 | private: 41 | virtual cv::Mat generateTileImage(const vts::TileId &tileId) const; 42 | 43 | const Definition &definition_; 44 | }; 45 | 46 | } // namespace generator 47 | 48 | #endif // mapproxy_generator_tms_raster_patchwork_hpp_included_ 49 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/tms-raster-solid.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_tms_raster_solid_hpp_included_ 28 | #define mapproxy_generator_tms_raster_solid_hpp_included_ 29 | 30 | #include "tms-raster-synthetic.hpp" 31 | 32 | namespace generator { 33 | 34 | class TmsRasterSolid : public TmsRasterSynthetic { 35 | public: 36 | TmsRasterSolid(const Params ¶ms); 37 | 38 | typedef resource::TmsRasterSolid Definition; 39 | 40 | private: 41 | virtual cv::Mat generateTileImage(const vts::TileId &tileId) const; 42 | 43 | const Definition &definition_; 44 | 45 | const cv::Vec3b burnColor_; 46 | }; 47 | 48 | } // namespace generator 49 | 50 | #endif // mapproxy_generator_tms_raster_solid_hpp_included_ 51 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/browser2d.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "browser2d.hpp" 28 | 29 | #include "browser2d/index.html.hpp" 30 | #include "browser2d/index.js.hpp" 31 | 32 | namespace browser2d { 33 | 34 | const vtslibs::storage::SupportFile::Files supportFiles = 35 | { 36 | { "index.html" 37 | , { 38 | index_html 39 | , sizeof(index_html) 40 | , index_html_attr_lastModified 41 | , "text/html; charset=utf-8" 42 | } 43 | }, { "index.js" 44 | , { 45 | index_js 46 | , sizeof(index_js) 47 | , index_js_attr_lastModified 48 | , "application/javascript; charset=utf-8" 49 | } 50 | } 51 | }; 52 | 53 | } // namespace browser2d 54 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/revision.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_revision_hpp_included_ 28 | #define mapproxy_support_revision_hpp_included_ 29 | 30 | #include 31 | 32 | struct RevisionWrapper { 33 | unsigned int revision; 34 | const char *sep; 35 | 36 | RevisionWrapper(unsigned int revision = 0, const char *sep = "") 37 | : revision(revision), sep(sep) 38 | {} 39 | }; 40 | 41 | template 42 | inline std::basic_ostream& 43 | operator<<(std::basic_ostream &os, const RevisionWrapper &r) 44 | { 45 | if (!r.revision) { return os; } 46 | return os << r.sep << "r=" << r.revision; 47 | } 48 | 49 | #endif // mapproxy_support_revision_hpp_included_ 50 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/tms-raster-patchwork.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "utility/premain.hpp" 28 | 29 | #include "jsoncpp/json.hpp" 30 | #include "jsoncpp/as.hpp" 31 | 32 | #include "tms.hpp" 33 | #include "factory.hpp" 34 | 35 | namespace resource { 36 | 37 | constexpr char TmsRasterPatchwork::driverName[]; 38 | 39 | MAPPROXY_DEFINITION_REGISTER(TmsRasterPatchwork) 40 | 41 | void TmsRasterPatchwork::from_impl(const Json::Value &value) 42 | { 43 | parse(value); 44 | } 45 | 46 | void TmsRasterPatchwork::to_impl(Json::Value &value) const 47 | { 48 | build(value); 49 | } 50 | 51 | Changed TmsRasterPatchwork::changed_impl(const DefinitionBase &other) const 52 | { 53 | return TmsRasterSynthetic::changed_impl(other); 54 | } 55 | 56 | } // namespace resource 57 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/resourcebackend/conffile.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_resourcebackend_conffile_hpp_included_ 28 | #define mapproxy_resourcebackend_conffile_hpp_included_ 29 | 30 | #include 31 | 32 | #include "../resourcebackend.hpp" 33 | 34 | namespace resource_backend { 35 | 36 | class Conffile : public ResourceBackend { 37 | public: 38 | struct Config { 39 | boost::filesystem::path path; 40 | }; 41 | 42 | Conffile(const GenericConfig &genericConfig 43 | , const Config &config); 44 | 45 | private: 46 | virtual Resource::map load_impl() const; 47 | 48 | const Config config_; 49 | }; 50 | 51 | } // namespace resource_backend 52 | 53 | #endif // mapproxy_resourcebackend_conffile_hpp_included_ 54 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/ol/ol.js: -------------------------------------------------------------------------------- 1 | function createMap(xml) { 2 | var getWidth = ol.extent.getWidth; 3 | var getProjection = ol.proj.get; 4 | var transform = ol.proj.transform; 5 | var WMTS = ol.source.WMTS; 6 | 7 | var Map = ol.Map; 8 | var View = ol.View; 9 | var WMTSCapabilities = ol.format.WMTSCapabilities; 10 | var TileLayer = ol.layer.Tile; 11 | var WMTS = ol.source.WMTS; 12 | var optionsFromCapabilities = WMTS.optionsFromCapabilities; 13 | 14 | var map; 15 | 16 | var capabilities = (new WMTSCapabilities()).read(xml); 17 | 18 | // use first layer 19 | var layer = capabilities.Contents.Layer[0]; 20 | 21 | // use single tile matrix 22 | var options = optionsFromCapabilities(capabilities, { 23 | layer: layer.Identifier 24 | }); 25 | 26 | // get center of WGS84 bounding box and convert it to SRS of tile matrix 27 | var bb = layer.WGS84BoundingBox; 28 | var center = transform([ (bb[0] + bb[2]) / 2, (bb[1] + bb[3]) / 2 ] 29 | , getProjection("CRS:84") 30 | , options.projection); 31 | 32 | // calculate allowed resolutions for tile-matrix-set 33 | var tms = capabilities.Contents.TileMatrixSet.find( 34 | x => x.Identifier === layer.TileMatrixSetLink[0].TileMatrixSet 35 | ); 36 | var projection = getProjection(options.projection); 37 | var matrix = tms.TileMatrix[0]; 38 | const width = getWidth(projection.getExtent()); 39 | var resolutions = tms.TileMatrix.map( 40 | m => width / m.TileWidth / m.MatrixWidth 41 | ); 42 | 43 | map = new Map({ 44 | layers: [ 45 | new TileLayer({ 46 | opacity: 1 47 | , source: new WMTS(options) 48 | }) 49 | ], 50 | target: 'map', 51 | view: new View({ 52 | center: center 53 | , projection: options.projection 54 | , resolutions: resolutions 55 | , resolution: resolutions[0] 56 | }) 57 | }); 58 | } 59 | 60 | function startBrowser() { 61 | fetch('./WMTSCapabilities.xml?is=1') 62 | .then((response) => response.text()) 63 | .then((text) => createMap(text)) 64 | ; 65 | } 66 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/registry.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "factory.hpp" 28 | 29 | Generator::Factory::pointer 30 | Generator::Factory::findFactory(const Resource::Generator &type) 31 | { 32 | const auto &r(registry()); 33 | auto fregistry(r.find(type)); 34 | if (fregistry == r.end()) { 35 | LOGTHROW(err1, UnknownGenerator) 36 | << "Unknown generator type <" << type << ">."; 37 | } 38 | return fregistry->second; 39 | } 40 | 41 | void Generator::Factory::registerType(const Resource::Generator &type 42 | , const pointer &factory) 43 | { 44 | registry().insert(Registry::value_type(type, factory)); 45 | } 46 | 47 | Generator::Factory::Registry& Generator::Factory::registry() 48 | { 49 | static Registry registry; 50 | return registry; 51 | } 52 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/core.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_core_hpp_included_ 28 | #define mapproxy_core_hpp_included_ 29 | 30 | #include "http/contentgenerator.hpp" 31 | 32 | #include "generator.hpp" 33 | 34 | class Core : boost::noncopyable 35 | , public http::ContentGenerator 36 | { 37 | public: 38 | Core(Generators &generators, GdalWarper &warper 39 | , unsigned int threadCount, http::ContentFetcher &contentFetcher); 40 | 41 | struct Detail; 42 | 43 | private: 44 | virtual void generate_impl(const http::Request &request 45 | , const http::ServerSink::pointer &sink); 46 | 47 | std::shared_ptr detail_; 48 | Detail& detail() { return *detail_; } 49 | const Detail& detail() const { return *detail_; } 50 | }; 51 | 52 | #endif // mapproxy_core_hpp_included_ 53 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/wmts.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_wtms_hpp_included_ 28 | #define mapproxy_support_wtms_hpp_included_ 29 | 30 | #include "../resource.hpp" 31 | 32 | namespace wmts { 33 | 34 | struct Layer { 35 | const Resource *resource; 36 | std::string rootPath; 37 | RasterFormat format; 38 | 39 | typedef std::vector list; 40 | 41 | Layer(const Resource &resource) 42 | : resource(&resource), format(RasterFormat::jpg) 43 | {} 44 | }; 45 | 46 | struct WmtsResources { 47 | std::string capabilitiesUrl; 48 | Layer::list layers; 49 | }; 50 | 51 | std::string wmtsCapabilities(const WmtsResources &resources); 52 | 53 | /** Prepares WMTS support. 54 | */ 55 | void prepareTileMatrixSets(); 56 | 57 | } // namespace wmts 58 | 59 | #endif // mapproxy_support_wtms_hpp_included_ 60 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/gdalsupport/operations.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_gdalsupport_operations_hpp_included_ 28 | #define mapproxy_gdalsupport_operations_hpp_included_ 29 | 30 | #include "../gdalsupport.hpp" 31 | #include "types.hpp" 32 | #include "datasetcache.hpp" 33 | 34 | cv::Mat* warp(DatasetCache &cache, ManagedBuffer &mb 35 | , const GdalWarper::RasterRequest &req); 36 | 37 | GdalWarper::Heightcoded* 38 | heightcode(DatasetCache &cache, ManagedBuffer &mb 39 | , const std::string &vectorDs 40 | , const DemDataset::list &rasterDs 41 | , geo::heightcoding::Config config 42 | , const boost::optional &vectorGeoidGrid 43 | , const GdalWarper::OpenOptions &openOptions 44 | , const LayerEnhancer::map &layerEnancers); 45 | 46 | #endif // mapproxy_gdalsupport_operations_hpp_included_ 47 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/cesiumconf.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_cesiumconf_hpp_included_ 28 | #define mapproxy_support_cesiumconf_hpp_included_ 29 | 30 | #include 31 | 32 | #include 33 | 34 | #include "utility/enum-io.hpp" 35 | 36 | #include "math/geometry_core.hpp" 37 | 38 | #include "vts-libs/vts/basetypes.hpp" 39 | #include "vts-libs/registry/extensions.hpp" 40 | 41 | namespace vts = vtslibs::vts; 42 | namespace vre = vtslibs::registry::extensions; 43 | 44 | /** Cesium browser configuiration. 45 | */ 46 | struct CesiumConf { 47 | typedef boost::optional OString; 48 | vre::Tms tms; 49 | OString boundLayer; 50 | boost::optional defaultView; 51 | 52 | CesiumConf() {} 53 | }; 54 | 55 | void save(const CesiumConf &conf, std::ostream &os); 56 | 57 | #endif // mapproxy_support_cesiumconf_hpp_included_ 58 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/tms-bing.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_tms_bing_hpp_included_ 28 | #define mapproxy_generator_tms_bing_hpp_included_ 29 | 30 | #include 31 | 32 | #include "../generator.hpp" 33 | #include "../definition/tms.hpp" 34 | 35 | namespace generator { 36 | 37 | class TmsBing : public Generator { 38 | public: 39 | TmsBing(const Params ¶ms); 40 | 41 | typedef resource::TmsBing Definition; 42 | 43 | private: 44 | virtual void prepare_impl(Arsenal &arsenal); 45 | virtual vts::MapConfig mapConfig_impl(ResourceRoot root) const; 46 | 47 | virtual Task generateFile_impl(const FileInfo &fileInfo 48 | , Sink &sink) const; 49 | 50 | vr::BoundLayer boundLayer(ResourceRoot root, const std::string &url) const; 51 | 52 | const Definition &definition_; 53 | }; 54 | 55 | } // namespace generator 56 | 57 | #endif // mapproxy_generator_tms_bing_hpp_included_ 58 | -------------------------------------------------------------------------------- /mapproxy/src/tiling/tiling.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_tiling_tiling_hpp_included_ 28 | #define mapproxy_tiling_tiling_hpp_included_ 29 | 30 | #include 31 | 32 | #include "vts-libs/registry.hpp" 33 | #include "vts-libs/vts/tileindex.hpp" 34 | #include "vts-libs/vts/basetypes.hpp" 35 | 36 | namespace tiling { 37 | 38 | struct Config { 39 | int tileSampling; 40 | bool parallel; 41 | bool forceWatertight; 42 | 43 | Config() 44 | : tileSampling(128), parallel(true), forceWatertight(false) 45 | {} 46 | }; 47 | 48 | vtslibs::vts::TileIndex 49 | generate(const boost::filesystem::path &dataset 50 | , const vtslibs::registry::ReferenceFrame &referenceFrame 51 | , const vtslibs::vts::LodRange &lodRange 52 | , const vtslibs::vts::LodTileRange::list &tileRanges 53 | , const Config &config); 54 | 55 | } // namespace tiling 56 | 57 | #endif // mapproxy_tiling_tiling_hpp_included_ 58 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/cesium.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "cesium.hpp" 28 | 29 | #include "cesium/cesium.html.hpp" 30 | #include "cesium/cesium.js.hpp" 31 | #include "cesium/melown-technologies-logo-28.png.hpp" 32 | 33 | namespace cesium { 34 | 35 | const vtslibs::storage::SupportFile::Files supportFiles = 36 | { 37 | { "browser.html" 38 | , { 39 | cesium_html 40 | , sizeof(cesium_html) 41 | , cesium_html_attr_lastModified 42 | , "text/html; charset=utf-8" 43 | } 44 | }, { "cesium.js" 45 | , { 46 | cesium_js 47 | , sizeof(cesium_js) 48 | , cesium_js_attr_lastModified 49 | , "application/javascript; charset=utf-8" 50 | } 51 | }, { "melowntech.png" 52 | , { 53 | melowntech_png 54 | , sizeof(melowntech_png) 55 | , melowntech_png_attr_lastModified 56 | , "image/png" 57 | } 58 | } 59 | }; 60 | 61 | } // namespace cesium 62 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/factory.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_factory_hpp_included_ 28 | #define mapproxy_generator_factory_hpp_included_ 29 | 30 | #include 31 | 32 | #include "../generator.hpp" 33 | 34 | struct Generator::Factory { 35 | typedef std::shared_ptr pointer; 36 | virtual ~Factory() {} 37 | virtual Generator::pointer create(const Params ¶ms) = 0; 38 | 39 | /** If true is returned a default system resource is generated for each 40 | * reference frame. 41 | */ 42 | virtual bool systemInstance() const { return false; } 43 | 44 | /** Factory registry support 45 | */ 46 | typedef std::map Registry; 47 | 48 | static pointer findFactory(const Resource::Generator &type); 49 | 50 | static void registerType(const Resource::Generator &type 51 | , const pointer &factory); 52 | 53 | static Registry ®istry(); 54 | }; 55 | 56 | #endif // mapproxy_generator_factory_hpp_included_ 57 | -------------------------------------------------------------------------------- /mapproxy/src/rf-mask/ogrsupport.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef geo_ogrsupport_hpp_included_ 28 | #define geo_ogrsupport_hpp_included_ 29 | 30 | #include 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | namespace geo { 38 | 39 | typedef std::shared_ptr< ::GDALDataset> VectorDataset; 40 | typedef std::shared_ptr< ::OGRFeature> Feature; 41 | typedef std::shared_ptr< ::OGRGeometry> Geometry; 42 | typedef std::vector Geometries; 43 | 44 | VectorDataset openVectorDataset(const boost::filesystem::path &path); 45 | VectorDataset createVectorDataset(const boost::filesystem::path &path 46 | , ::GDALDriver *driver); 47 | VectorDataset createVectorDataset(const boost::filesystem::path &path 48 | , VectorDataset &driverSource); 49 | Feature feature(::OGRFeatureH f); 50 | Geometry geometry(::OGRGeometryH g, bool clone = false); 51 | 52 | } // namespace geo 53 | 54 | #endif // geo_ogrsupport_hpp_included_ 55 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/resourcebackend/factory.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_resourcebackend_factory_hpp_included_ 28 | #define mapproxy_resourcebackend_factory_hpp_included_ 29 | 30 | #include "../resourcebackend.hpp" 31 | 32 | struct ResourceBackend::Factory { 33 | typedef std::shared_ptr pointer; 34 | typedef ResourceBackend::GenericConfig GenericConfig; 35 | typedef ResourceBackend::TypedConfig TypedConfig; 36 | 37 | virtual ~Factory() {} 38 | virtual ResourceBackend::pointer create(const GenericConfig &genericConfig 39 | , const TypedConfig &config) = 0; 40 | 41 | virtual service::UnrecognizedParser::optional 42 | configure(const std::string &prefix, TypedConfig &config 43 | , const service::UnrecognizedOptions &unrecognized) = 0; 44 | 45 | virtual void printConfig(std::ostream &os, const std::string &prefix 46 | , const TypedConfig &config) = 0; 47 | }; 48 | 49 | #endif // mapproxy_resourcebackend_factory_hpp_included_ 50 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/tms-common.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "utility/premain.hpp" 31 | 32 | #include "jsoncpp/json.hpp" 33 | #include "jsoncpp/as.hpp" 34 | 35 | #include "tms.hpp" 36 | #include "options.hpp" 37 | 38 | namespace resource { 39 | 40 | constexpr Resource::Generator::Type TmsCommon::type; 41 | 42 | void TmsCommon::parse(const Json::Value &value) 43 | { 44 | if (value.isMember("options")) { options = value["options"]; } 45 | } 46 | 47 | void TmsCommon::build(Json::Value &value) const 48 | { 49 | if (!options.empty()) { 50 | value["options"] = boost::any_cast(options); 51 | } 52 | } 53 | 54 | Changed TmsCommon::changed_impl(const DefinitionBase &o) const 55 | { 56 | const auto &other(o.as()); 57 | 58 | // options can change 59 | if (optionsChanged(*this, other)) { return Changed::safely; } 60 | 61 | // not changed 62 | return Changed::no; 63 | } 64 | 65 | } // namespace resource 66 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/cesiumconf.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | 29 | #include "utility/format.hpp" 30 | 31 | #include "jsoncpp/json.hpp" 32 | #include "jsoncpp/io.hpp" 33 | 34 | #include "vts-libs/registry/json.hpp" 35 | 36 | #include "cesiumconf.hpp" 37 | 38 | namespace { 39 | 40 | void build(Json::Value &content, const CesiumConf &conf) 41 | { 42 | content = Json::objectValue; 43 | if (conf.boundLayer) { content["boundLayer"] = *conf.boundLayer; } 44 | if (conf.defaultView) { 45 | auto &dv(content["defaultView"] = Json::arrayValue); 46 | dv.append(conf.defaultView->ll(0)); 47 | dv.append(conf.defaultView->ll(1)); 48 | dv.append(conf.defaultView->ur(0)); 49 | dv.append(conf.defaultView->ur(1)); 50 | } 51 | content["tms"] = vre::asJson(conf.tms); 52 | } 53 | 54 | } // namespace 55 | 56 | void save(const CesiumConf &conf, std::ostream &os) 57 | { 58 | Json::Value content; 59 | build(content, conf); 60 | os.precision(15); 61 | Json::write(os, content); 62 | } 63 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/factory.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | 29 | #include "../error.hpp" 30 | #include "factory.hpp" 31 | 32 | namespace resource { 33 | 34 | namespace { 35 | typedef std::map> Registry; 37 | 38 | Registry& registry() { 39 | static Registry registry; 40 | return registry; 41 | } 42 | 43 | } // namespace 44 | 45 | DefinitionBase::pointer definition(const Resource::Generator &type) 46 | { 47 | const auto &r(registry()); 48 | auto fregistry(r.find(type)); 49 | if (fregistry == r.end()) { 50 | LOGTHROW(err1, UnknownGenerator) 51 | << "Unknown generator type <" << type << ">."; 52 | } 53 | return fregistry->second(); 54 | } 55 | 56 | void registerDefinition(const Resource::Generator &type 57 | , const std::function 58 | &factory) 59 | { 60 | registry().insert(Registry::value_type(type, factory)); 61 | } 62 | 63 | } // namespace resource 64 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "externals/buildsys/common"] 2 | path = externals/buildsys/common 3 | url = https://github.com/melowntech/buildsys-common.git 4 | [submodule "externals/buildsys/cmake"] 5 | path = externals/buildsys/cmake 6 | url = https://github.com/melowntech/buildsys-cmake.git 7 | [submodule "externals/vts-libs"] 8 | path = externals/vts-libs 9 | url = https://github.com/melowntech/vts-libs.git 10 | [submodule "externals/gdal-drivers"] 11 | path = externals/gdal-drivers 12 | url = https://github.com/melowntech/gdal-drivers.git 13 | [submodule "externals/libpydbglog"] 14 | path = externals/libpydbglog 15 | url = https://github.com/melowntech/libpydbglog.git 16 | [submodule "externals/libdbglog"] 17 | path = externals/libdbglog 18 | url = https://github.com/melowntech/libdbglog.git 19 | [submodule "externals/libutility"] 20 | path = externals/libutility 21 | url = https://github.com/melowntech/libutility.git 22 | [submodule "externals/libgeo"] 23 | path = externals/libgeo 24 | url = https://github.com/melowntech/libgeo.git 25 | [submodule "externals/libgeometry"] 26 | path = externals/libgeometry 27 | url = https://github.com/melowntech/libgeometry.git 28 | [submodule "externals/libhttp"] 29 | path = externals/libhttp 30 | url = https://github.com/melowntech/libhttp.git 31 | [submodule "externals/libimgproc"] 32 | path = externals/libimgproc 33 | url = https://github.com/melowntech/libimgproc.git 34 | [submodule "externals/half"] 35 | path = externals/half 36 | url = https://github.com/melowntech/half.git 37 | [submodule "externals/libjsoncpp"] 38 | path = externals/libjsoncpp 39 | url = https://github.com/melowntech/libjsoncpp.git 40 | [submodule "externals/libmath"] 41 | path = externals/libmath 42 | url = https://github.com/melowntech/libmath.git 43 | [submodule "externals/libservice"] 44 | path = externals/libservice 45 | url = https://github.com/melowntech/libservice.git 46 | [submodule "externals/libpysupport"] 47 | path = externals/libpysupport 48 | url = https://github.com/melowntech/libpysupport.git 49 | [submodule "externals/libqmf"] 50 | path = externals/libqmf 51 | url = https://github.com/melowntech/libqmf.git 52 | [submodule "externals/libminiball"] 53 | path = externals/libminiball 54 | url = https://github.com/melowntech/libminiball.git 55 | [submodule "externals/libsemantic"] 56 | path = externals/libsemantic 57 | url = https://github.com/melowntech/libsemantic.git 58 | [submodule "externals/libshtools"] 59 | path = externals/libshtools 60 | url = https://github.com/melowntech/libshtools.git 61 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/surface-meta.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_definition_surface_meta_hpp_included_ 28 | #define mapproxy_definition_surface_meta_hpp_included_ 29 | 30 | #include "../resource.hpp" 31 | 32 | // fwd 33 | namespace Json { class Value; } 34 | 35 | namespace resource { 36 | 37 | // meta surface: combines existing surface with existing TMS 38 | 39 | class SurfaceMeta : public DefinitionBase { 40 | public: 41 | Resource::Id surface; 42 | Resource::Id tms; 43 | 44 | static constexpr Resource::Generator::Type type 45 | = Resource::Generator::Type::surface; 46 | 47 | static constexpr char driverName[] = "surface-meta"; 48 | 49 | protected: 50 | virtual void from_impl(const Json::Value &value); 51 | virtual void to_impl(Json::Value &value) const; 52 | virtual Changed changed_impl(const DefinitionBase &other) const; 53 | virtual Resource::Id::list needsResources_impl() const; 54 | virtual bool needsRanges_impl() const { return false; } 55 | }; 56 | 57 | } // namespace resource 58 | 59 | #endif // mapproxy_definition_surface_meta_hpp_included_ 60 | 61 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/coverage.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_coverage_hpp_included_ 28 | #define mapproxy_support_coverage_hpp_included_ 29 | 30 | 31 | #include "vts-libs/vts/nodeinfo.hpp" 32 | #include "imgproc/rastermask/mappedqtree.hpp" 33 | 34 | namespace vts = vtslibs::vts; 35 | 36 | typedef imgproc::mappedqtree::RasterMask MaskTree; 37 | 38 | /** Complex converage, used for surface mask. 39 | */ 40 | vts::NodeInfo::CoverageMask 41 | generateCoverage(const int size, const vts::NodeInfo &nodeInfo 42 | , const imgproc::mappedqtree::RasterMask &maskTree 43 | , vts::NodeInfo::CoverageType type 44 | = vts::NodeInfo::CoverageType::pixel); 45 | 46 | /** Boundlayer mask, used for TMS mask. 47 | */ 48 | cv::Mat boundlayerMask(const vts::TileId &tileId, const MaskTree &maskTree); 49 | 50 | /** Helper for positive/negative bit shift 51 | */ 52 | template 53 | T applyShift(T value, int shift) 54 | { 55 | if (shift >= 0) { 56 | return value << shift; 57 | } 58 | return value >> -shift; 59 | } 60 | 61 | #endif // mapproxy_support_coverage_hpp_included_ 62 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/layerenancer.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_layerenhancer_hpp_included_ 28 | #define mapproxy_support_layerenhancer_hpp_included_ 29 | 30 | #include 31 | #include 32 | 33 | struct LayerEnhancer { 34 | std::string key; 35 | std::string databasePath; 36 | std::string table; 37 | 38 | LayerEnhancer() = default; 39 | LayerEnhancer(std::string key, std::string databasePath 40 | , std::string table) 41 | : key(std::move(key)), databasePath(std::move(databasePath)) 42 | , table(std::move(table)) 43 | {} 44 | 45 | bool operator==(const LayerEnhancer &o) const { 46 | return ((key == o.key) 47 | && (databasePath == o.databasePath) 48 | && (table == o.table)); 49 | } 50 | 51 | bool operator!=(const LayerEnhancer &o) const { 52 | return ((key != o.key) 53 | || (databasePath != o.databasePath) 54 | || (table != o.table)); 55 | } 56 | 57 | typedef std::map map; 58 | }; 59 | 60 | #endif // mapproxy_support_layerenhancer_hpp_included_ 61 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/srs.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_srs_hpp_included_ 28 | #define mapproxy_support_srs_hpp_included_ 29 | 30 | #include 31 | 32 | #include "vts-libs/vts/nodeinfo.hpp" 33 | #include "vts-libs/vts/csconvertor.hpp" 34 | 35 | namespace vts = vtslibs::vts; 36 | 37 | vts::CsConvertor sds2phys(const vts::NodeInfo &nodeInfo 38 | , const boost::optional &geoidGrid); 39 | 40 | vts::CsConvertor sds2nav(const vts::NodeInfo &nodeInfo 41 | , const boost::optional &geoidGrid); 42 | 43 | geo::SrsDefinition sds(const vts::NodeInfo &nodeInfo 44 | , const boost::optional &geoidGrid); 45 | 46 | /** Convertor between geoid-shifted SDS to raw SDS 47 | * Returns dummy convertor if no grid applies. 48 | */ 49 | vts::CsConvertor sdsg2sdsr(const vts::NodeInfo &nodeInfo 50 | , const boost::optional &geoidGrid); 51 | 52 | /** Convertor between physical coordinates and node's SDS. 53 | */ 54 | vts::CsConvertor phys2sds(const vts::NodeInfo &nodeInfo); 55 | 56 | #endif // mapproxy_support_srs_hpp_included_ 57 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/gdalsupport/workrequest.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_gdalsupport_workrequest_hpp_included_ 28 | #define mapproxy_gdalsupport_workrequest_hpp_included_ 29 | 30 | #include "types.hpp" 31 | #include "datasetcache.hpp" 32 | #include "workrequestfwd.hpp" 33 | 34 | // forward declaration for custom sh request 35 | class WorkRequest : boost::noncopyable { 36 | public: 37 | WorkRequest(ManagedBuffer &sm) : sm_(sm) {} 38 | 39 | virtual ~WorkRequest(); 40 | virtual void process(bi::interprocess_mutex &mutex, DatasetCache &cache) 41 | = 0; 42 | 43 | using Response = WorkResponse; 44 | 45 | virtual Response response(Lock &lock) = 0; 46 | 47 | /** Destroys this instance. Needed because ManagedBuffer::destroy_ptr() 48 | * doesn't cope with polymorphism. 49 | * 50 | * Should call sm().destroy_ptr(this), nothing else! 51 | */ 52 | virtual void destroy() = 0; 53 | 54 | ManagedBuffer& sm() { return sm_; }; 55 | 56 | private: 57 | ManagedBuffer &sm_; 58 | }; 59 | 60 | struct WorkRequestParams { 61 | ManagedBuffer &sm; 62 | WorkRequestParams(ManagedBuffer &sm) : sm(sm) {} 63 | }; 64 | 65 | #endif // mapproxy_gdalsupport_workrequest_hpp_included_ 66 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/atlas.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | 29 | #include "vts-libs/vts/opencv/atlas.hpp" 30 | 31 | #include "atlas.hpp" 32 | 33 | namespace vts = vtslibs::vts; 34 | 35 | void sendImage(const cv::Mat &image, const Sink::FileInfo &sfi 36 | , RasterFormat format, bool atlas, Sink &sink) 37 | { 38 | if (atlas) { 39 | // serialize as a single-image atlas 40 | 41 | // TODO: make quality configurable 42 | vts::opencv::Atlas a(75); 43 | a.add(image); 44 | 45 | std::ostringstream os; 46 | a.serialize(os); 47 | sink.content(os.str(), sfi); 48 | return; 49 | } 50 | 51 | // serialize as a raw image 52 | std::vector buf; 53 | switch (format) { 54 | case RasterFormat::jpg: 55 | // TODO: make quality configurable 56 | cv::imencode(".jpg", image, buf 57 | , { cv::IMWRITE_JPEG_QUALITY, 75 }); 58 | break; 59 | 60 | case RasterFormat::png: 61 | cv::imencode(".png", image, buf 62 | , { cv::IMWRITE_PNG_COMPRESSION, 9 }); 63 | break; 64 | } 65 | 66 | sink.content(buf, sfi); 67 | } 68 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/files.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "files.hpp" 28 | 29 | #include "generator/files/defaultstyle.json.hpp" 30 | #include "generator/files/defaultstyle.mesh.json.hpp" 31 | #include "generator/files/wmtsreadme.md.hpp" 32 | #include "generator/files/cesiumreadme.md.hpp" 33 | 34 | namespace files { 35 | 36 | const vtslibs::storage::SupportFile defaultStyle = { 37 | defaultstyle_json 38 | , sizeof(defaultstyle_json) 39 | , defaultstyle_json_attr_lastModified 40 | , "application/json; charset=utf-8" 41 | }; 42 | 43 | const vtslibs::storage::SupportFile defaultMeshStyle = { 44 | defaultstyle_mesh_json 45 | , sizeof(defaultstyle_mesh_json) 46 | , defaultstyle_mesh_json_attr_lastModified 47 | , "application/json; charset=utf-8" 48 | }; 49 | 50 | const vtslibs::storage::SupportFile wmtsReadme = { 51 | wmtsreadme_md 52 | , sizeof(wmtsreadme_md) 53 | , wmtsreadme_md_attr_lastModified 54 | , "text/markdown; charset=utf-8" 55 | }; 56 | 57 | const vtslibs::storage::SupportFile cesiumReadme = { 58 | cesiumreadme_md 59 | , sizeof(cesiumreadme_md) 60 | , cesiumreadme_md_attr_lastModified 61 | , "text/markdown; charset=utf-8" 62 | }; 63 | 64 | } // namespace files 65 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/resourcebackend/python.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_resourcebackend_python_hpp_included_ 28 | #define mapproxy_resourcebackend_python_hpp_included_ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "../resourcebackend.hpp" 37 | 38 | namespace python = boost::python; 39 | 40 | namespace resource_backend { 41 | 42 | class Python : public ResourceBackend { 43 | public: 44 | struct Config { 45 | typedef std::map Options; 46 | boost::filesystem::path script; 47 | Options options; 48 | }; 49 | 50 | Python(const GenericConfig &genericConfig, const Config &config); 51 | 52 | private: 53 | virtual Resource::map load_impl() const; 54 | 55 | virtual void error_impl(const Resource::Id &resourceId 56 | , const std::string &message) const; 57 | 58 | void errorRaw(const Resource::Id &resourceId 59 | , const std::string &message) const; 60 | 61 | mutable std::recursive_mutex mutex_; 62 | boost::filesystem::path script_; 63 | python::object run_; 64 | python::object error_; 65 | }; 66 | 67 | } // namespace resource_backend 68 | 69 | #endif // mapproxy_resourcebackend_python_hpp_included_ 70 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/tms-bing.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "utility/premain.hpp" 31 | 32 | #include "jsoncpp/json.hpp" 33 | #include "jsoncpp/as.hpp" 34 | 35 | #include "tms.hpp" 36 | #include "factory.hpp" 37 | 38 | namespace resource { 39 | 40 | constexpr char TmsBing::driverName[]; 41 | 42 | MAPPROXY_DEFINITION_REGISTER(TmsBing) 43 | 44 | namespace { 45 | 46 | void parseDefinition(TmsBing &def 47 | , const Json::Value &value) 48 | { 49 | std::string s; 50 | 51 | Json::get(def.metadataUrl, value, "metadataUrl"); 52 | } 53 | 54 | void buildDefinition(Json::Value &value 55 | , const TmsBing &def) 56 | { 57 | value["metadataUrl"] = def.metadataUrl; 58 | } 59 | 60 | } // namespace 61 | 62 | void TmsBing::from_impl(const Json::Value &value) 63 | { 64 | parseDefinition(*this, value); 65 | } 66 | 67 | void TmsBing::to_impl(Json::Value &value) const 68 | { 69 | buildDefinition(value, *this); 70 | } 71 | 72 | Changed TmsBing::changed_impl(const DefinitionBase &o) const 73 | { 74 | const auto &other(o.as()); 75 | 76 | // ignore metadata URL, we it has no effect on this resource 77 | if (metadataUrl != other.metadataUrl) { return Changed::safely; } 78 | 79 | return TmsCommon::changed_impl(o); 80 | } 81 | 82 | } // namespace resource 83 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/surface-meta.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_surface_meta_hpp_included_ 28 | #define mapproxy_generator_surface_meta_hpp_included_ 29 | 30 | #include "../generator.hpp" 31 | #include "../definition.hpp" 32 | 33 | #include "providers.hpp" 34 | 35 | namespace vts = vtslibs::vts; 36 | namespace vr = vtslibs::registry; 37 | 38 | namespace generator { 39 | 40 | class SurfaceMeta : public Generator { 41 | public: 42 | SurfaceMeta(const Params ¶ms); 43 | 44 | ~SurfaceMeta(); 45 | 46 | typedef resource::SurfaceMeta Definition; 47 | 48 | private: 49 | virtual void prepare_impl(Arsenal &arsenal); 50 | virtual vts::MapConfig mapConfig_impl(ResourceRoot root) const ; 51 | 52 | virtual Task generateFile_impl(const FileInfo &fileInfo 53 | , Sink &sink) const; 54 | 55 | Generator::Task tileindex(const SurfaceFileInfo &fileInfo, Sink &sink) 56 | const; 57 | 58 | vts::FullTileSetProperties properties() const; 59 | 60 | const Definition &definition_; 61 | 62 | pointer surface_; 63 | pointer tms_; 64 | 65 | /** Pointer owned by surface. 66 | */ 67 | VtsTilesetProvider *ts_; 68 | 69 | /** Pointer owned by tms. 70 | */ 71 | VtsAtlasProvider *atlas_; 72 | 73 | MetatileOverrides metatileOverrides_; 74 | }; 75 | 76 | } // namespace generator 77 | 78 | #endif // mapproxy_generator_surface_meta_hpp_included_ 79 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/mmapped/tilesetindex.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "tilesetindex.hpp" 28 | 29 | namespace mmapped { 30 | 31 | bool Index::meta(const vts::TileId &tileId) const 32 | { 33 | return tileIndex.validSubtree 34 | (tileId.lod, vts::parent(tileId, metaBinaryOrder_)); 35 | } 36 | 37 | bool Index::check(const vts::TileId &tileId, vts::TileFile type) const 38 | { 39 | switch (type) { 40 | case vts::TileFile::meta: 41 | return meta(tileId); 42 | case vts::TileFile::mesh: 43 | return tileIndex.checkMask(tileId, vts::TileIndex::Flag::mesh); 44 | case vts::TileFile::atlas: 45 | return tileIndex.checkMask(tileId, vts::TileIndex::Flag::atlas); 46 | case vts::TileFile::navtile: 47 | return tileIndex.checkMask(tileId, vts::TileIndex::Flag::navtile); 48 | 49 | default: return false; 50 | } 51 | } 52 | 53 | vts::TileIndex::Flag::value_type 54 | Index::checkAndGetFlags(const vts::TileId &tileId, vts::TileFile type) const 55 | { 56 | const auto flags(tileIndex.get(tileId)); 57 | 58 | switch (type) { 59 | case vts::TileFile::mesh: 60 | return (flags & vts::TileIndex::Flag::mesh) ? flags : 0; 61 | case vts::TileFile::atlas: 62 | return (flags & vts::TileIndex::Flag::atlas) ? flags : 0; 63 | case vts::TileFile::navtile: 64 | return (flags & vts::TileIndex::Flag::navtile) ? flags : 0; 65 | 66 | default: return 0; 67 | } 68 | } 69 | 70 | } // namespace mmapped 71 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/mmapped/tileflags.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_mmapped_tileflags_hpp_included_ 28 | #define mapproxy_support_mmapped_tileflags_hpp_included_ 29 | 30 | #include 31 | #include 32 | 33 | #include "vts-libs/vts/tileindex.hpp" 34 | 35 | namespace vts = vtslibs::vts; 36 | 37 | /** Simplified tileindex that employs memory mapped quadtrees. 38 | * 39 | * Used to save precious memory. 40 | * 41 | * Handles only 3 flags: mesh, watertight and navtile flags, space for 5 more 42 | * flags is available. 43 | * 44 | * Non-leaf nodes are marked by invalid combination (mesh=false, 45 | * watertight=true) 46 | */ 47 | namespace mmapped { 48 | 49 | struct TileFlag { 50 | typedef std::uint8_t value_type; 51 | 52 | enum : value_type { 53 | mesh = vts::TileIndex::Flag::mesh // mesh (or some other data) present 54 | , watertight = vts::TileIndex::Flag::watertight // no holes in data 55 | , navtile = vts::TileIndex::Flag::navtile // navile present 56 | 57 | , data = mesh // alias for mesh 58 | , none = 0x00 // nothing set 59 | , any = 0xff // anything set 60 | /** invalid value used for internal tree nodes 61 | */ 62 | , invalid = any & ~watertight 63 | }; 64 | 65 | static bool leaf(value_type value) { return value != invalid; } 66 | static bool internal(value_type value) { return value == invalid; } 67 | }; 68 | 69 | } // namespace mmapped 70 | 71 | #endif // mapproxy_support_mmapped_tileflags_hpp_included_ 72 | -------------------------------------------------------------------------------- /mapproxy/src/generatevrtwo/io.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generatevrtwo_io_hpp_included_ 28 | #define mapproxy_generatevrtwo_io_hpp_included_ 29 | 30 | #include 31 | 32 | #include "utility/streams.hpp" 33 | 34 | #include "./generatevrtwo.hpp" 35 | 36 | namespace vrtwo { 37 | 38 | template 39 | inline std::basic_istream& 40 | operator>>(std::basic_istream &is, Color &c) 41 | { 42 | double v; 43 | auto comma(utility::match(',')); 44 | 45 | while (is) { 46 | if (!(is >> v)) { break; } 47 | c.value.push_back(v); 48 | if (!(is >> comma)) { break; } 49 | if (!comma.matched) { break; } 50 | } 51 | 52 | return is; 53 | } 54 | 55 | template 56 | inline std::basic_ostream& 57 | operator<<(std::basic_ostream &os, const Color &c) 58 | { 59 | bool first(true); 60 | for (auto value : c.value) { 61 | if (!first) { 62 | os << ','; 63 | } else { 64 | first = false; 65 | } 66 | os << value; 67 | } 68 | return os; 69 | } 70 | 71 | template 72 | inline std::basic_ostream& 73 | operator<<(std::basic_ostream &os 74 | , const Color::optional &c) 75 | { 76 | if (c) { return os << *c; } 77 | return os << "none"; 78 | } 79 | 80 | } // namespace vrtwo 81 | 82 | #endif // mapproxy_generatevrtwo_io_hpp_included_ 83 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/grid.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_grid_hpp_included_ 28 | #define mapproxy_support_grid_hpp_included_ 29 | 30 | #include 31 | 32 | #include "math/geometry_core.hpp" 33 | 34 | template 35 | class Grid { 36 | public: 37 | typedef T value_type; 38 | 39 | Grid(const math::Size2 &size, const T &fill = T()) 40 | : size_(size) 41 | , grid_(math::area(size), fill) 42 | {} 43 | 44 | T& operator()(int x, int y) { 45 | return grid_[index(x, y)]; 46 | } 47 | 48 | const T& operator()(int x, int y) const { 49 | return grid_[index(x, y)]; 50 | } 51 | 52 | /** Returns pointer to pixel or null if pixel is invalid 53 | */ 54 | template 55 | const T* operator()(const Mask &mask, int x, int y) const { 56 | if (!mask(x, y)) { return nullptr; } 57 | return &grid_[index(x, y)]; 58 | } 59 | 60 | private: 61 | inline int index(int x, int y) const { 62 | #ifndef NDEBUG 63 | // this is compiled in only in debug mode 64 | if ((x < 0) || (x >= size_.width) 65 | || (y < 0) || (y >= size_.height)) 66 | { 67 | LOGTHROW(err3, Error) 68 | << "Invalid index [" << x << ", " << y << "] in grid of size " 69 | << size_ << ". Go and fix your code,"; 70 | } 71 | #endif // NDEBUG 72 | return y * size_.width + x; 73 | } 74 | 75 | math::Size2 size_; 76 | std::vector grid_; 77 | }; 78 | 79 | #endif // mapproxy_support_grid_hpp_included_ 80 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/tms-raster-solid.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "utility/premain.hpp" 28 | 29 | #include "jsoncpp/json.hpp" 30 | #include "jsoncpp/as.hpp" 31 | 32 | #include "tms.hpp" 33 | #include "factory.hpp" 34 | 35 | namespace resource { 36 | 37 | constexpr char TmsRasterSolid::driverName[]; 38 | 39 | MAPPROXY_DEFINITION_REGISTER(TmsRasterSolid) 40 | 41 | namespace { 42 | 43 | void parseDefinition(TmsRasterSolid &def, const Json::Value &value) 44 | { 45 | const auto &color(Json::check(value["color"], Json::arrayValue)); 46 | 47 | Json::get(def.color[0], color, 0, "definition.color"); 48 | Json::get(def.color[1], color, 1, "definition.color"); 49 | Json::get(def.color[2], color, 2, "definition.color"); 50 | 51 | def.parse(value); 52 | } 53 | 54 | void buildDefinition(Json::Value &value, const TmsRasterSolid &def) 55 | { 56 | auto &color(value["color"] = Json::arrayValue); 57 | 58 | color.append(def.color[0]); 59 | color.append(def.color[1]); 60 | color.append(def.color[2]); 61 | 62 | def.build(value); 63 | } 64 | 65 | } // namespace 66 | 67 | void TmsRasterSolid::from_impl(const Json::Value &value) 68 | { 69 | parseDefinition(*this, value); 70 | } 71 | 72 | void TmsRasterSolid::to_impl(Json::Value &value) const 73 | { 74 | buildDefinition(value, *this); 75 | } 76 | 77 | Changed TmsRasterSolid::changed_impl(const DefinitionBase &o) const 78 | { 79 | const auto &other(o.as()); 80 | 81 | if (color != other.color) { return Changed::yes; } 82 | 83 | return TmsRasterSynthetic::changed_impl(other); 84 | } 85 | 86 | } // namespace resource 87 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/fileclass.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "fileclass.hpp" 28 | 29 | namespace po = boost::program_options; 30 | 31 | void FileClassSettings::from(const boost::any &value) 32 | { 33 | // TODO: implement me 34 | (void) value; 35 | } 36 | 37 | void FileClassSettings::to(boost::any &value) const 38 | { 39 | // TODO: implement me 40 | (void) value; 41 | } 42 | 43 | void FileClassSettings::configuration(po::options_description &od 44 | , const std::string &prefix) 45 | { 46 | auto ao(od.add_options()); 47 | 48 | const auto registerTimes([&](Times ×, const std::string &prefix 49 | , const std::string &what 50 | , const std::string &help) 51 | { 52 | for (auto fc : enumerationValues(FileClass())) { 53 | auto name(boost::lexical_cast(fc)); 54 | ao((prefix + name).c_str() 55 | , po::value(×[static_cast(fc)]) 56 | ->required()->default_value(times[static_cast(fc)]) 57 | , (what + " of file class <" + name + ">; " + help).c_str()); 58 | } 59 | }); 60 | 61 | registerTimes(maxAges_, prefix + "max-age." 62 | , "Max age" 63 | , ">=0: Cache-Control: max-age=???, " 64 | "<0: Cache-Control=no-cache."); 65 | 66 | registerTimes(staleWhileRevalidate_, prefix + "stale-while-revalidate." 67 | , "Stale-while-revalidate value " 68 | , "if >0: adds stale-while-revalidate=??? after max-age."); 69 | } 70 | 71 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/mmapped/tilesetindex.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_mmapped_tilesetindex_hpp_included_ 28 | #define mapproxy_support_mmapped_tilesetindex_hpp_included_ 29 | 30 | #include "tileindex.hpp" 31 | 32 | namespace mmapped { 33 | 34 | class Index { 35 | public: 36 | typedef std::shared_ptr pointer; 37 | 38 | Index(unsigned int metaBinaryOrder, const boost::filesystem::path &path) 39 | : tileIndex(path) 40 | , metaBinaryOrder_(metaBinaryOrder) 41 | {} 42 | 43 | /** Tile index (tile data presence flags) 44 | */ 45 | const TileIndex tileIndex; 46 | 47 | bool check(const vts::TileId &tileId, vts::TileFile type) const; 48 | 49 | bool real(const vts::TileId &tileId) const; 50 | 51 | bool meta(const vts::TileId &tileId) const; 52 | 53 | bool navtile(const vts::TileId &tileId) const; 54 | 55 | /** Checks file type and returns flags in case of match. 56 | */ 57 | vts::TileIndex::Flag::value_type 58 | checkAndGetFlags(const vts::TileId &tileId, vts::TileFile type) const; 59 | 60 | unsigned int metaBinaryOrder() const { return metaBinaryOrder_; } 61 | 62 | private: 63 | unsigned int metaBinaryOrder_; 64 | }; 65 | 66 | // inlines 67 | 68 | inline bool Index::real(const vts::TileId &tileId) const 69 | { 70 | return (tileIndex.get(tileId) & vts::TileIndex::Flag::real); 71 | 72 | } 73 | 74 | inline bool Index::navtile(const vts::TileId &tileId) const { 75 | return (tileIndex.get(tileId) & vts::TileIndex::Flag::navtile); 76 | } 77 | 78 | } // namespace mmapped 79 | 80 | #endif // mapproxy_support_mmapped_tilesetindex_hpp_included_ 81 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/tilejson.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_tilejson_hpp_included_ 28 | #define mapproxy_support_tilejson_hpp_included_ 29 | 30 | #include 31 | 32 | #include 33 | 34 | #include "utility/enum-io.hpp" 35 | 36 | #include "math/geometry_core.hpp" 37 | 38 | #include "vts-libs/vts/basetypes.hpp" 39 | 40 | namespace vts = vtslibs::vts; 41 | 42 | /** Minimal needed TileJson file format implementation. 43 | */ 44 | struct LayerJson { 45 | typedef boost::optional OString; 46 | enum class Scheme { xyz, tms }; 47 | struct Version { 48 | int maj, min, patch; 49 | Version(int maj = 0, int min = 0, int patch = 0) 50 | : maj(maj), min(min), patch(patch) 51 | {} 52 | }; 53 | 54 | typedef std::vector TileRanges; 55 | typedef std::vector Available; 56 | 57 | Version tilejson; 58 | Version version; 59 | OString format; 60 | OString name; 61 | OString description; 62 | Scheme scheme; 63 | OString projection; 64 | math::Extents2 bounds; 65 | vts::LodRange zoom; 66 | Available available; 67 | std::vector tiles; 68 | OString attribution; 69 | 70 | LayerJson() 71 | : tilejson(2, 0, 0), version(1, 0, 0), scheme(Scheme::xyz) 72 | , bounds(-180, -90, 180, 90) 73 | {} 74 | }; 75 | 76 | UTILITY_GENERATE_ENUM_IO(LayerJson::Scheme, 77 | ((xyz)) 78 | ((tms))) 79 | 80 | void save(const LayerJson &layer, std::ostream &os); 81 | 82 | #endif // mapproxy_support_tilejson_hpp_included_ 83 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/geodata-vector.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_geodata_vector_hpp_included_ 28 | #define mapproxy_generator_geodata_vector_hpp_included_ 29 | 30 | #include "vts-libs/vts/tileset/tilesetindex.hpp" 31 | 32 | #include "geodatavectorbase.hpp" 33 | 34 | namespace generator { 35 | 36 | class GeodataVector : public GeodataVectorBase { 37 | public: 38 | GeodataVector(const Params ¶ms); 39 | 40 | typedef resource::GeodataVector Definition; 41 | 42 | private: 43 | virtual void prepare_impl(Arsenal &arsenal); 44 | 45 | virtual vts::MapConfig mapConfig_impl(ResourceRoot root) const; 46 | virtual vr::FreeLayer freeLayer_impl(ResourceRoot root) const; 47 | 48 | virtual void generateMetatile(Sink &sink 49 | , const GeodataFileInfo &fileInfo 50 | , Arsenal &arsenal) const; 51 | 52 | virtual void generateGeodata(Sink &sink 53 | , const GeodataFileInfo &fileInfo 54 | , Arsenal &arsenal) const; 55 | 56 | GdalWarper::Heightcoded::pointer 57 | heightcode(const DemDataset::list &datasets 58 | , GdalWarper &warper, Aborter &aborter) const; 59 | 60 | Definition definition_; 61 | 62 | const DemDataset dem_; 63 | 64 | const vr::Srs physicalSrs_; 65 | 66 | /** Output metadata. 67 | */ 68 | geo::heightcoding::Metadata metadata_; 69 | 70 | /** Path to cached output data. 71 | */ 72 | boost::filesystem::path dataPath_; 73 | }; 74 | 75 | } // namespace generator 76 | 77 | #endif // mapproxy_generator_geodata_vector_hpp_included_ 78 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/geodata-vector-tiled.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_geodata_vector_tiled_hpp_included_ 28 | #define mapproxy_generator_geodata_vector_tiled_hpp_included_ 29 | 30 | #include 31 | 32 | #include "geo/geodataset.hpp" 33 | 34 | #include "vts-libs/vts/urltemplate.hpp" 35 | 36 | #include "../support/mmapped/tilesetindex.hpp" 37 | #include "geodatavectorbase.hpp" 38 | 39 | namespace generator { 40 | 41 | class GeodataVectorTiled : public GeodataVectorBase { 42 | public: 43 | GeodataVectorTiled(const Params ¶ms); 44 | 45 | typedef resource::GeodataVectorTiled Definition; 46 | 47 | private: 48 | virtual void prepare_impl(Arsenal &arsenal); 49 | 50 | virtual vts::MapConfig mapConfig_impl(ResourceRoot root) const; 51 | virtual vr::FreeLayer freeLayer_impl(ResourceRoot root) const; 52 | 53 | virtual void generateMetatile(Sink &sink 54 | , const GeodataFileInfo &fileInfo 55 | , Arsenal &arsenal) const; 56 | 57 | virtual void generateGeodata(Sink &sink 58 | , const GeodataFileInfo &fileInfo 59 | , Arsenal &arsenal) const; 60 | 61 | Definition definition_; 62 | 63 | /** Path to /dem dataset 64 | */ 65 | const DemDataset dem_; 66 | 67 | geo::GeoDataset::Descriptor demDescriptor_; 68 | double effectiveGsdArea_; 69 | bool effectiveGsdAreaComputed_; 70 | 71 | vts::UrlTemplate tileFile_; 72 | 73 | const vr::Srs &physicalSrs_; 74 | 75 | boost::optional index_; 76 | }; 77 | 78 | } // namespace generator 79 | 80 | #endif // mapproxy_generator_geodata_vector_tiled_hpp_included_ 81 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/parse.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "jsoncpp/json.hpp" 28 | #include "jsoncpp/as.hpp" 29 | 30 | #include "vts-libs/registry/json.hpp" 31 | #include "vts-libs/registry/py.hpp" 32 | 33 | #include "../error.hpp" 34 | 35 | #include "parse.hpp" 36 | 37 | namespace vf = geo::vectorformat; 38 | 39 | namespace resource { 40 | 41 | void parse(geo::VectorFormat &format, const Json::Value &value) 42 | { 43 | Json::check(value, Json::stringValue); 44 | try { 45 | format = boost::lexical_cast(value); 46 | } catch (const boost::bad_lexical_cast&) { 47 | utility::raise 48 | ("Value stored in format is not a valid height" 49 | " coded data format."); 50 | } 51 | } 52 | 53 | void build(Json::Value &value, const geo::VectorFormat &format) 54 | { 55 | value = boost::lexical_cast(format); 56 | } 57 | 58 | void parse(vf::Config &config, geo::VectorFormat format 59 | , const Json::Value &value) 60 | { 61 | if (!value.isObject()) { 62 | LOGTHROW(err1, FormatError) 63 | << "Geodata definition[formatConfig] is not an object."; 64 | } 65 | 66 | switch (format) { 67 | case geo::VectorFormat::geodataJson: { 68 | auto &c(createGeodataConfig(config)); 69 | Json::getOpt(c.resolution, value, "resolution"); 70 | } break; 71 | 72 | default: 73 | // ignore 74 | break; 75 | } 76 | } 77 | 78 | void build(Json::Value &value, const vf::Config &config) 79 | { 80 | value = Json::objectValue; 81 | if (const auto *c = boost::get(&config)) { 82 | value["resolution"] = c->resolution; 83 | } 84 | } 85 | 86 | } // namespace resource 87 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/surface-spheroid.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_surface_spheroid_hpp_included_ 28 | #define mapproxy_generator_surface_spheroid_hpp_included_ 29 | 30 | #include "vts-libs/vts/tileset/tilesetindex.hpp" 31 | #include "vts-libs/vts/tileset/properties.hpp" 32 | 33 | #include "surface.hpp" 34 | 35 | namespace vts = vtslibs::vts; 36 | 37 | namespace generator { 38 | 39 | class SurfaceSpheroid : public SurfaceBase { 40 | public: 41 | SurfaceSpheroid(const Params ¶ms); 42 | 43 | typedef resource::SurfaceSpheroid Definition; 44 | 45 | private: 46 | virtual void prepare_impl(Arsenal &arsenal); 47 | virtual vts::MapConfig mapConfig_impl(ResourceRoot root) const; 48 | 49 | virtual void generateMetatile(const vts::TileId &tileId 50 | , Sink &sink 51 | , const SurfaceFileInfo &fileInfo 52 | , Arsenal &arsenal 53 | , const MetatileOverrides &overrides) 54 | const; 55 | 56 | virtual AugmentedMesh generateMeshImpl(const vts::NodeInfo &nodeInfo 57 | , Sink &sink 58 | , Arsenal &arsenal 59 | , const OptHeight&) const; 60 | 61 | virtual void generateNavtile(const vts::TileId &tileId 62 | , Sink &sink 63 | , const SurfaceFileInfo &fileInfo 64 | , Arsenal &arsenal) const; 65 | 66 | const Definition &definition_; 67 | }; 68 | 69 | } // namespace generator 70 | 71 | #endif // mapproxy_generator_surface_spheroid_hpp_included_ 72 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/tms-raster-remote.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "utility/premain.hpp" 31 | 32 | #include "jsoncpp/json.hpp" 33 | #include "jsoncpp/as.hpp" 34 | 35 | #include "tms.hpp" 36 | #include "factory.hpp" 37 | 38 | namespace resource { 39 | 40 | constexpr char TmsRasterRemote::driverName[]; 41 | 42 | MAPPROXY_DEFINITION_REGISTER(TmsRasterRemote) 43 | 44 | namespace { 45 | 46 | void parseDefinition(TmsRasterRemote &def 47 | , const Json::Value &value) 48 | { 49 | std::string s; 50 | 51 | Json::get(def.remoteUrl, value, "remoteUrl"); 52 | if (value.isMember("mask")) { 53 | std::string s; 54 | Json::get(s, value, "mask"); 55 | def.mask = s;; 56 | } 57 | 58 | def.parse(value); 59 | } 60 | 61 | void buildDefinition(Json::Value &value 62 | , const TmsRasterRemote &def) 63 | { 64 | value["remoteUrl"] = def.remoteUrl; 65 | if (def.mask) { 66 | value["mask"] = def.mask->string(); 67 | } 68 | 69 | def.build(value); 70 | } 71 | 72 | } // namespace 73 | 74 | void TmsRasterRemote::from_impl(const Json::Value &value) 75 | { 76 | parseDefinition(*this, value); 77 | } 78 | 79 | void TmsRasterRemote::to_impl(Json::Value &value) const 80 | { 81 | buildDefinition(value, *this); 82 | } 83 | 84 | Changed TmsRasterRemote::changed_impl(const DefinitionBase &o) 85 | const 86 | { 87 | const auto &other(o.as()); 88 | 89 | if (remoteUrl != other.remoteUrl) { return Changed::yes; } 90 | if (mask != other.mask) { return Changed::yes; } 91 | 92 | return TmsCommon::changed_impl(o); 93 | } 94 | 95 | } // namespace resource 96 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/mapproxy.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_mapproxy_hpp_included_ 28 | #define mapproxy_mapproxy_hpp_included_ 29 | 30 | #include 31 | 32 | #include 33 | 34 | #include "service/ctrlclient.hpp" 35 | 36 | #include "resource.hpp" 37 | 38 | /** This is not mapproxy server but client to query running mapproxy. 39 | * Mapproxy itself is in main.cpp. 40 | */ 41 | class Mapproxy { 42 | public: 43 | Mapproxy(const std::string &ctrl) 44 | : ctrl_(service::ctrlClientFactory(ctrl)) 45 | {} 46 | 47 | /** Is given reference frame supported? 48 | */ 49 | bool supportsReferenceFrame(const std::string &referenceFrame); 50 | 51 | /** Is the given resource known by mapproxy. 52 | */ 53 | bool has(const Resource::Id &resourceId) const; 54 | 55 | /** Is given resource ready? 56 | */ 57 | bool isReady(const Resource::Id &resourceId) const; 58 | 59 | /** Compose URL this resource is available at. 60 | */ 61 | std::string url(const Resource::Id &resourceId) const; 62 | 63 | /** Update resources. 64 | * \return timestamp in usec 65 | */ 66 | std::uint64_t updateResources(); 67 | 68 | /** Was list of known resources updated since given timestamp (in usec). 69 | */ 70 | bool updatedSince(std::uint64_t timestamp) const; 71 | 72 | /** Was given resource updated. Resource is updated only when new or differs 73 | * from different version. 74 | */ 75 | bool updatedSince(const Resource::Id &resourceId, std::uint64_t timestamp 76 | , bool nothrow = false) 77 | const; 78 | 79 | private: 80 | std::shared_ptr ctrl_; 81 | }; 82 | 83 | 84 | #endif // mapproxy_mapproxy_hpp_included_ 85 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/factory.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_definition_factory_hpp_included_ 28 | #define mapproxy_definition_factory_hpp_included_ 29 | 30 | #include 31 | 32 | #include "utility/premain.hpp" 33 | #include "utility/gccversion.hpp" 34 | 35 | #include "../resource.hpp" 36 | 37 | namespace resource { 38 | 39 | /** Create definition based on the generator type. 40 | */ 41 | DefinitionBase::pointer definition(const Resource::Generator &type); 42 | 43 | /** Register definition based on generator type. 44 | */ 45 | void registerDefinition(const Resource::Generator &type 46 | , const std::function 47 | &factory); 48 | 49 | template void registerDefinition(); 50 | 51 | // inlines 52 | 53 | template void registerDefinition() { 54 | registerDefinition({ Definition::type, Definition::driverName } 55 | , []() -> DefinitionBase::pointer { 56 | return std::make_shared(); 57 | }); 58 | } 59 | 60 | #define MAPPROXY_DEFINITION_REGISTER_ALN(x, y) \ 61 | MAPPROXY_DEFINITION_REGISTER_ALN1(x, y) 62 | #define MAPPROXY_DEFINITION_REGISTER_ALN1(x, y) x##y 63 | 64 | #define MAPPROXY_DEFINITION_REGISTER(DEFINITION) \ 65 | namespace { \ 66 | utility::PreMain MAPPROXY_DEFINITION_REGISTER_ALN \ 67 | (mapproxy_regdef_, DEFINITION) \ 68 | ([]() { registerDefinition(); }); \ 69 | } // namespace 70 | 71 | } // namespace resource 72 | 73 | #endif // mapproxy_definition_factory_hpp_included_ 74 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/tms-windyty.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "utility/premain.hpp" 31 | 32 | #include "jsoncpp/json.hpp" 33 | #include "jsoncpp/as.hpp" 34 | 35 | #include "tms.hpp" 36 | #include "factory.hpp" 37 | 38 | namespace resource { 39 | 40 | constexpr char TmsWindyty::driverName[]; 41 | 42 | MAPPROXY_DEFINITION_REGISTER(TmsWindyty) 43 | 44 | namespace { 45 | 46 | void parseDefinition(TmsWindyty &def, const Json::Value &value) 47 | { 48 | Json::getOpt(def.forecastOffset, value, "forecastOffset"); 49 | 50 | def.parse(value); 51 | } 52 | 53 | void buildDefinition(Json::Value &value, const TmsWindyty &def) 54 | { 55 | if (def.forecastOffset) { 56 | value["forecastOffset"] = def.forecastOffset; 57 | } 58 | 59 | def.build(value); 60 | } 61 | 62 | } // namespace 63 | 64 | void TmsWindyty::from_impl(const Json::Value &value) 65 | { 66 | // deserialize parent class first 67 | TmsRaster::from_impl(value); 68 | 69 | parseDefinition(*this, value); 70 | } 71 | 72 | void TmsWindyty::to_impl(Json::Value &value) const 73 | { 74 | // serialize parent class first 75 | TmsRaster::to_impl(value); 76 | 77 | buildDefinition(value, *this); 78 | } 79 | 80 | Changed TmsWindyty::changed_impl(const DefinitionBase &o) const 81 | { 82 | // first check parent class for change 83 | const auto changed(TmsRaster::changed_impl(o)); 84 | if (changed != Changed::no) { return changed; } 85 | 86 | const auto &other(o.as()); 87 | 88 | // forecast offset can change 89 | if (forecastOffset != other.forecastOffset) { return Changed::safely; } 90 | 91 | return TmsCommon::changed_impl(o); 92 | } 93 | 94 | } // namespace resource 95 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_error_hpp_included_ 28 | #define mapproxy_error_hpp_included_ 29 | 30 | #include 31 | #include 32 | 33 | #include "http/error.hpp" 34 | 35 | struct Error : std::runtime_error { 36 | Error(const std::string &message) : std::runtime_error(message) {} 37 | }; 38 | 39 | struct UnknownResourceBackend : Error { 40 | UnknownResourceBackend(const std::string &message) : Error(message) {} 41 | }; 42 | 43 | struct UnknownGenerator : Error { 44 | UnknownGenerator(const std::string &message) : Error(message) {} 45 | }; 46 | 47 | struct InvalidConfiguration : Error { 48 | InvalidConfiguration(const std::string &message) : Error(message) {} 49 | }; 50 | 51 | struct IOError : Error { 52 | IOError(const std::string &message) : Error(message) {} 53 | }; 54 | 55 | struct FormatError : Error { 56 | FormatError(const std::string &message) : Error(message) {} 57 | }; 58 | 59 | /** Abandon all operations. 60 | */ 61 | struct AbandonAll : Error { 62 | AbandonAll(const std::string &message) : Error(message) {} 63 | }; 64 | 65 | struct EmptyImage : Error { 66 | EmptyImage(const std::string &message) : Error(message) {} 67 | }; 68 | 69 | struct FullImage : Error { 70 | FullImage(const std::string &message) : Error(message) {} 71 | }; 72 | 73 | struct EmptyDebugMask : Error { 74 | EmptyDebugMask(const std::string &message) : Error(message) {} 75 | }; 76 | 77 | struct EmptyGeoData : Error { 78 | EmptyGeoData(const std::string &message) : Error(message) {} 79 | }; 80 | 81 | typedef http::NotFound NotFound; 82 | typedef http::ServiceUnavailable Unavailable; 83 | typedef http::InternalServerError InternalError; 84 | typedef http::RequestAborted RequestAborted; 85 | typedef http::BadRequest BadRequest; 86 | 87 | #endif // mapproxy_error_hpp_included_ 88 | -------------------------------------------------------------------------------- /mapproxy/src/rf-mask/ogrsupport.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "dbglog/dbglog.hpp" 28 | 29 | #include "./ogrsupport.hpp" 30 | 31 | namespace geo { 32 | 33 | VectorDataset openVectorDataset(const boost::filesystem::path &path) 34 | { 35 | auto ds(::GDALOpenEx(path.c_str(), (GDAL_OF_VECTOR | GDAL_OF_READONLY) 36 | , nullptr, nullptr, nullptr)); 37 | 38 | if (!ds) { 39 | LOGTHROW(err2, std::runtime_error) 40 | << "Failed to open dataset " << path << "."; 41 | } 42 | 43 | return VectorDataset(static_cast< ::OGRDataSource*>(ds) 44 | , [](::OGRDataSource *ds) { delete ds; }); 45 | } 46 | 47 | VectorDataset createVectorDataset(const boost::filesystem::path &path 48 | , ::GDALDriver *driver) 49 | { 50 | auto ds(driver->pfnCreateVectorOnly(driver, path.c_str(), nullptr)); 51 | if (!ds) { 52 | LOGTHROW(err2, std::runtime_error) 53 | << "Failed to create output dataset " << path << "."; 54 | } 55 | return VectorDataset(ds); 56 | } 57 | 58 | VectorDataset createVectorDataset(const boost::filesystem::path &path 59 | , VectorDataset &driverSource) 60 | { 61 | return createVectorDataset(path, driverSource->GetDriver()); 62 | } 63 | 64 | Feature feature(::OGRFeatureH f) 65 | { 66 | return Feature(static_cast< ::OGRFeature*>(f) 67 | , [](::OGRFeature *f) { 68 | if (f) OGR_F_Destroy(f); }); 69 | } 70 | 71 | Geometry geometry(::OGRGeometryH g, bool clone) 72 | { 73 | if (!g) { return {}; } 74 | if (clone) { g = OGR_G_Clone(g); } 75 | return Geometry(static_cast< ::OGRGeometry*>(g) 76 | , [](::OGRGeometry *g) 77 | { if (g) OGR_G_DestroyGeometry(g); }); 78 | } 79 | 80 | } // namespace geo 81 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/surface-spheroid.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "utility/premain.hpp" 31 | 32 | #include "jsoncpp/json.hpp" 33 | #include "jsoncpp/as.hpp" 34 | 35 | #include "surface.hpp" 36 | #include "factory.hpp" 37 | 38 | namespace resource { 39 | 40 | constexpr char SurfaceSpheroid::driverName[]; 41 | 42 | MAPPROXY_DEFINITION_REGISTER(SurfaceSpheroid) 43 | 44 | namespace { 45 | 46 | void parseDefinition(SurfaceSpheroid &def, const Json::Value &value) 47 | { 48 | if (value.isMember("textureLayerId")) { 49 | Json::get(def.textureLayerId, value, "textureLayerId"); 50 | } 51 | if (value.isMember("geoidGrid")) { 52 | std::string s; 53 | Json::get(s, value, "geoidGrid"); 54 | def.geoidGrid = s; 55 | } else { 56 | def.geoidGrid = boost::none; 57 | } 58 | 59 | def.parse(value); 60 | } 61 | 62 | void buildDefinition(Json::Value &value, const SurfaceSpheroid &def) 63 | { 64 | if (def.textureLayerId) { 65 | value["textureLayerId"] = def.textureLayerId; 66 | } 67 | if (def.geoidGrid) { 68 | value["geoidGrid"] = *def.geoidGrid; 69 | } 70 | 71 | def.build(value); 72 | } 73 | 74 | } // namespace 75 | 76 | void SurfaceSpheroid::from_impl(const Json::Value &value) 77 | { 78 | parseDefinition(*this, value); 79 | } 80 | 81 | void SurfaceSpheroid::to_impl(Json::Value &value) const 82 | { 83 | buildDefinition(value, *this); 84 | } 85 | 86 | Changed SurfaceSpheroid::changed_impl(const DefinitionBase &o) 87 | const 88 | { 89 | const auto &other(o.as()); 90 | 91 | if (textureLayerId != other.textureLayerId) { return Changed::yes; } 92 | if (geoidGrid != other.geoidGrid) { return Changed::yes; } 93 | 94 | return Surface::changed_impl(o); 95 | } 96 | 97 | } // namespace resource 98 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/surface-meta.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "utility/premain.hpp" 28 | 29 | #include "jsoncpp/json.hpp" 30 | #include "jsoncpp/as.hpp" 31 | 32 | #include "surface-meta.hpp" 33 | #include "factory.hpp" 34 | 35 | namespace resource { 36 | 37 | constexpr char SurfaceMeta::driverName[]; 38 | 39 | MAPPROXY_DEFINITION_REGISTER(SurfaceMeta) 40 | 41 | namespace { 42 | 43 | void parseDefinition(SurfaceMeta &def, const Json::Value &value) 44 | { 45 | const auto &rid([](const Json::Value &item) -> Resource::Id 46 | { 47 | Resource::Id id; 48 | Json::get(id.group, item, "group"); 49 | Json::get(id.id, item, "id"); 50 | return id; 51 | }); 52 | 53 | def.surface = rid(Json::check(value["surface"], Json::objectValue)); 54 | def.tms = rid(Json::check(value["tms"], Json::objectValue)); 55 | } 56 | 57 | void buildDefinition(Json::Value &value, const SurfaceMeta &def) 58 | { 59 | const auto &rid([](const Resource::Id &id) -> Json::Value 60 | { 61 | Json::Value value; 62 | value["group"] = id.group; 63 | value["id"] = id.id; 64 | return value; 65 | }); 66 | 67 | value["surface"] = rid(def.surface); 68 | value["tms"] = rid(def.tms); 69 | } 70 | 71 | } // namespace 72 | 73 | void SurfaceMeta::from_impl(const Json::Value &value) 74 | { 75 | parseDefinition(*this, value); 76 | } 77 | 78 | void SurfaceMeta::to_impl(Json::Value &value) const 79 | { 80 | buildDefinition(value, *this); 81 | } 82 | 83 | Changed SurfaceMeta::changed_impl(const DefinitionBase &o) const 84 | { 85 | const auto &other(o.as()); 86 | 87 | if (surface != other.surface) { return Changed::yes; } 88 | if (tms != other.tms) { return Changed::yes; } 89 | 90 | return Changed::no; 91 | } 92 | 93 | Resource::Id::list SurfaceMeta::needsResources_impl() const { 94 | return { surface, tms }; 95 | } 96 | 97 | } // namespace resource 98 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/support/mmapped/memory-impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_support_mmapped_memory_impl_hpp_included_ 28 | #define mapproxy_support_mmapped_memory_impl_hpp_included_ 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | #include "utility/binaryio.hpp" 38 | 39 | #include "memory.hpp" 40 | 41 | namespace mmapped { 42 | 43 | struct Memory { 44 | Memory(const boost::filesystem::path &path) 45 | : size(utility::fileSize(path)) 46 | , file(path.c_str(), boost::interprocess::read_only) 47 | , region(file, boost::interprocess::read_only, 0, size) 48 | , data(static_cast(region.get_address())) 49 | , buffer(data, data + size) 50 | , stream(&buffer) 51 | {} 52 | 53 | const char* addr(std::size_t pos) const { return data + pos; } 54 | 55 | std::size_t size; 56 | boost::interprocess::file_mapping file; 57 | boost::interprocess::mapped_region region; 58 | const char *data; 59 | 60 | boost::iostreams::stream_buffer buffer; 61 | std::istream stream; 62 | }; 63 | 64 | template 65 | void checkHeader(std::istream &f 66 | , const char (&expectMagic)[magicSize] 67 | , std::size_t extraBytes 68 | , const char *what) 69 | { 70 | char magic[magicSize]; 71 | utility::binaryio::read(f, magic); 72 | if (std::memcmp(magic, expectMagic, magicSize)) { 73 | LOGTHROW(err2, std::runtime_error) 74 | << "Mapped region is not a " << what << "."; 75 | } 76 | 77 | // skip extra header bytes 78 | f.seekg(extraBytes, std::ios_base::cur); 79 | } 80 | 81 | } // namespace mmapped 82 | 83 | #endif // mapproxy_support_mmapped_memory_impl_hpp_included_ 84 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/generator/geodata-mesh.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2019 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef mapproxy_generator_geodata_mesh_hpp_included_ 28 | #define mapproxy_generator_geodata_mesh_hpp_included_ 29 | 30 | #include "../heightfunction.hpp" 31 | #include "../generator.hpp" 32 | #include "../definition.hpp" 33 | 34 | namespace generator { 35 | 36 | class GeodataMesh : public Generator { 37 | public: 38 | GeodataMesh(const Params ¶ms); 39 | 40 | typedef resource::GeodataMesh Definition; 41 | 42 | /** Metadata of processed output. 43 | */ 44 | struct Metadata { 45 | /** Full 3D extents of generated output in physical SRS. 46 | */ 47 | math::Extents3 extents; 48 | 49 | /** Size of data written to the output. 50 | */ 51 | std::size_t fileSize; 52 | 53 | /** Introspection position. Overrides any position in introspection 54 | * surface. 55 | */ 56 | vr::Position position; 57 | }; 58 | 59 | private: 60 | virtual void prepare_impl(Arsenal &arsenal); 61 | 62 | virtual Task generateFile_impl(const FileInfo &fileInfo 63 | , Sink &sink) const; 64 | 65 | virtual vts::MapConfig mapConfig_impl(ResourceRoot root) const; 66 | vr::FreeLayer freeLayer(ResourceRoot root) const; 67 | 68 | void generateGeodata(Sink &sink, const GeodataFileInfo &fileInfo 69 | , Arsenal &arsenal) const; 70 | 71 | Definition definition_; 72 | 73 | /** URL to style. 74 | */ 75 | std::string styleUrl_; 76 | 77 | /** Path to style file if definition.styleUrl starts with `file:`. 78 | */ 79 | boost::filesystem::path stylePath_; 80 | 81 | /** Path to cached output data. 82 | */ 83 | boost::filesystem::path dataPath_; 84 | 85 | /** Metadata of processed output. 86 | */ 87 | Metadata metadata_; 88 | }; 89 | 90 | } // namespace generator 91 | 92 | #endif // mapproxy_generator_geodata_mesh_hpp_included_ 93 | -------------------------------------------------------------------------------- /mapproxy/src/mapproxy/definition/tms-raster-synthetic.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2018 Melown Technologies SE 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "utility/premain.hpp" 31 | 32 | #include "jsoncpp/json.hpp" 33 | #include "jsoncpp/as.hpp" 34 | 35 | #include "tms.hpp" 36 | 37 | namespace resource { 38 | 39 | namespace { 40 | 41 | void parseDefinition(TmsRasterSynthetic &def, const Json::Value &value) 42 | { 43 | std::string s; 44 | 45 | if (value.isMember("mask")) { 46 | def.mask = boost::in_place(); 47 | Json::get(*def.mask, value, "mask"); 48 | } 49 | 50 | if (value.isMember("format")) { 51 | Json::get(s, value, "format"); 52 | try { 53 | def.format = boost::lexical_cast(s); 54 | } catch (const boost::bad_lexical_cast&) { 55 | utility::raise 56 | ("Value stored in format is not RasterFormat value"); 57 | } 58 | } 59 | } 60 | 61 | void buildDefinition(Json::Value &value, const TmsRasterSynthetic &def) 62 | { 63 | if (def.mask) { 64 | value["mask"] = *def.mask; 65 | } 66 | value["format"] = boost::lexical_cast(def.format); 67 | } 68 | 69 | } // namespace 70 | 71 | void TmsRasterSynthetic::parse(const Json::Value &value) 72 | { 73 | TmsCommon::parse(value); 74 | parseDefinition(*this, value); 75 | } 76 | 77 | void TmsRasterSynthetic::build(Json::Value &value) const 78 | { 79 | TmsCommon::build(value); 80 | buildDefinition(value, *this); 81 | } 82 | 83 | Changed TmsRasterSynthetic::changed_impl(const DefinitionBase &o) const 84 | { 85 | const auto &other(o.as()); 86 | 87 | // non-safe changes first 88 | if (mask != other.mask) { return Changed::yes; } 89 | 90 | // format can change 91 | if (format != other.format) { return Changed::safely; } 92 | 93 | return TmsCommon::changed_impl(other); 94 | } 95 | 96 | } // namespace resource 97 | --------------------------------------------------------------------------------