[qgis-qwc2] How to use custom CRS in QWC2

Sandro Mani manisandro at gmail.com
Mon Jan 5 01:09:47 PST 2026


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:
>
>   <ServiceException code="InvalidCRS">The CRS is not valid.</ServiceException>
>
> 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: <http://lists.osgeo.org/pipermail/qgis-qwc2/attachments/20260105/9550e00a/attachment.htm>


More information about the qgis-qwc2 mailing list