<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";}
span.E-MailFormatvorlage21
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE-CH" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Hi Andreas<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">I did some investigation and found the following answers to your questions:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">> Is the id 100001 for the swiss datum transformation stable?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">> Are those .gsb file names hard coded somewhere?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">I suppose the id is stable. The id and the .gsb file names seem to be hard coded in the srs.db template. Apparently the id for CHENYX06a.gsb has
 been defined in commit <a href="https://github.com/qgis/QGIS/commit/3465c3eb509b9285f0b7d99129dcbaad84463771">
https://github.com/qgis/QGIS/commit/3465c3eb509b9285f0b7d99129dcbaad84463771</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">> The table tbl_datum_transformation does not contain any references to the .gsb files. How does QGIS find those files?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">QGIS seems to look for the .gsb files in the directory where Proj.4 stores them: /usr/share/proj (I see you figured this out too)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Thanks a lot for updating the documentation.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Btw. now I guess that it’s possibly not even necessary to run crssync (opposed to what I wrote earlier).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Neumann, Andreas [</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><a href="mailto:a.neumann@carto.net"><span lang="DE-CH">mailto:a.neumann@carto.net</span></a></span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">]
<br>
<b>Gesendet:</b> Freitag, 28. </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Oktober 2016 16:56<br>
<b>An:</b> Schmid Andreas<br>
<b>Cc:</b> 'richard@duif.net'; 'QGIS User List'<br>
<b>Betreff:</b> Re: [Qgis-user] QGIS server: configuration of grid shift files for datum conversions<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">I was able to fix the crash by naming the .gsb files EXACTLY like Andy wrote below - my name before was chenys06a.gsb. After I created a symblink to CHENYX06a.gsb the crash was
 gone.<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">This looks really strange. Are thoses .gsb file names hard coded somewhere? Quite a mystery ...<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Andreas<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">On 2016-10-28 16:45, Neumann, Andreas wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Hi Andy,<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Thank for these very precise instructions.<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">I was able to do the same on CentOS 7 with only very minor differences (probably because I self-compile QGIS server).<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Is the id 100001 for the swiss datum transformation stable?<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">I think this information should be added to the QGIS user manual, in the server section. I created a pull request: </span><a href="https://github.com/qgis/QGIS-Documentation/pull/1481"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">https://github.com/qgis/QGIS-Documentation/pull/1481</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">-------<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">fyi: i get a server crash when I use a request in EPSG:2056, project done in EPSG:21781 - still investigating what the reason is ...<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Thanks a lot - very useful information!<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Andreas<o:p></o:p></span></p>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif"">On 2016-10-24 11:09, Schmid Andreas wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Hi,<br>
<br>
At Kanton Solothurn we had the same requirement. And we did not want to fiddle with the original proj.4 definition files. So we paid Sourcepole for solving this directly in QGIS Server (</span><a href="https://github.com/qgis/QGIS/commit/70863ecaf0ccfcb538e3892af4b528304b21a0a2"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">https://github.com/qgis/QGIS/commit/70863ecaf0ccfcb538e3892af4b528304b21a0a2</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">).<br>
This is how it works under Ubuntu:<br>
<br>
* Place those CHENYX06a.gsb and CHENYX06_etrs.gsb in /usr/share/proj (probably in our case only CHENYX06a.gsb is actually needed)<br>
<br>
* If QGIS Server was installed before placing the .gsb files, run /usr/lib/qgis/crssync (or run it anyway)<br>
<br>
* In /etc/apache2/mods-enabled/fcgid.conf place the following additional option:<br>
InitialEnv DEFAULT_DATUM_TRANSFORM=EPSG:21781/EPSG:2056/100001/-1;EPSG:2056/EPSG:21781/-1/100001<br>
<br>
The meaning of this option is: when your .qgs is in EPSG:21781 and the WMS request is in EPSG:2056, then use datum transformation 100001; when your .qgs is in EPSG:2056 and the WMS request is in EPSG:21781, then use datum transformation 100001 as well, but
 use it the other way round.<br>
