Coder Social home page Coder Social logo

qgis-docker's Introduction

QGIS Docker Images

This repository automates the build of QGIS desktop and QGIS server Docker images. The respective docs are located here:

Warning:

There are discussions on how to build these images and they are not considered stable. They are considered as NOT production ready.

qgis-docker's People

Contributors

3nids avatar antonioettorre avatar cedric-fauth avatar daniviga avatar dependabot[bot] avatar elpaso avatar jakobmiksch avatar m-kuhn avatar mbernasocchi avatar nastasi-oq avatar vot4anto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qgis-docker's Issues

Incorrect example for PGSERVICEFILE

In https://github.com/gem/oq-qgis-server/blob/ba9ac5c8faa166831c508a1ade3ece0af1d0214a/docker-compose.yml#L53 you propose to mount the service file into

/etc/postgresql-common/pg_service.conf

But it doesn't work for me, giving service not found when I try to access a layer.

I tested by shelling in to the container and verifying the path for the system service file as per: https://www.postgresql.org/docs/current/libpq-pgservice.html

Inside the container:

dnf install postgresql-devel

Then test for the expected path:

bash-5.0# pg_config --sysconfdir
/etc

The example at https://github.com/gem/oq-qgis-server/blob/master/README.md#postgresql-connection-service-file-optional should also be revised to use /etc rather as per the working snippet from my docker-compose:

     # As per the oq QGIS Server docs at https://github.com/gem/oq-qgis-server/blob/master/README.md#postgresql-connection-service-file-optional but wrong! 
     #- ./pg_conf/pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
     #This works instead
     - ./pg_conf/pg_service.conf:/etc/pg_service.conf:ro

Support pgservice.conf

Hi !

Using pgservice.conf is good practice, as it avoids having to hardcode the postgres connection info in the project file, making the project file much more portable (you can use the same locally and in the server, and distribute it without leaking postgres passwords).

Unfortunately, it seems it's not supported with this image.

Mounting the file under /var/lib/qgis/.pgservice.conf (or somewhere else by specifying the PGSERVICEFILE env var) as per postgres's docs does not work with following error :

