Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mars projection issue #27835

Closed
qgib opened this issue Oct 4, 2018 · 21 comments
Closed

Mars projection issue #27835

qgib opened this issue Oct 4, 2018 · 21 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers High Priority Projections/Transformations Related to coordinate reference systems or coordinate transformation Regression Something which used to work, but doesn't anymore Won't fix By design, or won't be fixed for some other reason

Comments

@qgib
Copy link
Contributor

qgib commented Oct 4, 2018

Author Name: Sylvain Breton (@SylvainBreton)
Original Redmine Issue: 20013
Affected QGIS version: 3.2.3
Redmine category:projection_support


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


@qgib
Copy link
Contributor Author

qgib commented Oct 8, 2018

Author Name: Matthie Volat (Matthie Volat)


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?

@qgib
Copy link
Contributor Author

qgib commented Oct 9, 2018

Author Name: Giovanni Manghi (@gioman)


  • regression was changed from 0 to 1
  • priority_id was changed from Normal to High
  • operating_system was changed from macOS High Sierra to

@qgib
Copy link
Contributor Author

qgib commented Dec 28, 2018

Author Name: Paolo Cavallini (@pcav)


What is the real CRS for these data?

@qgib
Copy link
Contributor Author

qgib commented Dec 28, 2018

Author Name: Giovanni Manghi (@gioman)


Paolo Cavallini wrote:

What is the real CRS for these data?

Please change status to "feedback" when needed.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2019

Author Name: Sylvain Breton (@SylvainBreton)


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).

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2019

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Jan 10, 2019

Author Name: Sylvain Breton (@SylvainBreton)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 10, 2019

Author Name: Giovanni Manghi (@gioman)


add the project/data.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jan 10, 2019

Author Name: Sylvain Breton (@SylvainBreton)


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).

@qgib
Copy link
Contributor Author

qgib commented Jan 11, 2019

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from Projection issue to Mars projection issue
  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2019

Author Name: Nyall Dawson (@nyalldawson)


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)


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2019

Author Name: Sylvain Breton (@SylvainBreton)


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).

@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2019

Author Name: Matthie Volat (Matthie Volat)


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.

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2019

Author Name: Giovanni Manghi (@gioman)


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?

@qgib
Copy link
Contributor Author

qgib commented Mar 11, 2019

Author Name: Sylvain Breton (@SylvainBreton)


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

@qgib
Copy link
Contributor Author

qgib commented Mar 11, 2019

Author Name: Giovanni Manghi (@gioman)


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(?).

@qgib
Copy link
Contributor Author

qgib commented Mar 12, 2019

Author Name: Matthie Volat (Matthie Volat)


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?

@qgib
Copy link
Contributor Author

qgib commented Mar 12, 2019

Author Name: Giovanni Manghi (@gioman)


What this really intentional?

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

@qgib
Copy link
Contributor Author

qgib commented Mar 12, 2019

Author Name: Matthie Volat (Matthie Volat)


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...

@qgib
Copy link
Contributor Author

qgib commented Mar 12, 2019

Author Name: Giovanni Manghi (@gioman)


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

@qgib qgib added Feedback Waiting on the submitter for answers Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Projections/Transformations Related to coordinate reference systems or coordinate transformation Regression Something which used to work, but doesn't anymore labels May 25, 2019
@nyalldawson
Copy link
Collaborator

Please reopen if still reproducible under 3.8 and proj 6.1 -- all transformation handling is now done using Proj's CRS database, which has fixed many issues like this.

Issues like this won't be addressed in the LTR release, due to the complexity of CRS handling in that release and the risk of breaking other components of QGIS.

@nyalldawson nyalldawson added the Won't fix By design, or won't be fixed for some other reason label Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers High Priority Projections/Transformations Related to coordinate reference systems or coordinate transformation Regression Something which used to work, but doesn't anymore Won't fix By design, or won't be fixed for some other reason
Projects
None yet
Development

No branches or pull requests

2 participants