I have an application that can import / export geospatial data to / from an ESRI SDE Database (SQLServer). The data is transformed to WGS84 before it is inserted into the DB and again from WGS84 to the projected Coordinate System the data was originally in when exported.
I use EPSG codes for the coordinate system and the transformation but when I come to transform the data I can't seem to specify the transformation using the ESPG code.
I use GDAL v3.4.1 packages (GDAL & GDAL.Native) from NUGET
Here is the code I use for creating the CoordinateTransformation -
public static CoordinateTransformation getTransformationParameters(int TransformationSR, int FromSRCode, int ToSRCode)
{
// Create SpatialReference from ESPG codes one will always be 4326 depending on direction
SpatialReference FromSR = new SpatialReference(null);
FromSR.ImportFromEPSG(FromSRCode);
SpatialReference ToSR = new SpatialReference(null);
ToSR.ImportFromEPSG(ToSRCode);
// Create TranformationOptions
CoordinateTransformationOptions TransformationOptions = new CoordinateTransformationOptions();
TransformationOptions.SetOperation($@"urn:ogc:def:coordinateOperation:EPSG::{TransformationSR}");
CoordinateTransformation Transformation = new CoordinateTransformation(FromSR, ToSR, TransformationOptions);
return Transformation;
}
If I remove the TransformationOptions and let GDAL use the normal computed pipeline it transforms the coordinates using whatever it thinks the best transformation is, but I have to be able to transform the coordinate using very specific transformations and I just can't get this working.
The ESPG codes that I am using are as follows -
FromSRCode - 4326 (WGS84)
ToSRCode - 23090 (ED50 TM0)
TransformationSR - 1311 (ED50 to WGS 84 (18))
I'd greatly appricate any help.