The datum transformation code 100001 can be looked up in /usr/share/qgis/resources/srs.db. Look at attribute coord_op_code of table tbl_datum_transform.<br>
<br>
<br>
</span><span style="font-size:10.0pt;font-family:"Courier New"">Regards,<br>
Andy<br>
<br>
<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">-----Ursprüngliche Nachricht-----<br>
Von: Qgis-user [mailto:</span><a href="mailto:qgis-user-bounces@lists.osgeo.org"><span style="font-size:10.0pt;font-family:"Courier New"">qgis-user-bounces@lists.osgeo.org</span></a><span style="font-size:10.0pt;font-family:"Courier New"">] Im Auftrag von Richard<br>
Duivenvoorde<br>
Gesendet: Montag, 24. </span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Oktober 2016 10:01<br>
An: Neumann, Andreas<br>
Cc: QGIS User List<br>
Betreff: Re: [Qgis-user] QGIS server: configuration of grid shift files for datum<br>
conversions<br>
<br>
On 2016-10-24 06:23, Neumann, Andreas wrote: <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Hi,<br>
<br>
I have to configure QGIS server to properly handle grid shift files.<br>
In Switzerland we need to offer "old" and "new" coordinates (different<br>
datums) at the same time with our services and the conversion needs to<br>
be done with grid shift files or tin based interpolation.<br>
<br>
I know that I have to copy the CHENYX06a.gsb file to my proj lib, e.g.<br>
/usr/local/shar/proj  - but how can I make QGIS Server to actually use<br>
this file? I assume that I need to copy an additional config file or<br>
SRS/grid shift file combinations to QGIS server and/or specify an<br>
environment variable - right?<br>
<br>
Are there any resources explaining how I can configure QGIS server to<br>
make use of these grid shift files?<br>
<br>
Thank you for any pointers!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><br>
Hi Andreas,<br>
<br>
funny, in NL we just had a discussion about how to handle different<br>
available datum transformation too last week...<br>
<br>
we also recently got a grid shift file to better handle datum<br>
transformation and I found this post of Sourcepole:<br>
</span><a href="http://blog.sourcepole.ch/2014/02/18/ntv2-transformations-with-qgis/"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">http://blog.sourcepole.ch/2014/02/18/ntv2-transformations-with-qgis/</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><br>
Which I think answers your question (at least for the desktop side)<br>
<br>
But from a mini presentation from somebody from our National Cadastre, I<br>
actually draw the conclusion that the way QGIS represents CRS's is too<br>
narrow/not complete...<br>
<br>
Please correct me if I'm wrong, but a lot of 'On The Fly'-reprojections<br>
actually need 2(!) proj configurations/steps:<br>
- the projection parametes (mostly available in the epsg database)<br>
- the datum transformation parameters (these is the 'towsg84...'-part,<br>
AND only needed when you do an actual datum transformation, PARTLY<br>
available in the epsg database)<br>
The last part can either be a list of parameters (to calculate it) OR<br>
(as in your case and in the dutch preferred case) a grid shift file (as<br>
proj can only handle one of these).<br>
<br>
SO: for example for certain crs's (in QGIS the dutch one is called<br>
epsg:28992) there is actually a SET of combinations available: the<br>
projection and 4 or 5 transformations<br>
(</span><a href="http://pix.toile-libre.org/upload/original/1477238061.png"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">http://pix.toile-libre.org/upload/original/1477238061.png</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">),<br>
<br>
QGIS actually picks one (from qgis.db) of these and present them to the<br>
user as THE epsg:28992 crs, while in our case this is actually not the<br>
best fit, and in your case you actually want to pick two!<br>
<br>
I understood that in ArcGIS, the user actually every time is presented<br>
with a 'pick the right datum transformation' dialog as soon as the data<br>
needs a datum transformatio. As a draw back: making it more difficult<br>
for new users to pick the right one, BUT on the positive side making it<br>
easier to pick the right projection/datumtransformation pair!<br>
<br>
So what about using both worlds:<br>
- in the qgis.db / crs table NOT use the projection-name as<br>
crs-identifier (so NOT epsg:28992), BUT the combination of projection<br>
AND datumtransformation, so in our case (28992_4833, 28992_15934, or<br>
epsg28992_epsg4833, epsg28992_qgis0001 to be able to handle<br>
projection/transformation combinations not available in the epsg db)<br>
- and instead of current possibility to have a 'check'-box to have the<br>
'select datum transformation' popup we make this available in the<br>
'choose crs'-dialog with a button, and then 'remember' the last used<br>
crs's (in which a crs is NOT only the projection anymore but a<br>
projection/transformation combi)<br>
<br>
IF QGIS starts using this combinations AND proj/gdal will ship all<br>
gridfiles towgs-paramters etc etc, this will become a better world :-)<br>
<br>
Does this make sense? Do others get excited from this idea too?<br>
<br>
Regards,<br>
<br>
Richard Duivenvoorde<br>
<br>
ps about providing the gridfiles, I urge our national Kadaster to make<br>
it available as treu open geodata, that is without a copyright<br>
disclaimer, so it can be picked up by Debian and other distro's.<br>
<br>
_______________________________________________<br>
Qgis-user mailing list<br>
</span><a href="mailto:Qgis-user@lists.osgeo.org"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Qgis-user@lists.osgeo.org</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><br>
List info: </span><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">http://lists.osgeo.org/mailman/listinfo/qgis-user</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><br>
Unsubscribe: </span><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">http://lists.osgeo.org/mailman/listinfo/qgis-user</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
</div>
</blockquote>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif""><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">_______________________________________________<br>
Qgis-user mailing list<br>
</span><a href="mailto:Qgis-user@lists.osgeo.org"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">Qgis-user@lists.osgeo.org</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><br>
List info: </span><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">http://lists.osgeo.org/mailman/listinfo/qgis-user</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><br>
Unsubscribe: </span><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New"">http://lists.osgeo.org/mailman/listinfo/qgis-user</span></a><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
</div>
</blockquote>
<p><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>