12:45:56 WARNING PostGIS[26]: Connection to database failed`
definition of service "myservice" not found.

To make it work, one has to add a line like fastcgi_param PGSERVICEFILE /io/.pg_service.conf; next to https://github.com/gem/oq-qgis-server/blob/master/conf/qgis-server-nginx.conf#L98, which is annoying as it requires overwriting the whole config file.

Thanks for this otherwise great image !

Library missing

Hello,

I've tried to use your 3.4.5 and 3.6 versions of the Docker, and on both I've found the following error:

/usr/libexec/qgis/qgis_mapserv.fcgi: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

Production Readyness

The README states:

There are discussions on how to build these images and they are not considered stable. They are considered as NOT production ready.

What has to happen that this image can be considered as ready for production?

It would be great to have specific tasks (issues) to reach that goal. Possible options that I can think of are: tests, better docs and examples, official maintainers ...

Oracle data

Maybe I'm only lacking basic information on docker. Is there a way to connect to an Oracle DBMS from inside QGIS Server installed in a docker container? Is there a way to connect oq-qgis-server to an Oracle Instant Client docker?

Move to F30

It should be mature enough and F29 is EoL late 2019

is QGIS_USER useless?

Hi, I tried to start the container:

docker run [...] -e QGIS_USER=gis openquake/qgis-server:ltr

but in the log I found this error:

spawn-fcgi: can't find user name gis

what is wrong?

All linux/arm64 docker containers are stuck on 3.22.16-Białowieża

What is the bug or the crash?

All linux/arm64 docker containers are stuck on 3.22.16-Białowieża

Steps to reproduce the issue

  1. docker run -i -t qgis/qgis:3.34.6-lunar /bin/bash
  2. open python3
  3. run from qgis.core import Qgis and Qgis.version()
  4. Version is 3.22.16-Białowieża instead of 3.34.6

Versions

qgis/qgis:3.34.6-lunar, linux/arm64, digest: sha256:59f6bd009ebed65ab576edd0d2b09cbc845c70c9cc8d6880e4ab308415cba5f4

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

Free project structure

The current folder structure is restraining. Anyway can be expanded to be more flexible?

data
|
|-- <folder_name>
|-- <user_name>
|-- <project_name>
|-- <project_name>.qgs

Then would use something like this:
&MAP=/data/folder_name/user_name/project_name
&MAP=/data/folder_name/user_name/project_name/project_name.qgs

Run as non root user

It would be nice if the container ran as e.g. apache or other non-priveledged user....

Strange long URL suffix starting with `?map=...` while browsing the WFS3 web pages of the project

Hello,

I had to rewrite the line 88 of nginx-fcgi-sample.conf

from this:

rewrite ^/ogc/(.*)$ /qgis/qgis_mapserv.fcgi?map=/io/data/$1/$1.qgs;

to this:

rewrite ^/ogc/(.*)$ /qgis/qgis_mapserv.fcgi;

In order to be able to see correctly formatted hyperlinks when browser QGIS server web pages.

E.g. at:
http://127.0.0.1:8010/ogc/myproject-folder/wfs3/collections/{collectionId}/items/
clicking a feature will open it at this URL (which is the expected behaviour):
http://127.0.0.1:8010/ogc/myproject-folder/wfs3/collections/{collectionId}/items/{itemId}.html

Because with the current version of the nginx config file, it opens as follows:
http://127.0.0.1:8010/ogc/myproject-folder/wfs3/collections/{collectionId}/items/{itemId}?map=/io/data/myproject-folder/wfs3/collections/{collectionId}/items//myproject-folder/wfs3/collections/{collectionId}/items/.qgs

image

The feature is correctly displayed in the browser, that's not the problem, but the URL is quite messy as you can see, and each and every hyperlink on the QGIS server pages, is suffering a similar very long ?map=... suffix.

I'm wondering if I missed something in the configuration?

Please note that my QGIS project file is located, within the container, in this folder:

root@qgisserver:~# ls -lh /io/data/myproject-folder/
total 21M
-rw-rw-r-- 1 1000 1000 21M Feb  5 08:32 myproject-file.qgs

and that I had to add this env var to the Compose file:

QGIS_PROJECT_FILE: "/io/data/myproject-folder/myproject-file.qgs"

Without the QGIS_PROJECT_FILE var, I'm facing an empty Collections page with this error:

qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/collections/myproject-folder/wfs3/collections.qgs': Unable to open /io/data/myproject-folder/wfs3/collections/myproject-folder/wfs3/collections.qgs 
qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/static/style.css/myproject-folder/wfs3/static/style.css.qgs': Unable to open /io/data/myproject-folder/wfs3/static/style.css/myproject-folder/wfs3/static/style.css.qgs 
qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css.qgs': Unable to open /io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.css.qgs 
qgisserver_1  | 11:27:06 CRITICAL Server[14]: Error when loading project file '/io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js.qgs': Unable to open /io/data/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js/myproject-folder/wfs3/static/jsonFormatter/jsonFormatter.min.js.qgs 

Move project

Since project is unmaintained on the @gem/gem-developers side, wouldn't it make sense to move it under opengis.ch or qgis.org?

@mbernasocchi @pslh ?

Adapt "About" section of repo

The "About" section of the repo currently shows:

Our way of running QGIS 3 server inside Docker

It would be more understandable to name it something like

Official Docker image for QGIS Server and Desktop

image

Project file error.

After run server by docker run -v $(pwd)/data:/io/data --name qgis-server -d -p 8010:80 opengisch/qgis-server:ltr , then http://localhost:8010/ogc/test_project, and got this error message:

Project file error. For OWS services: please provide a SERVICE and a MAP parameter pointing to a valid QGIS project file

Can't get layers from pg

I have postgis on my windows machine and I tried different configurations for pg_service.conf but layers from pg doesnt load.

[gis]
dbname=gis
host=localhost / host.docker.internal / postgis (for docker container) 
port=5432
user=postgres
password=postgres

I have an assumption that this is because of the parameter host=localhost in .qgs file but I'm not sure.
I don't know what to do. Help me please.

Finalize CI

  • testing + auto build Fedora based images (or drop them)
  • drop Travis CI as testing is now done in GH workflow

QGIS server 3.4.4 not working

With the same configuration as 3.4.3, 3.4.4 returns an error:

Request:

http://localhost:8010/ogc/nepal-adm3-gem?request=GetCapabilities&version=1.1.1&service=WMS

<ServiceExceptionReport version="1.3.0">
  <ServiceException code="OperationNotSupported">Please check the value of the REQUEST parameter</ServiceException>
</ServiceExceptionReport>

It should be (tested with 3.4.3):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM 'http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd'>
<WMT_MS_Capabilities version="1.1.1">
 <Service>
  <Name>WMS</Name>
  <Title>Map viewer</Title>
  <KeywordList>
   <Keyword vocabulary="ISO">infoMapAccessService</Keyword>
  </KeywordList>
  <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000" xmlns:xlink="http://www.w3.org/1999/xlink"/>
  <Fees>None</Fees>
  <AccessConstraints>None</AccessConstraints>
 </Service>
 <Capability>
  <Request>
   <GetCapabilities>
    <Format>application/vnd.ogc.wms_xml</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000/ogc/nepal-adm3-gem?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
      </Get>
     </HTTP>
    </DCPType>
   </GetCapabilities>
   <GetMap>
    <Format>image/jpeg</Format>
    <Format>image/png</Format>
    <Format>image/png; mode=16bit</Format>
    <Format>image/png; mode=8bit</Format>
    <Format>image/png; mode=1bit</Format>
    <Format>application/dxf</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000/ogc/nepal-adm3-gem?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
      </Get>
     </HTTP>
    </DCPType>
   </GetMap>
   <GetFeatureInfo>
    <Format>text/plain</Format>
    <Format>text/html</Format>
    <Format>text/xml</Format>
    <Format>application/vnd.ogc.gml</Format>
    <Format>application/vnd.ogc.gml/3.1.1</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000/ogc/nepal-adm3-gem?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
      </Get>
     </HTTP>
    </DCPType>
   </GetFeatureInfo>
   <GetLegendGraphic>
    <Format>image/jpeg</Format>
    <Format>image/png</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000/ogc/nepal-adm3-gem?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
      </Get>
     </HTTP>
    </DCPType>
   </GetLegendGraphic>
   <DescribeLayer>
    <Format>text/xml</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000/ogc/nepal-adm3-gem?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
      </Get>
     </HTTP>
    </DCPType>
   </DescribeLayer>
   <GetStyles>
    <Format>text/xml</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000/ogc/nepal-adm3-gem?" xmlns:xlink="http://www.w3.org/1999/xlink"/>
      </Get>
     </HTTP>
    </DCPType>
   </GetStyles>
  </Request>
  <Exception>
   <Format>application/vnd.ogc.se_xml</Format>
  </Exception>
  <Layer>
   <KeywordList>
    <Keyword vocabulary="ISO">infoMapAccessService</Keyword>
   </KeywordList>
   <SRS>CRS:84</SRS>
   <SRS>EPSG:3857</SRS>
   <SRS>EPSG:4326</SRS>
   <LatLonBoundingBox minx="80.0601" maxx="88.2039" miny="26.3475" maxy="30.447"/>
   <BoundingBox minx="80.0601" maxx="88.2039" SRS="EPSG:4326" miny="26.3475" maxy="30.447"/>
   <BoundingBox minx="8.91225e+6" maxx="9.81881e+6" SRS="EPSG:3857" miny="3.04218e+6" maxy="3.56114e+6"/>
   <Layer queryable="1">
    <Name>Nepal exposure (GEM taxonomy)</Name>
    <Title>Nepal exposure (GEM taxonomy)</Title>
    <SRS>CRS:84</SRS>
    <SRS>EPSG:3857</SRS>
    <SRS>EPSG:4326</SRS>
    <LatLonBoundingBox minx="80.0601" maxx="88.2039" miny="26.3475" maxy="30.447"/>
    <BoundingBox minx="80.0601" maxx="88.2039" SRS="EPSG:4326" miny="26.3475" maxy="30.447"/>
    <BoundingBox minx="8.91225e+6" maxx="9.81882e+6" SRS="EPSG:3857" miny="3.04219e+6" maxy="3.56114e+6"/>
    <Style>
     <Name>default</Name>
     <Title>default</Title>
     <LegendURL>
      <Format>image/png</Format>
      <OnlineResource xlink:type="simple" xlink:href="http://localhost:8000/ogc/nepal-adm3-gem?&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetLegendGraphic&amp;LAYER=Nepal exposure (GEM taxonomy)&amp;FORMAT=image/png&amp;STYLE=default" xmlns:xlink="http://www.w3.org/1999/xlink"/>
     </LegendURL>
    </Style>
   </Layer>
  </Layer>
 </Capability>
</WMT_MS_Capabilities>

proj_create: Error 1029 (File not found or invalid): pipeline: Pipeline: Bad step definition: proj=hgridshift (File not found or invalid)

I'm trying to use opengisch Docker image for QGIS server (successfully serving some very simple PostGIS layers in EPSG:2056) but I'm facing this QGIS server error message when trying to create a new feature using WFS (from QGIS as a client):

...
my_app-qgis-1  | proj_create: Error 1029 (File not found or invalid): pipeline: Pipeline: Bad step definition: proj=hgridshift (File not found or invalid)
my_app-qgis-1  | 07:49:10 WARNING [13]: attr: name=Example_attribute idx=0 value=Test

At this stage I have to down and up the docker service again because it's totally frozen.

Is there anything I missed in the documentation?
How can I make it work with EPSG:2056? If possible of course.
It works well with WGS84 tables.

I'm using the opengisch/qgis-server:3.30.2-jammy image.

Here's the service definition in my Compose file:

qgis:
    image: opengisch/qgis-server:3.30.2-jammy
    environment:
      POSTGRES_USER:
      POSTGRES_PASSWORD:
      POSTGRES_HOST:
      POSTGRES_PORT:
      POSTGRES_DB:
      # Do not run the embedded copy of nginx
      SKIP_NGINX: "true"
      QGIS_SERVER_LOG_LEVEL: 0
      # Improve rendering performance
      QGIS_SERVER_PARALLEL_RENDERING: "true"
      QGIS_SERVER_MAX_THREADS: 4
      # Limit the maximum size returned by a GetMap
      QGIS_SERVER_WMS_MAX_HEIGHT: 5000
      QGIS_SERVER_WMS_MAX_WIDTH: 5000
    restart: "always"
    networks:
      - local_net
    depends_on:
      db:
        condition: service_healthy
    ports:
      - "9993:9993"
    volumes:
      - ./qgis/data:/io/data
      - ./qgis/pg_service.conf:/etc/postgresql-common/pg_service.conf:ro

I was hoping for an env var to make the project aware of other EPSG codes for example.

Thanks for your help and also for providing this nice Docker image.

Warm Regards.

Custom SVG symbols path

Hi, one thing is missing: custom SVG symbols path.

They are usually stored in the QGIS default profile; so I pass the --profiles-path parameter to qgis
I don't know how is this possible in actual FCGI version... any idea?

Remove $ sign in example code?

Github offers to copy the example code, but, since the code lines include $, they will fail. It would therefore be more user friendly to remove the $ sign

image

WFS3 API endpoint

Solution

I figured it out. Feel free to add this to the documentation, as others might be looking for the new endpoints.

Given the current projects directory structure, for a project inside schools/schools.qgs, it can be reached like this:

API:
http://lx-srv0419:8080/ogc/wfs3/api?MAP=/io/data/schools/schools.qgs

Collections:
http://lx-srv0419:8080/ogc/wfs3/collections?MAP=/io/data/schools/schools.qgs

Conformance:
http://lx-srv0419:8080/ogc/wfs3/conformance?MAP=/io/data/schools/schools.qgs

Original question

Thanks for this Docker container, it works great!

I have just one minor issue: I can't figure out how to reach QGIS Server's OGC WFS3 API endpoint. It's supposed to be under /api when running pure, via fcgi.

Accordning to your documentation, the /ows/endpoint bypasses the MAP rewrite and should be a way out. But I can't figure it out anyway.

This works (for WFS 1.0.0):

curl -X GET "localhost:8080/ows/?SERVICE=WFS&MAP=/io/data/schools/schools.qgs&REQUEST=GetCapabilities"

This doesn't (obviously, as there's no service named WFS3, we should access it via another endpoint):

curl -X GET "localhost:8080/ows/?SERVICE=WFS3&MAP=/io/data/schools/schools.qgs&REQUEST=GetCapabilities"

Any ideas?

How to get correct rewrite URLs when using NGINX reverse proxy inside the container?

Problem description

I can't figure out how the URLs inside the responses (e.g. WFS3 JSON response or the WMS GetCapabilities) get their hostname.

I have a scenario where the container runs with its built in NGINX. In addition, I have another application in front of the QGIS Server, which has its own proxy mechanism through with I expose the container. So to get a response from e.g. the WFS3 endpoint, I can reach it at:

https://hajkmap.example.com/api/v1/proxy/qgisserver/wfs3/wfs.json?MAP=/io/data/testproj/testproj.qgs

But the response contains references to container's internal endpoint:

Skärmavbild 2023-09-25 kl  13 32 24

Furthermore, I have no idea where the hostname ofhttps://qgis-server:443 comes from as my docker-compose.yaml looks like this:

services:
    qgis-server:
        image: 'opengisch/qgis-server:ltr-jammy' # We want the latest LTR based on Ubuntu 22.04
        hostname: hstd_qgisserver
        container_name: qgis-server-hstd

What I try to do

I would like my responses from the OGC services (whether it's the already mentioned WFS3 or e.g. WMS with its XML responses) to contain the URL to my proxy (https://hajkmap.example.com/api/v1/proxy/qgisserver) instead of the current value (https://qgis-server:443).

NB: I can't do this using the QGIS project file's "Announced URL" function because the address of the proxy will vary, depending on the node running the container (it could be at https://production-server.example.com/api/v1/proxy/qgisserver as well as https://internal-test-server.example.com/api/v1/proxy/qgisserver).

NB 2: I could of course build unique containers on each of the nodes and in the ADD step in Dockerfile copy the modified nginx.conf. But this would, in my opinion, overcomplicate things as the only difference between the images would be that single line in nginx.conf.

Ideally I need to specify a value inside the Docker Compose file (or using an environmental variable on the node running the container) and have that value passed all the way to container's /etc/nginx/nginx.conf.
image

I hope to hear some ideas from you. Thank you for your hard work! 🚀

CORS issue with embedded nginx

When qgis-server is started using the embedded nginx service, no object information is displayed as qgis-server does not send an Access-Control-Allow-Origin header.

This could be solved e.g. by adding add_header Access-Control-Allow-Origin *; to the /qgis/ location in qgis-server-nginx.conf.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.