2

I'm trying to convert a point from one SRS to another using proj4 strings and GDAL. My origin SRS uses Helmert transformation to convert point to EPSG:2229 so I tried to use pipeline operator (https://proj4.org/operations/pipeline.html) along with helmert transformation (https://proj4.org/operations/transformations/helmert.html#examples) and got something like this +proj=pipeline +step +proj=helmert +convention=coordinate_frame +x=0 +y=0 +theta=0 +scale=1 +step +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs

Here is my code in python (simplified case): proj4_4326 = "+proj=longlat +datum=WGS84 +no_defs" proj4_2229 = "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +datum=NAD83 +units=us-ft +no_defs" proj4_helmert = "+proj=helmert +convention=coordinate_frame +x=0 +y=0 +theta=0 +scale=1" srs_4326 = osr.SpatialReference() srs_4326.ImportFromProj4(proj4_4326) srs_2229 = osr.SpatialReference() srs_2229.ImportFromProj4("+proj=pipeline +step {} +step {}".format(proj4_helmert, proj4_2229)) global_coords_calculated = convert_coordinates_cs(6427213.13, 1984970.215, srs_2229, srs_4326) print global_coords_calculated

But it ends up with error TypeError: in method 'Geometry_Transform', argument 2 of type 'OSRCoordinateTransformationShadow *. I've tried to google it and found this https://stackoverflow.com/questions/27572190/gdal-reprojection-error-in-method-geometry-transform-argument-2-of-type-osr Seems that it means that some library is missing, but I've installed pyproj along with GDAL. I am using virtualenv, python2 and macOS.

2
  • What versions of PROJ and GDAL are you using? AFAIK the current GDAL release is not yet ready for helmert transformations. I'm not sure about pyproj. – AndreJ Nov 27 '18 at 16:51
  • Proj = 5.2.0 GDAL = 2.3.2 I've even removed pyproj. It's latest version was released at the beginning of 2016, is is definitely outdated. – Alexander Zverev Nov 28 '18 at 12:13
1

GDAL 2.3.2 can not use the new pipeline transformation in PROJ.5.

According to http://osgeo-org.1560.x6.nabble.com/gdal-dev-Early-GDAL-2-4-0-release-td5387216.html, you may have to wait for GDAL 2.5.0, to be released April/May 2019.

Until then, you can use those transformations only in cs2cs and the new cct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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