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

[util] create intermediate rasters #2621

Merged
merged 6 commits into from Sep 6, 2019
Merged

Conversation

@rinkk
Copy link
Member

rinkk commented Aug 20, 2019

Small tool to interpolate n equidistant raster files between two given rasters.

(Originally done for HHS but EN needs this now, too, so it's probably worth including in OGS.)

  1. Feature description was added to the changelog
  2. Tests covering your feature were added?
@@ -248,7 +248,7 @@ MeshTest(
NAME GocadTSurface_Mesh_Test
PATH MeshLib/
EXECUTABLE GocadTSurfaceReader
EXECUTABLE_ARGS -i Top-Lower-Shaly.ts -o ${Data_BINARY_DIR}/MeshLib -b
EXECUTABLE_ARGS -i Top-Lower-Shaly.ts -o ${Data_BINARY_DIR}/MeshLib -b

This comment has been minimized.

Copy link
@endJunction

endJunction Aug 20, 2019

Member

trailing ws;
try not to change unrelated lines.

This comment has been minimized.

Copy link
@rinkk

rinkk Aug 21, 2019

Author Member

I am not aware of changing that line...

if (h1.origin[0] != h2.origin[0])
{
ERR("Origin x-coordinate is not the same in both raster files.\n");
errors_found = true;

This comment has been minimized.

Copy link
@TomFischer

TomFischer Aug 21, 2019

Member

Why not return EXIT_FAILURE;?

This comment has been minimized.

Copy link
@rinkk

rinkk Aug 21, 2019

Author Member

Different errors give different error codes.

if (it2 != dem2->end())
{
ERR("Error: File 1 is shorter than File 2.");
return 1;

This comment has been minimized.

Copy link
@TomFischer

TomFischer Aug 21, 2019

Member

return EXIT_FAILURE;?

This comment has been minimized.

Copy link
@rinkk

rinkk Aug 21, 2019

Author Member

Different errors give different error codes.

FileIO::AsciiRasterInterface::writeRasterAsASC(r, basename + std::to_string(i) + "." + ext);
INFO("Layer %d written.", i+1);
}
return 0;

This comment has been minimized.

Copy link
@TomFischer

TomFischer Aug 21, 2019

Member

return EXIT_SUCCESS;?

This comment has been minimized.

Copy link
@rinkk

rinkk Aug 21, 2019

Author Member

✔️

std::unique_ptr<GeoLib::Raster> dem2(
FileIO::AsciiRasterInterface::readRaster(input2_arg.getValue()));

GeoLib::RasterHeader const h1 = dem1->getHeader();

This comment has been minimized.

Copy link
@TomFischer

TomFischer Aug 21, 2019

Member

Could h1 and h2 be const references?

This comment has been minimized.

Copy link
@rinkk

rinkk Aug 21, 2019

Author Member

✔️

@rinkk rinkk closed this Sep 3, 2019
@rinkk rinkk deleted the rinkk:createIntermediateRasters branch Sep 3, 2019
@rinkk rinkk restored the rinkk:createIntermediateRasters branch Sep 5, 2019
@rinkk rinkk reopened this Sep 5, 2019
TCLAP::CmdLine cmd(
"Takes two DEMs located at the exact same spatial position (but at "
"different elevation) and calculates n raster DEMs located at "
"equidistant intervalls between them (i.e. for n=1, one new raster "

This comment has been minimized.

Copy link
@endJunction

endJunction Sep 5, 2019

Member

intervals

Copy link
Member

endJunction left a comment

Looks good.
Needs a rebase.
When green

@rinkk

This comment has been minimized.

Copy link
Member Author

rinkk commented Sep 5, 2019

did the rebase but something obvs went wrong. no idea what happened. pls halp?!

@TomFischer TomFischer force-pushed the rinkk:createIntermediateRasters branch from 522d688 to 608b599 Sep 6, 2019
@TomFischer

This comment has been minimized.

Copy link
Member

TomFischer commented Sep 6, 2019

I rebased and fixed the spelling. I'll merge if all tests are green.

@TomFischer TomFischer merged commit 4ebb423 into ufz:master Sep 6, 2019
3 checks passed
3 checks passed
continuous-integration/jenkins/pr-merge This commit looks good
Details
deploy/netlify Deploy preview ready!
Details
ufz.ogs #20190906.2 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.