Hi Andrea,
thanks a lot!

I did as you told me - imported the data without geometry, created a custom function and used <geometry by _expression_> (one of my all time favourites, I use it a lot!).
However, QGIS crashes when firing the command.
I therefore installed the latest 3.44.7, but it crashes again:
 
##################
## Report Details
**Python Stack Trace**
```
Windows fatal exception: access violation
Current thread 0x00003d14 (most recent call first):
  File "C:\PROGRA~1\QGIS34~1.7\apps\Python312\Lib\site-packages\pyproj\crs\crs.py", line 350 in __init__
    self._local.crs = _CRS(self.srs)
  File "C:\PROGRA~1\QGIS34~1.7\apps\Python312\Lib\site-packages\pyproj\crs\crs.py", line 503 in from_user_input
    return cls(value, **kwargs)
  File "C:\PROGRA~1\QGIS34~1.7\apps\Python312\Lib\site-packages\pyproj\transformer.py", line 627 in from_crs
    cstrencode(CRS.from_user_input(crs_from).srs),
  File "C:\Users/RSpielhofer/AppData/Roaming/QGIS/QGIS3\profiles\default/python\expressions\transform_xyz_pyproj.py", line 6 in transform_xyz_pyproj
    transformer = Transformer.from_crs(CRS_from, CRS_to, always_xy=True)
  File "C:\PROGRA~1/QGIS34~1.7/apps/qgis/./python\qgis\core\additions\qgsfunction.py", line 79 in func
    return self.function(*values, **kwvalues)
Thread 0x000055e8 (most recent call first):
  File "C:\PROGRA~1/QGIS34~1.7/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 498 in executeAlgorithm
    dlg.exec()
  File "C:\PROGRA~1/QGIS34~1.7/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 272 in executeAlgorithm
    self.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)
```

**Stack Trace**
```
osgeo::proj::io::AuthorityFactory::createCoordinateReferenceSystem :
osgeo::proj::io::AuthorityFactory::createCoordinateReferenceSystem :
osgeo::proj::io::createFromUserInput :
osgeo::proj::io::createFromUserInput :
proj_create :
PyObject_Vectorcall :
PyObject_Vectorcall :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyNumber_Long :
PyNumber_Negative :
PyObject_Call :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyArg_CheckPositional :
PyObject_Call :
PyObject_Call :
PyInit_sip :
PyInit_sip :
pdal::StreamPointTable::reset :
QgsPresetSchemeColorRamp::clone :
QgsExpressionFunction::run :
QgsPresetSchemeColorRamp::clone :
QgsExpressionNodeFunction::evalNode :
QgsExpressionNode::eval :
QgsExpression::evaluate :
QgsExtractBinaryFieldAlgorithm::tags :
QgsProcessingFeatureBasedAlgorithm::processAlgorithm :
QgsProcessingAlgorithm::runPrepared :
QgsProcessingAlgRunnerTask::run :
pdal::PointView::layout :
QgsTask::start :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :
```
 
**QGIS Info**
QGIS Version: 3.44.7-Solothurn
QGIS code revision: ea262bc5ed8
Compiled against Qt: 5.15.13
Running against Qt: 5.15.13
Compiled against GDAL: 3.12.1
Running against GDAL: 3.12.1
 
**System Info**
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.26100
 
 
I am unsure what causes the crash.
 
Thanks & best regards,
Roland
 
Gesendet: Samstag, 28. Februar 2026 um 09:43
Von: "Andrea Giudiceandrea" <[email protected]>
Betreff: Re: [Qgis-user] Convert geocentric x, y, z to projected coordinates
> Roland Spielhofer rspiel at gmx.net
> Fri Feb 27 04:33:10 PST 2026
> I have a set of coordinates as geocentric x, y, z 3D-coordinates in ETRF89 (located in Austria), which should be, if I am not wrong, EPSG:7194.
> x y z
> 4080019.8005 1202964.0971 4736921.5758

Hi Roland,
according to some issue reports [1] [2], it looks like geocentric
to/from geographic transformations are not well handled in QGIS either
by the on-the-fly reprojection functionality and by the Reproject layer
processing algorithm.

Anyway, you could perform the transformation directly in QGIS using the
pyproj Python module and creating a custom function.

I suggest you to proceed in the following way:

- import the delimited text file as an attribute only table ("No geometry")
- open the Field Calculator, go to Function Editor
- create a new function file named transform_xyz_pyproj and replace the
default Python script with the following one [3]:


from qgis.core import *
from pyproj import Transformer

@qgsfunction(group='Custom', referenced_columns=[])
def transform_xyz_pyproj(x, y, z, CRS_from, CRS_to):
transformer = Transformer.from_crs(CRS_from, CRS_to, always_xy=True)
x2, y2, z2 = transformer.transform(x, y, z)
return QgsGeometry.fromPoint(QgsPoint(x2, y2, z2))


Now you can use the transform_xyz_pyproj custom function to perform the
transformation:

- open the "Geometry by _expression_" processing algorithm
- set the imported delimited text layer as the Input layer
- set Point as geometry output type and "output geometry has z dimension"
- set the Geometry _expression_:
transform_xyz_pyproj("x", "y", "z", 'EPSG:7914', 'EPSG:25833')
- execute the algorithm
- assign the CRS EPSG:25833 to the output layer.

Regards.

Andrea Giudiceandrea


[1] https://github.com/qgis/QGIS/issues/34845
[2] https://github.com/qgis/QGIS/issues/53439
[3] https://gist.github.com/agiudiceandrea/1d16762512f9d2a214bdbb4ac9666e60
_______________________________________________
QGIS-User mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to