Skip to content

Commit

Permalink
OGC-OSGeo-ASF Code Sprint: MapServer 8.0/OGC API - Features output su…
Browse files Browse the repository at this point in the history
…pport
  • Loading branch information
gfenoy committed Mar 13, 2022
1 parent bda13ba commit b7952aa
Show file tree
Hide file tree
Showing 8 changed files with 1,760 additions and 2,801 deletions.
54 changes: 48 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ ARG BUILD_DEPS=" \
ARG RUN_DEPS=" \
libcurl3-gnutls \
libfcgi \
libmapserver-dev \
# For latest MapServer
libfribidi0 \
libprotobuf-c1 \
#libfribidi-dev \
#libprotobuf-c-dev \
# For packaged MapServer
#libmapserver-dev \
curl \
\
saga \
Expand Down Expand Up @@ -64,6 +70,13 @@ ARG BUILD_DEPS=" \
autoconf \
gcc \
gettext \
# Latest MapServer dependencies
swig \
protobuf-c-compiler \
libprotobuf-c-dev \
libfreetype6-dev \
libcairo2-dev \
libfribidi-dev \
\
# Comment lines bellow if nor OTB nor SAGA \
libotb-dev \
Expand Down Expand Up @@ -97,13 +110,38 @@ ARG BUILD_DEPS=" \
"
WORKDIR /zoo-project
COPY . .
#COPY thirds/MapServer-GS thirds/

RUN set -ex \
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
\
&& make -C ./thirds/cgic206 libcgic.a \
\
&& cd thirds \
&& git clone https://github.com/MapServer/MapServer.git \
&& cd MapServer \
#&& git clone --branch=add-save-config https://github.com/GeoLabs/MapServer.git MapServer-GS \
&& mkdir build \
&& cd build \
&& cmake .. \
-DWITH_PYTHON=0 \
-DWITH_CLIENT_WMS=1 \
-DWITH_CLIENT_WFS=1 \
-DCMAKE_PREFIX_PATH=/usr/ \
-DWITH_KML=1 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_OGCAPI=1 \
-DPROTOBUF_INCLUDE_DIR=/usr/include/google//protobuf-c \
-DPROTOBUFC_LIBRARY=/usr/lib/x86_64-linux-gnu/libprotobuf-c.so \
-DPROTOBUF_COMPILER=/usr/bin/protoc-c \
-DPython_INCLUDE_DIRS=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPython_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \
-DCMAKE_INSTALL_PREFIX=/mapserver \
&& make -j 4 \
&& make install PREFIX=/mapserver \
&& cd ../../.. \
&& cd ./zoo-project/zoo-kernel \
# Uncomment bellow to fetch latest json-c from GitHub \
#&& git clone https://github.com/json-c/json-c.git \
#&& mkdir json-c-build \
#&& cd json-c-build \
Expand All @@ -113,7 +151,8 @@ RUN set -ex \
#&& sed "s:-ljson-c:-Wl,-rpath,/usr/local/lib /usr/local/lib/libjson-c.so.5 :g" -i configure.ac \
&& autoconf \
&& find /usr -name otbWrapperApplication.h \
&& ./configure --with-rabbitmq=yes --with-python=/usr --with-pyvers=3.6 --with-js=/usr --with-mapserver=/usr --with-ms-version=7 --with-json=/usr --with-r=/usr --with-db-backend --prefix=/usr --with-otb=/usr/ --with-itk=/usr --with-otb-version=6.6 --with-itk-version=4.12 --with-saga=/usr --with-saga-version=7.2 --with-wx-config=/usr/bin/wx-config \
&& ./configure --help \
&& ./configure --with-rabbitmq=yes --with-python=/usr --with-pyvers=3.6 --with-js=/usr --with-mapserver=/mapserver --with-ms-version=7 --with-ms-force-linkage=yes --with-ms-obj=../../thirds/MapServer/build/CMakeFiles/mapserver.dir/mapfile.c.o --with-json=/usr --with-r=/usr --with-db-backend --prefix=/usr --with-otb=/usr/ --with-itk=/usr --with-otb-version=6.6 --with-itk-version=4.12 --with-saga=/usr --with-saga-version=7.2 --with-wx-config=/usr/bin/wx-config \
&& make -j4 \
&& make install \
\
Expand Down Expand Up @@ -272,8 +311,9 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG RUN_DEPS=" \
apache2 \
curl \
cgi-mapserver \
mapserver-bin \
# Not needed if MapServer is built from source \
#cgi-mapserver \
#mapserver-bin \
xsltproc \
libxml2-utils \
gnuplot \
Expand Down Expand Up @@ -306,6 +346,7 @@ ARG WS_SERVER_URL="ws://localhost"

WORKDIR /zoo-project
COPY ./docker/startUp.sh /
COPY ./docker/mapserver.conf /mapserver/etc/mapserver.conf

