Skip to content

Commit

Permalink
OgrFileImport: Ignore data SRS when using map coords
Browse files Browse the repository at this point in the history
This is a behavioural change, but it is hidden by the fact that Mapper
failed to save the CS choice "Map" (GH-1768).
  • Loading branch information
dg0yt committed Nov 29, 2020
1 parent 60f6ead commit 0f7cbc8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/gdal/ogr_file_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,12 @@ std::unique_ptr<OgrFileImport::Clipping> OgrFileImport::getLayerClipping(OGRLaye
bool OgrFileImport::setSRS(OGRSpatialReferenceH srs)
{
to_map_coord = &OgrFileImport::fromProjected;
if (unit_type == UnitOnPaper)
{
to_map_coord = &OgrFileImport::fromDrawing;
return true;
}

if (srs && data_srs != srs)
{
// New SRS, indeed.
Expand All @@ -1315,10 +1321,6 @@ bool OgrFileImport::setSRS(OGRSpatialReferenceH srs)
data_transform = std::move(transformation);
}

if (!srs && unit_type == UnitOnPaper)
{
to_map_coord = &OgrFileImport::fromDrawing;
}
return true;
}

Expand Down

0 comments on commit 0f7cbc8

Please sign in to comment.