# How to create proj4 definition of local coordinatesystem

i have to generate a proj4 definition string from affine transformation parameters (A-F).

For example:

I have a local coordinatesystem based on EPSG:31466

The affine parameter are:

``````  A = 0.933176825,
B = -0.358394718,
C = 2557551.066,
D = 0.358262137,
E = 0.933522886,
F = 5635190.282
``````

Coordinates of 31466:

2575489,2435

5729759,4565

coordinates of local coordinatesystem:

50600.9577413499

81876.1639280757

but how to translate the affine parameter to a proj4 string? i need it for gdal and geoserver

proj5 just added the ability to include an affine transformation to the transformation pipeline a few weeks ago (approximately 1 Oct 2018).

There's an ongoing project to add support for the transformation pipeline into GDAL and QGIS over the next months.

So, it's not there yet.

• yeah thanks, i read about it. but it is not possible yet to create the proj4 string right? maybe a third party libary to do this? Commented Oct 15, 2018 at 21:00

Assuming your parameters are to be used in

``````X' = a*x + b*y + c
Y' = d*x + e*y + f
``````

where x,y are local and X',Y' are DHDN-GK2 coordinates, I get an offset of 63 m to your DHDN-GK2 values.

Ignoring your reference point, but taking the corner coordinates from Local coordinate system to EPSG via affine transformation , I think the transformation is just a rotation of 21 degrees against DHDN-GK2.

A possible solution is to take the DHDN-GK2 center coordinates, transform them to WGS84, and build an omerc projection with false Easting and Northing (taken from the local grid center) around that:

`````` +proj=omerc +lat_0=51.6959777875 +lonc=7.0923165808 +alpha=-20.145 +gamma=0 +k=1 +x_0=50692.579 +y_0=81723.458 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
``````

Note that the rotation differs from the 21 degrees, because DHDN-GK2 is rotated against true north at the location. Offsets are less than 5 centimeters using the beta2007 grid to transform from DHDN to WGS84.