Skip to content
Snippets Groups Projects
Commit 72bd247e authored by Christof Kaufmann's avatar Christof Kaufmann
Browse files

imagefusion: Workaround incrementing GCP attributes

parent 5c2ee63e
Branches
No related tags found
No related merge requests found
......@@ -320,8 +320,8 @@ void GeoInfo::addTo(GDALDataset* img) const {
for (GCP const& gcp : gcps) {
gdal_gcps.push_back(GDAL_GCP{const_cast<char*>(gcp.id.c_str()),
const_cast<char*>(gcp.info.c_str()),
gcp.pixel,
gcp.line,
gcp.pixel - 1, // workaround for incrementing dfGCPPixel on write
gcp.line - 1, // workaround for incrementing dfGCPLine on write
gcp.x,
gcp.y,
gcp.z});
......
......@@ -124,6 +124,10 @@ BOOST_AUTO_TEST_CASE(gcp)
Image img{input_filename};
img.write(output_filename, gi);
GeoInfo gi_after{output_filename};
img.write(output_filename, gi_after);
gi_after = GeoInfo{output_filename};
img.write(output_filename, gi_after);
gi_after = GeoInfo{output_filename};
// check if the GCP survived
BOOST_CHECK_EQUAL(gi_after.gcps.size(), 3);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment