Bug report #20013
Mars projection issue
|Affected QGIS version:||3.2.3||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||27835|
I recently encountered an issue on QGIS 3.2 and I don't find any solution or other thread on this subject.
I'm working on satellite images of Mars. I download processed images in .tif format (example of such an image: https://dl.univ-lyon1.fr/b8di9cdo8).
Since QGIS 3 when I open images in QGIS the projection system of the image is false. As shown in the first attached image the measures given by the measure tool (and all vector measure tools ($lengh, $area...)) are false. Even if there is actually 6 units of difference between each corner of the pixel the measure tool find about 10 m of distance.
If I switch the project SCR to Mars2000 the measure are now right (second attached images). However this CRS is in longlat and thus factor attribute computation don't give me results in m, which is annoying.
I replicated the same problem on ubuntu with QGIS 3.2.
I never had this problem with QGIS 2.
When opening images with GDAL on python measured distances are good.
All this points make me think that the issue may be that QGIS misinterpret CSR of the .tif image and use a terrestrial ellipsoid instead of a martian one. But I'm not familiar at all with this kind of problem and could be completely wrong.
If you need any supplementary informations about this issue I will be at your disposal.
#5 Updated by Sylvain Breton over 2 years ago
Paolo Cavallini wrote:
What is the real CRS for these data?
The real CRS of the image in the screenshot is the custom CRS (user:100103 -* Generated CRS (+proj=sinu +lon_0=335.47655435955 +x_0=0 +a=3396000 +b=3396000 +units=m +no_defs) Projected). This CRS is provided along the image by the NASA.
Those images are provided by Context Camera (CTX) onboard Mars Express. Each CTX image has its own local projection system. Those images are projected on a Martian Ellipsoid (+a=3396000 +b=3396000).
#7 Updated by Sylvain Breton over 2 years ago
I have made some more test on my data and found something I think could help understand the problem.
As I said I never get this issue using QGIS 2, but surprisingly projects created with QGIS 2 that I open with QGIS 3 provide the good distance values. I can provide example file if needed.
If I create a new project (with QGIS 3) and add an image from the project created in QGIS 2 the distance is wrong. However the CRS are exactly the same.
I hope this information could help.
#11 Updated by Nyall Dawson over 2 years ago
- Status changed from Open to Feedback
The issue here isn't the CRS -- it's the Project's ellipsoid settings. But I can't see any difference in behavior here between 2.18 and 3.4 -- in both of them, loading the .tif directly into a new project sets the project CRS as the custom user crs, but leaves the ellipsoid as "None/Planimetric". To me this is expected behaviour -- the CRS definition doesn't include an explicit ellipsoid definition, so we can't automatically set it to match the CRS.
Manually setting the ellipsoid to either Mars2000 or a custom ellipsoid results in correct measurements (both 2.18 and 3.4)
#12 Updated by Sylvain Breton over 2 years ago
Your comment helped me better understand my problem and I am now able to get good measurement values. However I still think there is an issue behind this.
-I opened Project Properties, in the General tab I changed the ellipsoid in Measurement subsection.
-By default the selected ellipsoid is WGS 84, switching to None/planimetric solved the measurement issue.
-Switching to Custom with semi-major=semi_minor=3396000 m (Which is martian Diameter) also work.
-Why is the default measurement ellipsoid set to WGS 84?
-On QGIS 2.18 default measurement ellipsoid is None/planimetric (that is why QGIS 2 worked for me).