<div dir="ltr"><div>Hi <br></div><div><br></div><div>Thanks Even for the confirmation.</div><div>As a workaround I was thinking that in this case I can apply the grid before the Helmert transformation. It is not what they say in the specs, but the max error is about 0.1 mm</div><div><br></div><div>I tested it with pyproj. Considering that the checkpoints have an accuracy of 1 mm, it is already matching it ;)</div><div></div><div><br></div><div>The pipeline would be something like this:</div><div><br></div><div>pipeline = """+proj=pipeline <br> +step +inv +proj=cart +ellps=GRS80 <br> +step +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-2000000 +ellps=GRS80 +units=m <br> +step +proj=gridshift +grids=gr_hepos_tm07_grid.tif <br> +step +inv +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-2000000 +ellps=GRS80 +units=m <br> +step +proj=cart +ellps=GRS80 <br> +step +proj=helmert +x=203.437 +y=-73.461 +z=-243.594 <br> +rx=-0.170 +ry=-0.060 +rz=-0.151 <br> +s=-0.294 +convention=coordinate_frame <br> +step +inv +proj=cart +ellps=GRS80 <br> +step +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m<br>"""</div><div><div><br></div><div>In case anyone is interested, the info about the workflow is in
<a href="https://www.hepos.gr/%cf%83%cf%85%cf%87%ce%bd%ce%ad%cf%82-%ce%b5%cf%81%cf%89%cf%84%ce%ae%cf%83%ce%b5%ce%b9%cf%82/" target="_blank">https://www.hepos.gr/%cf%83%cf%85%cf%87%ce%bd%ce%ad%cf%82-%ce%b5%cf%81%cf%89%cf%84%ce%ae%cf%83%ce%b5%ce%b9%cf%82/</a></div><div>more in particular in <a href="https://cdn.ktimatologio.hast.gr/HEPOS_transformations_200219_484787931f.zip" target="_blank">https://cdn.ktimatologio.hast.gr/HEPOS_transformations_200219_484787931f.zip</a></div><div>It includes the grid file in ascii.</div><div><br></div><div>Unfortunately the system GGRS87 is only defined in 2D in EPSG: <a href="https://spatialreference.org/ref/?search=ggrs87" target="_blank">https://spatialreference.org/ref/?search=ggrs87</a></div><div><br></div><div>Cheers.</div><div>Javier</div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 15 Feb 2025 at 16:35, Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p>Javier,</p>
<p>I don't think that can be done directly in PROJ. That would
somehow require a "add" operator using coordinates pushed on the
stack. Or maybe some super convoluted trickery abusing some of our
existing operators, but nothing comes to mind.</p>
<p>No magic then: I would probably write custom code that would
create a grid from ETRS89 to the final CRS (the geographic CRS of
it), with roughly the resolution of the grid in TM07, applying "at
hand" the 4 steps to compute the shift in the lat/long space for
all grid cells (using PROJ for some of the individual steps and
Python to make the addition).</p>
<p>Even<br>
</p>
<div>Le 14/02/2025 à 17:50, Javier Jimenez
Shaw a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div>Hi Even.</div>
<div><br>
</div>
<div>The example in data/sql/transformations_czechia_extra.sql
was very useful.</div>
<div>First I am trying to reproduce the transformation with a
pipeline, and later I will make the proper operations and
concatenated operations in the database.</div>
<div><br>
</div>
<div>However this Greek transformation is more convoluted than
I expected (initially I misunderstood some steps).</div>
<div><br>
</div>
<div>a) First they have a Helmert from ETRS89 (from their
realization, but I do not care) to GGRS87. So far so good
(params are not the ones from EPSG, but no problem)</div>
<div>b) Then they apply the transverse Mercator to "GGRS87 /
Greek Grid". All fine.</div>
<div>c) In parallel they project ETRS89 coordinates into a
different transverse Mercator, called TM07 (not in EPSG;
they provide the params). The grid with the horizontal
corrections are in TM07</div>
<div>d) the final projected coordinates in "GGRS87 / Greek
Grid" are the values from b) plus the corrections from the
grid in c)</div>
<div><br>
</div>
<div>See that the easting-northing coordinates to get the
correction from the grid are not the same as the coordinates
from b). To make it clear, TM07 has a false-northing of
-2000 km</div>
<div><br>
</div>
<div>How can it be done in a pipeline? (later to be converted
into something in proj.db)</div>
<div>I do not know how to keep the corrections somewhere to be
added later to the projected coordinates.</div>
<div><br>
</div>
<div>Thanks</div>
<div>Javier</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, 3 Feb 2025 at 16:54,
Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Javier,</p>
<p>you can probably hack around BOUNDCRS in a totally
PROJ-specific way by using the "METHOD["PROJ-based
operation method: {proj_pipeline_here}" <br>
<br>
</p>
<p>Otherwise having records in the DB will certainly be
cleaner. data/sql/transformations_czechia_extra.sql can
probably be used as an example of quite advanced
transformations, including using a grid referenced in a
projected CRS.</p>
<p>Even<br>
</p>
<p><br>
</p>
<div>Le 03/02/2025 à 16:26, Javier Jimenez Shaw via PROJ a
écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>I am trying to make this transformation (that is
not in EPGS). I do not know how far I can go with
PROJ.</div>
<div><br>
</div>
<div>(Apparently this transformation is needed to go
from the coordinates used by HEPOS.gr, the Greek
positioning system, to the official -I think- CRS in
Greece, <span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">GGRS87</span>.</div>
<div>The best is that the transformation would be in
EPSG. Do you know anybody in Greece with the proper
contacts? I am happy to talk with them about it, and
help if needed)</div>
<div><br>
</div>
<div>Until it is in EPSG, I would like to use PROJ to
do it.<br>
</div>
<div><br>
</div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">The
accurate transformation from ETRS89 to GGRS87 is
something like:</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">-
apply a Helmert transformation</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">-
Project into a transverse Mercator</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">-
Apply a correction grid. Yes, in the projected
system.<br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">-
(optional) go back from the projected to the
geographic crs.</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none"><br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">I
thought about several options:<br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none"><br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">-
First option: create a WKT2 with a BOUNDCRS that
defines the transformation. Can it be done in a
single WKT2?<br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">-
Second option: add the transformation to proj.db.
Is it doable?<br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">-
Third option: Create "my own grid" file (in the
geographic system) combining all the steps. Of
course, it will loose some accuracy due to the new
grid interpolation.<br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none"><br>
</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">Any
clue?</span></div>
<div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none">Thanks.<br>
</span></div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
PROJ mailing list
<a href="mailto:PROJ@lists.osgeo.org" target="_blank">PROJ@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote>
</div>
</div>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote></div>