0

For a project I am trying to use machine learning on maps of Mars using OTB, but I get critical errors and I'm quite sure they have nothing to do with OTB (but you never know).

Objective:

Being able to use the OTB package on maps of Mars

Current progress:

I imported two maps of Mars (Map 1, Map2) into QGIS and did some stuff with the DEM to make it look good (just changing colors to visualize the elevation). They line up very nicely. Map1 uses this CRS: 'Mars_2000_(Sphere)' with Authority ID: ESRI:104971. QGIS sets the CRS used by map2 to a custom CRS: 'SimpleCylindrical Mars' without an Authority ID.

Problem

When importing the maps QGIS immediately raises the warning (and some more like it):

No transform is available between SimpleCylindrical Mars and Custom CRS: GEOGCRS["unknown",DATUM["unknown",ELLIPSOID["WGS 8….
proj_create_operations: Source and target ellipsoid do not belong to the same celestial body

Ignoring this is fine when in the overview as the maps align nicely. However, OTB obviously does not like this and when trying a random learning algorithm (in this case KMeansClassification) I get the following error:

QGIS version: 3.16.5-Hannover
QGIS code revision: 58ba7c1e
Qt version: 5.15.2
GDAL version: 3.2.1
GEOS version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 6.3.2, May 1st, 2020
Processing algorithm…
Algorithm 'KMeansClassification' starting…
Input parameters:
{ 'in' : '/home/joblogmans/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/processing/outputs/MARS Viking Reprojected.tif', 'out' : 'TEMPORARY_OUTPUT', 'nc' : 5, 'ts' : 100, 'maxit' : 1000, 'centroids.in' : '', 'centroids.out' : 'TEMPORARY_OUTPUT', 'sampler' : 'periodic', 'sampler.periodic.jitter' : 0, 'vm' : None, 'nodatalabel' : 0, 'cleanup' : True, 'rand' : 0, 'outputpixeltype' : 5 }

ERROR 1: PROJ: proj_create_operations: Source and target ellipsoid do not belong to the same celestial body
ERROR 6: Cannot find coordinate operations from `GEOGCRS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",ELLIPSOID["Mars_2000_(Sphere)",3396190,0,LENGTHUNIT["metre",1]],ID["ESRI",106971]],PRIMEM["Reference_Meridian",0,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],CS[ellipsoidal,2],AXIS["latitude",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],AXIS["longitude",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]]]' to `EPSG:4326'
2021-04-07 19:21:54 (INFO) KMeansClassification: Default RAM limit for OTB is 256 MB
2021-04-07 19:21:54 (INFO) KMeansClassification: GDAL maximum cache size is 782 MB
2021-04-07 19:21:54 (INFO) KMeansClassification: OTB will use at most 12 threads
2021-04-07 19:21:54 (INFO) KMeansClassification: Elevation management: setting default height above ellipsoid to 0 meters
2021-04-07 19:21:54 (FATAL) KMeansClassification: Caught std::exception during application execution: (InvalidCoordinateTransfromationException) Source: GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_Sphere",SPHEROID["Mars_2000_(Sphere)",3396190,0],AUTHORITY["ESRI","106971"]],PRIMEM["Reference_Meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST]], target: GEOGCS["WGS 84",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"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
Execution completed in 0.34 seconds
Results:
{'centroids.out': '/tmp/processing_NjBoNc/c606b20e1a474161aa2c5d8ad2d8b9cc/centroids_out.file',
'out': '/tmp/processing_NjBoNc/6e5ad570268745e995f708ee34f65d18/out.tif'}

Loading resulting layers
The following layers were not correctly generated.
• /tmp/processing_NjBoNc/6e5ad570268745e995f708ee34f65d18/out.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

I believe this has to do with the CRS not working as it complains about it being different celestial bodies...

Now the real problem is probably in not being able to convert it into good CRS'es. Mars_2000_(Sphere) would probably be prefered (although the elliptical measuring tool doesn't work and the Cartesian measuring tool thinks it's on Earth as it east-west measurements give Earth-like numbers...). I tried 'reprojecting (warping)' and 'assign projection' but to no help. In general project settings the CRS is also set to 'Mars_2000_(Sphere)'.

Old question: How can I set the maps to the correct CRS ('Mars_2000_(Shape)' probably) and make OTB (and other CoordinateTransform thingies) work nicely with it?

Update:

(2021-04-08 11:20) I got some help and was pointed to the bottom of the download pages and apparently they both use 'SimpleCylindrical Mars' so I switched to that CRS. Map1 was automatically changed to Mars_2000_(Spherical) so I switched that back. This made Map1 incredibly small so I reprojected it from Mars_2000_(Spherical) to 'SimpleCylindrical Mars' and saved it to a new file and now it maps 1-on-1 and Cartesian measurements are perfect. The project CRS is also set to 'SimpleCylindrical Mars'. However, when using KMeansClassification (again, not for actual info, just to see if OTB works with the current setup) it still throws the 'different celestial body' error as seen in the previous log-output. The new output for completeness:

QGIS version: 3.16.5-Hannover
QGIS code revision: 58ba7c1e
Qt version: 5.15.2
GDAL version: 3.2.1
GEOS version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 6.3.2, May 1st, 2020
Processing algorithm…
Algorithm 'KMeansClassification' starting…
Input parameters:
{ 'in' : '/home/joblogmans/Documents/GIS/Mars_Viking_MDIM21_ClrMosaic_global_232m.tif', 'out' : 'TEMPORARY_OUTPUT', 'nc' : 5, 'ts' : 100, 'maxit' : 1000, 'centroids.in' : '', 'centroids.out' : 'TEMPORARY_OUTPUT', 'sampler' : 'periodic', 'sampler.periodic.jitter' : 0, 'vm' : None, 'nodatalabel' : 0, 'cleanup' : True, 'rand' : 0, 'outputpixeltype' : 5 }

ERROR 1: PROJ: proj_create_operations: Source and target ellipsoid do not belong to the same celestial body
ERROR 6: Cannot find coordinate operations from `PROJCRS["SimpleCylindrical Mars",BASEGEOGCRS["GCS_Mars",DATUM["D_Mars",ELLIPSOID["Mars",3396190,0,LENGTHUNIT["metre",1,ID["EPSG",9001]]]],PRIMEM["Reference_Meridian",0,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]]],CONVERSION["unnamed",METHOD["Equidistant Cylindrical",ID["EPSG",1028]],PARAMETER["Latitude of 1st standard parallel",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["northing",north,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]]]' to `EPSG:4326'
2021-04-08 11:13:47 (INFO) KMeansClassification: Default RAM limit for OTB is 256 MB
2021-04-08 11:13:47 (INFO) KMeansClassification: GDAL maximum cache size is 782 MB
2021-04-08 11:13:47 (INFO) KMeansClassification: OTB will use at most 12 threads
2021-04-08 11:13:47 (INFO) KMeansClassification: Elevation management: setting default height above ellipsoid to 0 meters
2021-04-08 11:13:47 (FATAL) KMeansClassification: Caught std::exception during application execution: (InvalidCoordinateTransfromationException) Source: PROJCS["SimpleCylindrical Mars",GEOGCS["GCS_Mars",DATUM["D_Mars",SPHEROID["Mars",3396190,0]],PRIMEM["Reference_Meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Equirectangular"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]], target: GEOGCS["WGS 84",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"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
Execution completed in 0.54 seconds
Results:
{'centroids.out': '/tmp/processing_LLviiD/56489cf5ed5a4396941ddd72bdace9d2/centroids_out.file',
'out': '/tmp/processing_LLviiD/ed061e00a5ef40048c4975dbd9ae70c9/out.tif'}

Loading resulting layers
The following layers were not correctly generated.
• /tmp/processing_LLviiD/ed061e00a5ef40048c4975dbd9ae70c9/out.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

New question: How can I make OTB play nicely with the 'SimpleCylindrical Mars' CRS or change the CRS to something OTB likes while maintaining Mars as the planet?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.