-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] selection of datum transformation for otf-reprojection
- Loading branch information
Showing
26 changed files
with
876 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please add the NZGD49<->NZGD2000 (~WGS84) datum grid shift transformation as well? I think this SQL should do it:
INSERT INTO tbl_datum_transform (
coord_op_code,
source_crs_code,
target_crs_code,
coord_op_method_code,
p1
)
VALUES (
100002,
4272,
4326,
9615,
'nzgd2kgrid0005.gsb'
);
For more information bout this transformation see here: http://www.linz.govt.nz/geodetic/conversion-coordinates/geodetic-datum-conversion/nzgd1949-nzgd2000/distortion-grid
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also grids and transformations for Portugal to suggest to be added. What is the right way to do it?
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is is really great functionality and something I've been waiting a long time for - many thanks Marco!!
A few notes from my testing so far:
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@palmerj: Thanks, the entry for NZGD49<->NZGD2000 is in srs.db now.
Remembering default transformations sounds reasonable. I'm trying to add that in the options dialog.
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gioman: just send me the defails for the ntv2-Transformation that should go to srs.db (similar to the lines Jeremy sent).
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhugent thanks for the dialogue improvement to remember the default transformations.
Any chance to stop the duplicates showing in the dialogue as per my screenshot in #commitcomment-4556980. I think the bug is in the QgsCoordinateTransform::datumTransformations method.
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@palmerj
Yes, sounds like there might be something wrong in that method. Though I have difficulties here to reproduce the duplicated entries. Also with the NZ coordinate systems, I get only three entries plus the ntv2 one. Another possibility would be that something went wrong with the datum transform sync and produced duplicated entry in tbl_datum_transrom
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhugent thank you for this work! however, on Mac when building WITH_TESTS I get ~2,000 errors when trying to do:
QgsCoordinateReferenceSystem::syncDatumTransform( const QString& dbPath )
3a14b53#diff-8ddbdd08af8ef2dce21153a7c23a4b55R2032
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here in linux debug build
Synchronizing CRS database with GDAL/PROJ definitions.
rc/core/qgscoordinatereferencesystem.cpp: 2018: (syncDatumTransform) Trying datum transform update
rc/core/qgscoordinatereferencesystem.cpp: 2024: (syncDatumTransform) Trying datum transform insert
rc/core/qgscoordinatereferencesystem.cpp: 2032: (syncDatumTransform) Error
rc/core/qgscoordinatereferencesystem.cpp: 2018: (syncDatumTransform) Trying datum transform update
rc/core/qgscoordinatereferencesystem.cpp: 2024: (syncDatumTransform) Trying datum transform insert
rc/core/qgscoordinatereferencesystem.cpp: 2032: (syncDatumTransform) Error
...
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, what a stupid bug... Please try now, it should be fixed.
This bug might also be the cause of the duplicated entries mentioned by Jeremy. No idea why that worked on my system until now.
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhugent, I was still having an issue (minus the debug output on insert):
Fixed by appending missing '_code' to UPDATE column names
After fix, still got 700+ debug lines during compile (these show up as errors in Qt Creator), when building CMAKE_BUILD_TYPE=RelWithDebInfo:
rc/core/qgscoordinatereferencesystem.cpp: 2018: (syncDatumTransform) Trying datum transform update
So maybe have those SQL commands not produce debug output unless the message level is higher? e.g.:
QgsDebugMsgLevel( 'Trying datum transform update', 4 );
3a14b53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhugent I also get the error as reported by @dakcarto however my duplicate problem has now been fixed. Thanks!