2

I would like to perform the following transformation in the GDAL Convert Format tool in QGIS:

projinfo -s ETRF2000 -t ITRF2008 -o PROJ Candidate operations found: 1 ------------------------------------- Operation n┬░1:

unknown id, Conversion from ETRF2000 (geog2D) to ETRF2000 (geocentric) + Inverse of ITRF2008 to ETRF2000 (1) + Conversion from ITRF2008 (geocentric) to ITRF2008 (geog2D), 0 m, Europe - ETRS89

PROJ string: +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=cart +ellps=GRS80 +step +inv +proj=helmert +x=0.0521 +y=0.0493 +z=-0.0585 +rx=0.000891 +ry=0.00539 +rz=-0.008712 +s=0.00134 +dx=0.0001 +dy=0.0001 +dz=-0.0018 +drx=8.1e-05 +dry=0.00049 +drz=-0.000792 +ds=8e-05 +t_epoch=2000 +convention=position_vector +step +inv +proj=cart +ellps=GRS80 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1

In the "Advanced Options" line, I wrote:

-ct \ +proj=pipeline \ +step +proj=axisswap +order=2,1 \ +step +proj=unitconvert +xy_in=deg +xy_out=rad \ +step +proj=cart +ellps=GRS80 \ +step +inv +proj=helmert +x=0.0521 +y=0.0493 +z=-0.0585 +rx=0.000891 +ry=0.00539 \ +rz=-0.008712 +s=0.00134 +dx=0.0001 +dy=0.0001 +dz=-0.0018 +drx=8.1e-05 +dry=0.00049 \ +drz=-0.000792 +ds=8e-05 +t_epoch=2000 +convention=position_vector \ +step +inv +proj=cart +ellps=GRS80 \ +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1

Unfortunately the operation is not performed and I get the following error:

Algorithm 'Convert format' starting… Input parameters: { 'INPUT' : 'file:///C:/QGIS/Point_CRS/EPSG4258_survpoint.csv?type=csv&detectTypes=yes&xField=X&yField=Y&crs=EPSG:4258&spatialIndex=no&subsetIndex=no&watchFile=no', 'OPTIONS' : '-ct \ +proj=pipeline \\n+step +proj=axisswap +order=2,1 \\n+step +proj=unitconvert +xy_in=deg +xy_out=rad \\n+step +proj=cart +ellps=GRS80 \\n+step +inv +proj=helmert +x=0.0521 +y=0.0493 +z=-0.0585 +rx=0.000891 +ry=0.00539 \\n +rz=-0.008712 +s=0.00134 +dx=0.0001 +dy=0.0001 +dz=-0.0018 +drx=8.1e-05 +dry=0.00049 \\n +drz=-0.000792 +ds=8e-05 +t_epoch=2000 +convention=position_vector \\n+step +inv +proj=cart +ellps=GRS80 \\n+step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1', 'OUTPUT' : 'C:/Users/SK.HS/AppData/Local/Temp/processing_506230c12af04d1e8de32b8b8457404b/f4219f0c381a406895aa93f6994c9eaf/OUTPUT.shp' }

GDAL command: ogr2ogr -f "ESRI Shapefile" -ct \ +proj=pipeline \ +step +proj=axisswap +order=2,1 \ +step +proj=unitconvert +xy_in=deg +xy_out=rad \ +step +proj=cart +ellps=GRS80 \ +step +inv +proj=helmert +x=0.0521 +y=0.0493 +z=-0.0585 +rx=0.000891 +ry=0.00539 \ +rz=-0.008712 +s=0.00134 +dx=0.0001 +dy=0.0001 +dz=-0.0018 +drx=8.1e-05 +dry=0.00049 \ +drz=-0.000792 +ds=8e-05 +t_epoch=2000 +convention=position_vector \ +step +inv +proj=cart +ellps=GRS80 \ +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 C:/Users/SK.HS/AppData/Local/Temp/processing_506230c12af04d1e8de32b8b8457404b/f4219f0c381a406895aa93f6994c9eaf/OUTPUT.shp file:///C:/QGIS/Point_CRS/EPSG4258_survpoint.csv?type=csv&detectTypes=yes&xField=X&yField=Y&crs=EPSG:4258&spatialIndex=no&subsetIndex=no&watchFile=no None GDAL command output: ERROR 6: Unknown option name '-ct'

Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update]

