Bug report #20013

Mars projection issue

Added by Sylvain Breton about 6 years ago. Updated over 5 years ago.

Status:Feedback
Priority:High
Assignee:-
Category:Projection Support
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

Description

Hello,

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.

Sylvain Breton

Capture d’écran 2018-10-04 à 11.37.52.png - Measured distance is false (312 KB) Sylvain Breton, 2018-10-04 12:01 PM

Capture d’écran 2018-10-04 à 11.38.26.png - Once project SCR is set to Mars2000 measure is good (313 KB) Sylvain Breton, 2018-10-04 12:01 PM

History

#1 Updated by Matthie Volat about 6 years ago

Hi, I can confirm this issue is not OS specific as I can reproduce it on a linux system.

As far as I can tell, this might be an issue with the sinu projection type?

#2 Updated by Giovanni Manghi about 6 years ago

  • Regression? changed from No to Yes
  • Priority changed from Normal to High
  • Operating System deleted (macOS High Sierra)

#3 Updated by Paolo Cavallini almost 6 years ago

What is the real CRS for these data?

#4 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Open to Feedback

Paolo Cavallini wrote:

What is the real CRS for these data?

Please change status to "feedback" when needed.

#5 Updated by Sylvain Breton almost 6 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).

#6 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Feedback to Open

#7 Updated by Sylvain Breton almost 6 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.

#8 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Open to Feedback

add the project/data.

#9 Updated by Sylvain Breton almost 6 years ago

Giovanni Manghi wrote:

add the project/data.

https://dl.univ-lyon1.fr/avfkt63l2
Available until (11th mars)

PS: the error is replicable with HiRISE data (an other set of Mars images).

#10 Updated by Giovanni Manghi almost 6 years ago

  • Subject changed from Projection issue to Mars projection issue
  • Status changed from Feedback to Open

#11 Updated by Nyall Dawson almost 6 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 almost 6 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.

How did I solved my issue:
-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 do I think there is a problem here:
-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).

#13 Updated by Matthie Volat almost 6 years ago

I get the same behavior with QGIS 3.4.3 on MacOS (from macports) and QGIS 3.4.4 on FreeBSD, the measurement ellipsoid is set to WGS84.

#14 Updated by Giovanni Manghi over 5 years ago

Sylvain Breton wrote:

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.

How did I solved my issue:

can we close this then?

#15 Updated by Sylvain Breton over 5 years ago

As I said there is still a problem as the ellipsoid of calcul is set by default to WGS84 instead of None/planimetric.

#16 Updated by Giovanni Manghi over 5 years ago

Sylvain Breton wrote:

As I said there is still a problem as the ellipsoid of calcul is set by default to WGS84 instead of None/planimetric.

ok, but that can be changed. I think is just a matter for documenting it... Don't think is really a bug(?).

#17 Updated by Matthie Volat over 5 years ago

This is a regression from QGIS2 that really make things harder for those who work on other bodies than earth... And maybe for users of datasets in other CRS on earth?

What this really intentional?

#18 Updated by Giovanni Manghi over 5 years ago

What this really intentional?

there were changes, intentional meaning that were made on purpose to make life harder I would say no.

#19 Updated by Matthie Volat over 5 years ago

Of course (at least, I hope :)).

I've looked a bit in src/ui/qgsprojectpropertiesbase.ui and src/app/qgsprojectproperties.cpp , but default is not really clear...

#20 Updated by Giovanni Manghi over 5 years ago

Matthie Volat wrote:

Of course (at least, I hope :)).

I've looked a bit in src/ui/qgsprojectpropertiesbase.ui and src/app/qgsprojectproperties.cpp , but default is not really clear...

really better raise the issue on the developers mailing list

Also available in: Atom PDF