docker-qgis-server icon indicating copy to clipboard operation
docker-qgis-server copied to clipboard

QGIS server is not working with layers coming from the database

Open NyakudyaA opened this issue 7 years ago • 6 comments

Problem

I have my compose file setup

postgres:
  image: kartoza/postgis:9.5-2.2
  ports:
    - "35432:5432"
  environment:
    - USERNAME=docker
    - PASS=docker
qgisserver:
  image: kartoza/qgis-server:2.18.10
  hostname: qgis-server
  volumes:
    - ./web:/web
  environment:
    - QGIS_PROJECT_FILE=/web/project/project.qgs
    - PGSERVICEFILE=/web/project/pg_service.conf
  links:
    - postgres:postgres
  ports:
    - "30003:80"

When I log into the qgis-server container I can connect to the Postgres container by using the service file. psql service=gis but when I do a get capabilities on my layer the request generated is not valid. get

I then proceed to open the project file and replace my data source with a shapefile and do a get capabilities which returns true.

I think QGIS server is not connecting properly to the Postgres container.

NyakudyaA avatar Aug 11 '17 13:08 NyakudyaA

Can you test again with the latest QGIS 2.18 and 3 server builds?

timlinux avatar May 30 '18 08:05 timlinux

Ok @timlinux will do so. Is there any image for qgis server 3 yet

NyakudyaA avatar May 30 '18 09:05 NyakudyaA

Get capabilities working but the wms returns an empty image. Still needs to test further

NyakudyaA avatar Jun 29 '18 07:06 NyakudyaA

Was this ever addressed? I'm having the same issue (server properly serves a layer if it's stored in a .gpkg file, but not if the same data is read from a database (MySQL in my case)). Both versions (.gpkg and database) work in QGIS client. I'm just working with the "places" layer (country capital cities) from the QGIS server example suite.

Server version: 3.26.3 (running on Ubuntu Focal) Client version: 3.26.2 (running on Windows)

LoonSongSoftware avatar Oct 15 '22 12:10 LoonSongSoftware

This repo is no longer maintained, Please use other alternative images i.e https://hub.docker.com/r/3liz/qgis-map-server, https://github.com/gem/oq-qgis-server

NyakudyaA avatar Oct 17 '22 06:10 NyakudyaA

Thank you. I'll re-post in the main QGIS forum, since I'm not actually using a docker image.

LoonSongSoftware avatar Oct 17 '22 11:10 LoonSongSoftware