[-select field_list] [-where restricted_where|@filename]

[-progress] [-sql |@filename] [-dialect dialect]

[-preserve_fid] [-fid FID] [-limit nb_features]

[-spat xmin ymin xmax ymax] [-spat_srs srs_def] [-geomfield field]

[-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]

[-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]

dst_datasource_name src_datasource_name

[-lco NAME=VALUE] [-nln name]

[-nlt type|PROMOTE_TO_MULTI|CONVERT_TO_LINEAR|CONVERT_TO_CURVE]

[-dim XY|XYZ|XYM|XYZM|layer_dim] [layer [layer ...]]

Advanced options :

[-gt n] [-ds_transaction]

[[-oo NAME=VALUE] ...] [[-doo NAME=VALUE] ...]

[-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent]

[-clipsrcsql sql_statement] [-clipsrclayer layer]

[-clipsrcwhere expression]

[-clipdst [xmin ymin xmax ymax]|WKT|datasource]

[-clipdstsql sql_statement] [-clipdstlayer layer]

[-clipdstwhere expression]

[-wrapdateline][-datelineoffset val]

[[-simplify tolerance] | [-segmentize max_dist]]

[-addfields] [-unsetFid]

[-relaxedFieldNameMatch] [-forceNullable] [-unsetDefault]

[-fieldTypeToString All|(type1[,type2]*)] [-unsetFieldWidth]

[-mapFieldType srctype|All=dsttype[,srctype2=dsttype2]*]

[-fieldmap identity | index1[,index2]*]

[-splitlistfields] [-maxsubfields val]

[-explodecollections] [-zfield field_name]

[-gcp ungeoref_x ungeoref_y georef_x georef_y [elevation]]* [-order n | -tps]

[-nomd] [-mo "META-TAG=VALUE"]* [-noNativeData]

Note: ogr2ogr --long-usage for full help.

Execution completed in 0.23 seconds Results: {'OUTPUT': 'C:/Users/SK.HS/AppData/Local/Temp/processing_506230c12af04d1e8de32b8b8457404b/f4219f0c381a406895aa93f6994c9eaf/OUTPUT.shp'}

Loading resulting layers The following layers were not correctly generated.

  • C:/Users/SK.HS/AppData/Local/Temp/processing_506230c12af04d1e8de32b8b8457404b/f4219f0c381a406895aa93f6994c9eaf/OUTPUT.shp
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

Obviously it seems to not find the '-ct' argument.....

I am running QGIS 3.4 Madeira on Windows...

I have not found example code for the "-ct" option..on the GDAL docs...

Can anybody take a look and suggest what I have to change?

1
  • What is the GDAL version that you are using? Check with ogrinfo --version. From QGIS you find the info from Help - About from the line "Compiled against GDAL/OGR"
    – user30184
    Feb 5, 2020 at 7:54

1 Answer 1

1

The -ct parameter of ogr2ogr is used in the same way than all the other parameters that takes their value from a string. Just add -ct and then the string to use, enclosed between double quotes. As documented in https://gdal.org/programs/ogr2ogr.html you need GDAL version 3.0 or higher for usint this option.

I tried you pipeline for the states.shp shapefile that is part of GeoServer test data and command runs without errors. I used GDAL version 3.1.0dev for testing.

ogr2ogr -f "ESRI Shapefile" test_with_ct.shp states.shp -ct " +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=cart +ellps=GRS80 +step +inv +proj=helmert +x=0.0521 +y=0.0493 +z=-0.0585 +rx=0.000891 +ry=0.00539 +rz=-0.008712 +s=0.00134 +dx=0.0001 +dy=0.0001 +dz=-0.0018 +drx=8.1e-05 +dry=0.00049 +drz=-0.000792 +ds=8e-05 +t_epoch=2000 +convention=position_vector +step +inv +proj=cart +ellps=GRS80 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1"
1
  • 1
    Thank you very much, this worked flawlessly. Tried again with the latest QGIS version (3.10 A Coruna).
    – S.K.
    Feb 5, 2020 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.