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

Use WGS84 (G2139) as the geographic CRS #2205

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Commits on Feb 10, 2024

  1. Georeferencing: Add 'gnss_crs_spec' for new WGS84 realization

    The gnss_crs_spec is EPSG:9755, i.e. WGS84 (G2139).
    The name for the spec string "+proj=latlong +datum=WGS84" is changed
    from geographic_crs_spec to ballpark_geographic_crs_spec, because
    it is retained for compatibility.
    pkturner committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    9e723c5 View commit details
    Browse the repository at this point in the history
  2. Georeferencing: Use new geographic CRS for pivot, tracks and more

    Replace Georeferencing::ballpark_geographic_crs_spec with
    Georeferencing::gns_crs_spec in all occurrences that relate to Mapper
    internals. The former refers to the long-term evolution of WGS84,
    while the latter to an up-to-date realization G1762.
    
    Georeferencing::ballpark_geographic_crs_spec continues to be used
    for the map file format, for interoperability with older versions
    of Mapper.
    pkturner committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    eb93b05 View commit details
    Browse the repository at this point in the history
  3. OgrFileImport: If data CRS is WGS84, substitute recent realization

    In OgrFileImport::setSRS that sets the transformation of imported
    coodinates to the map SRS, if the source SRS is being set to WGS84,
    substitute Georeferencing::gnss_crs_spec. This makes the resulting
    transformation more accurate, for example if the map's datum is NAD83.
    pkturner committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    93c4399 View commit details
    Browse the repository at this point in the history
  4. TemplateTest: Update expectations for WGS84 improvements

    With Mapper now using the WGS84 (G2139) realization for templates and
    as a pivot for coordinate transformations, template alignment has
    changed, causing differences in the test results. The test cases
        TemplateTrack NAD83
        OgrTemplate NAD83
    in ogrTemplateTest no longer fail, because the tracks are now aligned
    well enough with the map and its datum to pass the test. In addition,
    TemplateTrack and OgrTemplate now align tracks the same, causing those
    same test cases to pass in the templateTypesConsistentTest.
    
    On the other hand, the test cases
        TemplateTrack from v0.8.4
        OGRTemplate from v0.9.3
    in ogrTemplateTest now fail, because behavior of earlier versions of
    Mapper did not handle track coordinates as accurately. The position
    is changed by 0.3mm on the map, or 1.3m on the ground.
    pkturner committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    dd25406 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2024

  1. Georeferencing: Use EPSG:9057 as the GNSS geographic CRS

    This changes Georeferencing::gnss_crs_spec from EPSG:9755 to
    EPSG:9057. PROJ handles EPSG:9057 with with an epoch several years
    earlier than EPSG:9755, which makes coordinate transformations to
    NAD83 less accurate, by 20 cm.
    
    With EPSG:9755, Mapper was failing tests in Azure pipelines.
    Changing to the earlier EPSG:9057, which indicates the
    WGS 84 (G1762) realization, may work with the older version
    of PROJ that's available in the superbuild.
    pkturner committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    8869ce6 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2024

  1. Configuration menu
    Copy the full SHA
    9f1706a View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2024

  1. TemplateTrack: Restore to use ballpark track_crs_spec throughout

    TemplateTrack will always rely on the map's Georeferencing to convert
    GPS tracks to map coordinates, which can now be a more accurate
    realization of the ballpark geographic CRS. At the same time, to save
    the realization CRS in the file, or to keep it in the TemplateTrack
    object would provide no benefit.
    pkturner committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    c5673a6 View commit details
    Browse the repository at this point in the history
  2. Georeferencing: Make geographic CRS a member of ProjTransform

    Each Georeferencing object is given its own geographic_crs value,
    so that Mapper will be able to support older maps without affecting the
    alignment of their templates, while simultaneously providing more
    accurate positioning of georeferenced templates in new maps.
    
    For this purpose, ProjTransform objects are enhanced to have an
    explicit geographic CRS in addition to the projected CRS.
    
    This modification to ProjTransform is unsuited to another scenario to
    which ProjTransform used to be applied, namely when the ProjTransform
    would do no more than indicate a CRS. The mechanism supporting
    'forward' and 'inverse' methods of such objects was not constructed. A
    new struct, 'ProjCRS' is provided for this specialized need. Splitting
    off ProjCRS from ProjTransform provides clarity to see which of these
    utility objects define a transformation from a geographic CRS, and
    which define just a CRS.
    pkturner committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    9c7633d View commit details
    Browse the repository at this point in the history
  3. Georeferencing: Add getGeographicCRSSpec() method

    The static value Georeferencing::gnss_crs_spec is made private to the
    Georeferencing class, so that non-core uses of the map's geographic
    WGS84 CRS will be sure to depend on the map to obtain the CRS, rather
    than specify a particular variant of WGS84. Their references to
    gnss_crs_spec are replaced with calls to getGeographicCRSSpec(), which
    in the future will depend on the map. The Georeferencing's
    toGeographicCoords, toProjectedCoords, and toMapCoords methods will be
    consistent with the CRS returned by getGeographicCRSSpec().
    pkturner committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    826e1f4 View commit details
    Browse the repository at this point in the history
  4. Georeferencing: Add isDatumBallpark() method

    The isDatumBallpark() method indicates compatibility for working with
    old maps. It enables GDAL import to provide compatibility with the way
    old Mappers aligned template tracks. When compatibility is not called
    for, track import is tweaked to use a more accurate geographic CRS.
    pkturner committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    26e840b View commit details
    Browse the repository at this point in the history
  5. Georeferencing: Enable datum compatibility mode

    The attribute 'is_realization' is added to the Georeferencing class
    and to the geographic_crs_spec of the xml file format. A 'true' value
    indicates the new, more accurate geographic CRS, while 'false'
    provides the same geographic CRS as earlier versions of Mapper.  The
    geographic CRS is used as pivot when transforming from one version of
    map coordinates to another. It is also used for GNSS tracks and for
    display of geographic coordinates.
    
    The Georeferencing::setDatumBallpark() method provides for the
    compatibility mode to be turned on or off.
    
    On loading a map, the user is warned if they haven't decided whether
    compatibility is wanted. When the user opens the georeferencing dialog,
    a message box asks the user whether they want extra accuracy, or
    alignment that is compatible with older Mappers.
    
    Example and test maps are updated to indicate the 'is_realization'
    attribute. The template_t test had two test files as examples of what
    older versions of Mapper would save. This commit provides the
    compatibility which makes the corresponding two tests succeed.
    pkturner committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    71468af View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2024

  1. Test: Geographic CRS and compatible template alignment

    Adds a test map that has a geographic CRS with is_realization="false".
    This is used with TemplateTest::ogrTemplateTest to check support for
    template alignment that's compatible with Mapper v0.95.
    
    Also, for FileFormatTest::saveAndLoad, getGeographicCRSSpec() is
    added to the map comparison.
    pkturner committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    addecfe View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2024

  1. Georeferencing: Save realization CRS to file

    Instead of saving _that_ the map was developed with a recent
    realization of WGS84 for its geographic CRS, save the _spec_ of the
    geographic CRS itself.
    pkturner committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    68c70f5 View commit details
    Browse the repository at this point in the history