# From zoo-kernel
COPY --from=builder1 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
Expand All @@ -323,7 +364,7 @@ COPY --from=builder1 /zoo-project/zoo-project/zoo-services/echo-py/cgi-env/ /usr
COPY --from=builder1 /zoo-project/docker/.htaccess /var/www/html/.htaccess
COPY --from=builder1 /zoo-project/docker/default.conf /000-default.conf
COPY --from=builder1 /zoo-project/zoo-project/zoo-services/utils/open-api/server/publish.py /usr/lib/cgi-bin/publish.py

COPY --from=builder1 /mapserver /mapserver
# From optional zoo modules
COPY --from=builder2 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
COPY --from=builder1 /zoo-project/docker/oas.cfg /usr/lib/cgi-bin/
Expand Down Expand Up @@ -371,7 +412,8 @@ RUN set -ex \
# && sed "s:Listen 80:Listen $PORT:g" -i /etc/apache2/ports.conf \
\
&& mkdir -p /tmp/zTmp/statusInfos \
&& chown www-data:www-data -R /tmp/zTmp /usr/com/zoo-project \
&& ln -s /mapserver/bin/mapserv /usr/lib/cgi-bin/mapserv \
&& chown www-data:www-data -R /tmp/zTmp /usr/com/zoo-project /mapserver/etc/ \
&& chmod 755 /startUp.sh \
\
# remove invalid zcfgs \
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ services:
- ./zoo-project/zoo-services/echo-py/cgi-env/echo.zcfg:/usr/lib/cgi-bin/echo.zcfg
- ./zoo-project/zoo-services/utils/open-api/server/publish.py:/usr/lib/cgi-bin/publish.py
- ./zoo-project/zoo-services/utils/open-api/server/subscriber.py:/usr/lib/cgi-bin/subscriber.py
- ./docker/mapserver.conf:/mapserver/etc/mapserver.conf
- ./docker/.htaccess:/var/www/html/.htaccess
- ./zoo-project/zoo-services/utils/open-api/templates/index.html:/var/www/index.html
- ./zoo-project/zoo-services/utils/open-api/static:/var/www/html/static
- ./docker/com:/usr/com/zoo-project
- ./docker/tmp:/tmp/zTmp
- ./thirds/MapServer/share/ogcapi/templates/html-bootstrap4:/mapserver/share/mapserver/ogcapi/templates/html-plain/
depends_on:
- pgbouncer
- redis
Expand All @@ -32,6 +34,7 @@ services:
- ./docker/main.cfg:/usr/lib/cgi-bin/main.cfg
- ./docker/oas.cfg:/usr/lib/cgi-bin/oas.cfg
- ./docker/tmp:/tmp/zTmp
- ./docker/mapserver.conf:/mapserver/etc/mapserver.conf
- ./docker/com:/usr/com/zoo-project
depends_on:
- rabbitmq
Expand Down
1 change: 1 addition & 0 deletions docker/main.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mapserverAddress = http://localhost/cgi-bin/mapserv
msOgcVersion=1.0.0
cors=true
memory=protect
msConfig=/mapserver/etc/mapserver.conf

[identification]
title = The ZOO-Project OGC WPS Developement Server
Expand Down
8 changes: 8 additions & 0 deletions docker/mapserver.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG
ENV
"MS_MAP_PATTERN" "^/usr/com/zoo-project/"
"OGCAPI_HTML_TEMPLATE_DIRECTORY" "/mapserver/share/mapserver/ogcapi/templates/html-plain/"
END # ENV
MAPS
END # MAPS
END # CONFIG
4 changes: 4 additions & 0 deletions zoo-project/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Version 2.0.0
* Add support for MapServer 8.0 (actually 7.7-dev) including
returning result as OGC API -Features
* Integrate downloading MapServer 8.0 and building from the
Dockerfile
* Use the RabbitMQ also for OGC API - Processes
* Pass the subscriber if any is passed from the original request
* Make C OGR base-vect-ops compatible with memory=protect
Expand Down
9 changes: 9 additions & 0 deletions zoo-project/zoo-kernel/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ AC_ARG_WITH([ms-version],
[AS_HELP_STRING([--with-ms-version=VERSION], [Specifies the MapServer version to build against])],
[MS_VERSION="$withval"], [MS_VERSION=""])

AC_ARG_WITH([ms-force-linkage],
[AS_HELP_STRING([--with-ms-force-linkage=yes], [Specifies if the MapServer version should be force linked])],
[MS_FORCE_LINKAGE="$withval"], [MS_FORCE_LINKAGE=""])

if test -z $MS_SRC_PATH;
then
MS_CPPFLAGS=""
Expand All @@ -536,7 +540,12 @@ else
else
if test "x$MS_VERSION" = "x7";
then

MS_LDFLAGS="-L$MS_SRC_PATH/lib -lmapserver"
if test "x$MS_FORCE_LINKAGE" = "xyes";
then
MS_LDFLAGS="$MS_LDFLAGS -Wl,-rpath,$MS_SRC_PATH/lib/"
fi
MS_CPPFLAGS="-DUSE_MS -I$MS_SRC_PATH/include/mapserver "
AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
else
Expand Down

0 comments on commit b7952aa

Please sign in to comment.