[PROJ] Affine transformation in proj < 6?

Even Rouault even.rouault at spatialys.com
Thu Dec 12 08:32:57 PST 2019


On jeudi 12 décembre 2019 13:31:37 CET Tammo Jan Dijkema wrote:
> Hi all,
> 
> I'm new to proj, so sorry if this is a trivial question (I've read through
> docs for an hour without finding an answer, so it can't be too trivial).
> 
> I have a custom coordinate system, which is defined through an affine
> transformation from ETRS89. All coordinates I care about are in xyz
> Cartesian coordinates. In particular, to get pqr coordinates, I do
> 
> coords_pqr = (coords_etrs - pqrorigin_etrs) * (3x3 matrix)
> 
> Now I'm generating raster images in PQR, which I would like to store in
> GeoTiff, so if I understand correctly I need to write a proj string into
> the GeoTiff to describe the projection.

Except that GeoTIFF doesn't store PROJ strings...
Provided that you manage a PROJ string to expression what you want, you could 
(ab)use a GDAL WKT1 string to embed a PROJ string in it, and embed that WKT 
string into GeoTIFF, but the compatibility of this will be really limited.

Example of this:
$ gdal_translate in.tif foo.tif -a_srs "+proj=geos +sweep=x +datum=WGS84 
+h=123456789"

$ listgeo foo.tif

      PCSCitationGeoKey (Ascii,630): "ESRI PE String = 
PROJCS["unknown",GEOGCS["unknown",DATUM["WGS_1984",SPHEROID["WGS 84",
6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",
0,AUTHORITY["EPSG","8901"]],UNIT["degree",
0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Geostationary_Satellite"],PARAMETER["central_meridian",
0],PARAMETER["satellite_height",123456789],PARAMETER["false_easting",
0],PARAMETER["false_northing",0],UNIT["metre",
1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],EXTENSION["PROJ4","+proj=geos 
+sweep=x +lon_0=0 +h=123456789 +x_0=0 +y_0=0 +datum=WGS84 +units=m 
+no_defs"]]"

What you could do instead of abusing the CRS is to provide a geotransform 
matrix with the affine transformation (assuming it is only in the X,Y 
projected coordinate space)


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list