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

Refactor of the pixel2map application and add geospatial vector file output #5606

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from

Conversation

afrigeri
Copy link

@afrigeri afrigeri commented Aug 26, 2024

This PR introduces a refactored pixel2map ISIS application and adds the option to generate a geospatial vector file.

The output (specified with TOVECT) will replicate the ISIS output cube using a specialized common vector format for geospatial applications. The vector format is a CSV ASCII file with a virtual (VRT) sidecar XML metadata file supported by the GDAL library. The output will be in unprojected, spherical coordinates (degrees) and provide the Coordinate Reference System (CRS) metadata of the planetary body compatible with the Open GIS Consortium (OGC) standards (IAU namespace).

The vector file can be handled by several geospatial tools and the most diffused GIS software.

Description

pixel2map, following the Isis developed guide, required a refactoring which required:

  • creating a new pixel2map.cpp
  • moving code from main.cpp to pixel2map.cpp
  • updating pixel2map.h

Changes to the library:

  • A new function Vectorize has been added to ProcessGroundPolygon library object.

Changes to the app:

  • Added code to generate the vector file, calling the Vectorize function
  • Added TOVECT option (which excludes TO, TOLIST and MAP parameters)
  • Updated xml documentation

Related Issue

The proposed updates/changes is at #5604

Development-related Issues

  • In the tests, using the DefaultCube gives Null data output pixel values if called from gtest, while correct values when called from the command line pixel2map app. Using other testcubes returns correct values, so the test currently uses MroCtxCube.
  • The new Vectorize function is the only one returning non void among the other ones in ProcessGroundPolygon (a specific warning is issued at compile time). This has been chosen to minimize the impact on the low-level I/O libraries.

Validation

Left the pre-existing old test structure with pixel2map test, and introduced new gtest for this specific update:

App test
added testing on the ASCII output file (had to use MroCtxCube, as the DefaultCube resulted in Null data when test is called from ctest - see above).

Unit test
added a new unit test validating the new Vectorize function by testing vector geometry integrity.

Copy link

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5606".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

@amystamile-usgs
Copy link
Contributor

The following tests are failing for this PR:

