Closed kiliandys closed 2 years ago
Does anyone have any ideas? Or maybe I'm not using the right approach?
using PROJ.4 string is lossy. you'd need to set the ProjectedCSTypeGeoKey to 25831. Using GDAL might also simply by avoiding to deal directly with geotiff details
Thank you for this answer. I will try to modify ProjectedCSTypeGeoKey.
Unfortunately, we can not use GDAL directly :(
Our user can choose their output projection from a list of projection that we create from proj lib. For instance, they pick EPSG:2154.
Assuming that I have this EPSG:2154 code in hand, what is the best way to encode it in the geotiff file?
I am willing to write down geotiff files.
For instance, i'd like to encode the projection info
EPSG:25831
.In order to write down the projection in the geotiff, I am using
GTIFSetFromProj4(gtif, proj4String)
.In order to use this method, I first convert
EPSG:25831
to it's proj4 equivalent via the methodproj_as_proj_string
(proj library)This convert
EPSG:25831
to+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs +type=crs
The encoded information are the following;:
Unfortunately, in QGIS (my version is QGIS 3.6), the detected CRS is a "generated CRS" and not "EPSG:25831".
What I am doing wrong? Most of the time, our user will choose the projection from the EPSG database, so I always have the EPSG code available if needed.
I am using proj7 and libgeotiff 6.0.