From manisandro at gmail.com Mon Jan 5 01:09:47 2026 From: manisandro at gmail.com (Sandro Mani) Date: Mon, 5 Jan 2026 10:09:47 +0100 Subject: [qgis-qwc2] How to use custom CRS in QWC2 In-Reply-To: References: Message-ID: <30aa3b80-277d-45db-8a85-48acb7cd3e80@gmail.com> Hello The projections defined in the viewer config.json do not affect the server, they are used only by the viewer. If you want to add custom projections to the server, then changing the profile `qgis.db` should be the way to go. If you set QGIS_SERVER_LOG_LEVEL: 0, you should see in the log output which db is being read, likely it is /etc/qgis.db. Hope this helps Sandro On 30.12.25 21:34, Benjamin Cahill via qgis-qwc2 wrote: > Hello, > > I am struggling to get a custom CRS working with QWC2. I added it in > config.json -> projections and it shows up in the web viewer as > expected, but every request to QGIS Server results in a 400 bad > request error and this error in the logs: > > The CRS is not valid. > > It doesn't seem that the QGIS Server docker container is aware of the > custom CRS. I reviewed the docker volume mounts and none of them would > inform QGIS Server of the custom CRS (unlike qwc-map-viewer which > mounts /config which includes /default/mapViewerConfig.json where the > projections are put once the config is generated). > > I noticed that the qwc-qgis-server container has qgis.db and srs.db > files in /usr/share/qgis/resources. I tried copying the qgis.db from > my desktop computer and mounting it as a volume to replace the > /usr/share/qgis/resources/qgis.db file, but that didn't help either. > > What is the right way to add a custom CRS to the qwc-qgis-server container? > > I could try editing the srs.db file directly or making a copy and > mounting it, but I don't know if that is the best solution. > > Thank you for any help! > > - Benjamin > _______________________________________________ > qgis-qwc2 mailing list > qgis-qwc2 at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/qgis-qwc2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bcahill at alertacademy.com Mon Jan 5 05:03:24 2026 From: bcahill at alertacademy.com (Benjamin Cahill) Date: Mon, 5 Jan 2026 07:03:24 -0600 Subject: [qgis-qwc2] How to use custom CRS in QWC2 In-Reply-To: <30aa3b80-277d-45db-8a85-48acb7cd3e80@gmail.com> References: <30aa3b80-277d-45db-8a85-48acb7cd3e80@gmail.com> Message-ID: Sandro, I changed the docker-compose configuration to mount the qgis.db file at /etc/qgis.db and now it works as expected. Thank you very much for your help! I hope you have a great new year. - Benjamin On Mon, Jan 5, 2026 at 3:09?AM Sandro Mani wrote: > > Hello > > The projections defined in the viewer config.json do not affect the server, they are used only by the viewer. > > If you want to add custom projections to the server, then changing the profile `qgis.db` should be the way to go. If you set QGIS_SERVER_LOG_LEVEL: 0, you should see in the log output which db is being read, likely it is /etc/qgis.db. > > Hope this helps > Sandro > > On 30.12.25 21:34, Benjamin Cahill via qgis-qwc2 wrote: > > Hello, > > I am struggling to get a custom CRS working with QWC2. I added it in > config.json -> projections and it shows up in the web viewer as > expected, but every request to QGIS Server results in a 400 bad > request error and this error in the logs: > > The CRS is not valid. > > It doesn't seem that the QGIS Server docker container is aware of the > custom CRS. I reviewed the docker volume mounts and none of them would > inform QGIS Server of the custom CRS (unlike qwc-map-viewer which > mounts /config which includes /default/mapViewerConfig.json where the > projections are put once the config is generated). > > I noticed that the qwc-qgis-server container has qgis.db and srs.db > files in /usr/share/qgis/resources. I tried copying the qgis.db from > my desktop computer and mounting it as a volume to replace the > /usr/share/qgis/resources/qgis.db file, but that didn't help either. > > What is the right way to add a custom CRS to the qwc-qgis-server container? > > I could try editing the srs.db file directly or making a copy and > mounting it, but I don't know if that is the best solution. > > Thank you for any help! > > - Benjamin > _______________________________________________ > qgis-qwc2 mailing list > qgis-qwc2 at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/qgis-qwc2