1389 - DefaultCube.FunctionalTestCam2mapUserLatlon (Failed)
1392 - DefaultCube.FunctionalTestCam2mapFramerMock (SEGFAULT)
1398 - DefaultCube.FunctionalTestAutomosTracking (SEGFAULT)
1400 - DefaultCube.FunctionalTestBandtrimDefault (SEGFAULT)
1401 - DefaultCube.FunctionalTestBandtrimOneBand (SEGFAULT)
1403 - DefaultCube.FunctionalTestCaminfoCsv (SEGFAULT)
1404 - DefaultCube.FunctionalTestCaminfoDefault (Failed)
1405 - DefaultCube.FunctionalTestCaminfoPoly (Failed)
1406 - DefaultCube.FunctionalTestCaminfoBoundary (Failed)
1410 - DefaultCube.FunctionalTestCamptDefaultParameters (Failed)
1412 - DefaultCube.FunctionalTestCamptSetS (SEGFAULT)
1414 - DefaultCube.FunctionalTestCamptSetGround (Failed)
1418 - DefaultCube.FunctionalTestCamptAllowError (Failed)
1419 - DefaultCube.FunctionalTestCamrangeMeta (Failed)
1420 - DefaultCube.FunctionalTestCamrangeUniversalGround (SEGFAULT)
1421 - DefaultCube.FunctionalTestCamrangeLatitude (Failed)
1422 - DefaultCube.FunctionalTestCamrangeCardinals (SEGFAULT)
1428 - DefaultCube.FunctionalTestCkwriterFromlist (Failed)
1436 - DefaultCube.CSMInitSpiceCleanup (SEGFAULT)
1437 - DefaultCube.CSMInitSpiceRestoredAfterFailure (SEGFAULT)
1438 - DefaultCube.CSMInitSpiceNoCleanup (Failed)
1439 - DefaultCube.FunctionalTestFootprintinitDefault (SEGFAULT)
1440 - DefaultCube.FunctionalTestFootprintinitLincSinc (Failed)
1441 - DefaultCube.FunctionalTestFootprintinitVertices (SEGFAULT)
1443 - DefaultCube.FunctionalTestFootprintinitTestXY (Failed)
1444 - DefaultCube.FunctionalTestFootprintinitPrecision (Failed)
1445 - DefaultCube.FunctionalTestGaussstretch (Failed)
1446 - DefaultCube.FunctionalTestGetsnAllTrue (SEGFAULT)
1448 - DefaultCube.FunctionalTestGetsnDefaultTrue (SEGFAULT)
1452 - DefaultCube.FunctionalTestGetsnOverwrite (SEGFAULT)
1461 - DefaultCube.FunctionalTestIsis2pdsLinears16bit (SEGFAULT)
1463 - DefaultCube.FunctionalTestIsis2pdsManual8bit (SEGFAULT)
1481 - DefaultCube.FunctionalTestNoprojDefault (Failed)
1483 - DefaultCube.FunctionalTestNoprojFromInput (Failed)
1485 - DefaultCube.FunctionalTestNoprojSpecs (Failed)
1486 - DefaultCube.FunctionalTestPhocubeDefault (SEGFAULT)
1493 - DefaultCube.FunctionalTestsPhotrimEmission (SEGFAULT)
1500 - DefaultCube.FunctionalTestSkyptFlatFileError (SEGFAULT)
1505 - DefaultCube.FunctionalTestSpkwriterDefault (Failed)
1506 - DefaultCube.FunctionalTestSpkwriterFromlist (Failed)
1508 - DefaultCube.FunctionalTestVikcalDefault (Failed)
1509 - DefaultCube.FunctionalTestCtxcalCameraComparison (Failed)
1511 - DefaultCube.IsisSensorGetStateImageNewPoint (Failed)
1512 - DefaultCube.IsisSensorGetStateImageOldPoint (Failed)
1513 - DefaultCube.IsisSensorGetStateGroundNewPoint (Failed)
1514 - DefaultCube.IsisSensorGetStateGroundOldPoint (Failed)
1515 - DefaultCube.UnitTestImagePolygonDefaultParams (Failed)
1516 - DefaultCube.UnitTestImagePolygonSubPoly (Failed)
1517 - DefaultCube.UnitTestImagePolygonBoundary (SEGFAULT)
1524 - DemCube.FunctionalTestShadowMatch (Failed)
1526 - DemCube.FunctionalTestShadowNoShadow (Failed)
1527 - DemCube.FunctionalTestShadowAccurate (SEGFAULT)
1894 - MroHiriseCube.FunctionalTestHicolormosDefault (SEGFAULT)
1896 - MroHiriseCube.FunctionalTestHicropCropByLine (SEGFAULT)

@@ -185,7 +185,7 @@ namespace Isis {
projCubeLabel >> projLabel;

testCube = new Cube();
testCube->fromIsd(tempDir.path() + "/default.cub", label, isd, "rw");
testCube->fromIsd("tempDir.path() + default.cub", label, isd, "rw");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be the cause for the majority of the test failures since they all use the DefaultCube fixture.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afrigeri This is still an issue and is causing a bunch of tests to fail. Can the change get reverted?

Copy link

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5606".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

Copy link

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5606".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

Copy link

github-actions bot commented Sep 5, 2024

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5606".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

@amystamile-usgs
Copy link
Contributor

@afrigeri is this PR ready for a review? I am seeing compile errors on our test build.

Copy link

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5606".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

@afrigeri
Copy link
Author

@afrigeri is this PR ready for a review? I am seeing compile errors on our test build.

Compile error should be fixed with aebfea5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants