Mapper: Incorrect pre-filling in Georeferencing setup window when using raster template

Created on 29 Aug 2018  路  11Comments  路  Source: OpenOrienteering/mapper

Steps to reproduce

  1. Create new map file
  2. Load georeferenced template from attached archive (or any other georeferenced raster template
    created by SAS Planet)
  3. Select CRS in Map georeferencing window (tested with UTM and Gauss-Krueger)

Actual behaviour

  1. Fields _UTM zone_, _UTM coordinates_ and _Geographic coordinates_ are pre-filled with incorrect values.
  2. Pressing the button _Calculate_ UTM zone leads to values changing, but not to correction.

Expected behaviour

Fields _UTM zone_, _UTM coordinates_ and _Geographic coordinates_ are pre-filled with sensible values, as it taking place when loading GPX or OSM file.

Configuration

Mapper Version: 0.8.1 and fc9aa71efc838f9d8ebd26e71947363d0ed61c60 tested
Operating System: Linux and Windows tested

need more info

All 11 comments

Hi, I do not use SAS and do not see issue while loading a georeferenced template in geographic coordinates - and conversion into UTM mapper coordinates look good -.

The attached template is georeferenced, but Mapper does not know coordinate reference system of rectangular plane coordinates which are stored in georeferencing file and thus is not able to specify UTM zones correctly.
In other words coordinate reference system for your map project must be setup first and than you can add template with specification if the template is in the same coordinate system or in different.

Regarding the problem of reference point setup, there could be an option to retrieve the coordinates from the first opened template (in case when coordinates of reference point are set to 0,0).

It is true that the CRS must be chosen manually in this case, but it is not true that it has to be set up before loading the template. Setting it up while loading the first template will pre-fill the reference point also in case of image templates with a world file (based on a guess of whether the coordinates are projected or geographic and assuming that the map's CRS will match that of the image's world file in the former case), see the lines starting at https://github.com/OpenOrienteering/mapper/blob/e7bc56829754f4bcbed7ae36642f89afefbd4c9b/src/templates/template_image.cpp#L213

Probably Mapper should inform the user better about what has been set and what needs to be adjusted in this case though. For example, by adding a simple static text at the top of the georeferencing dialog when it is shown in this context, saying something similar to "Projected coordinates of the reference point have been pre-filled with the image's center coordinates. If you would like to use them, you have to set up the map's CRS to match the image's CRS."

Thinking about it, I would prefer to step down from introduction of such semi-automated behaviour.

  1. Most of the users are not well educated about CRS and basic settings in project.
  2. Quite often people are mixing basemaps from different sources using different CRS. This can be confusing for initial setup.
  3. Setting up CRS first is standard process in most of the GIS software.

I observe that the ref point can be set up from UTM to any other system without iteration, but, needs to be set up iteratively from geographical coordinates to UTM, even manually.

@puzzlepaint
... And consequently, I guess "mapper/src/templates/template_image.cpp" is not the most relevant part of code to look at. Somewhere related to menu>map>georeferencing.

Fields UTM zone, UTM coordinates and Geographic coordinates are pre-filled with incorrect values.

Note that Mapper is using the world file. The world file provides nothing but the transformation of pixels to (some) projected coordinates. It doesn't tell us the CRS. That's why Mapper cannot know geographic coordinates or grid zone, and preselects "Local" coordinates. If you select the data's CRS (EPSG:3785), you will immediately get correct geographic coordinates, but if you coose another CRS, you in fact ask for wrong georeferencing of the image.

In the future I want to use GDAL also for raster templates, and then we might use more sources of image georeferencing (.prj file, GeoTIFF etc.), and/or "gdalwarp" raster images to the CRS used by the map. However, our template source code needs quite some work to make it more understable, maintainable and extensible.

I observe that the ref point can be set up from UTM to any other system without iteration, but, needs to be set up iteratively from geographical coordinates to UTM, even manually.

I don't really understand what is meant here. If it is not related to raster images, it might need to go to a different issue.

If you select the data's CRS (EPSG:3785), you will immediately get correct geographic coordinates, but if you coose another CRS, you in fact ask for wrong georeferencing of the image.

Ok, Is the way to select data's CRS in the described workflow (when template opening before map CRS has been set)?

In case it is unclear, notice that selecting the data's CRS in the map georeferencing is really only necessary for using the pre-filled reference point. Selecting another CRS for the map will not directly lead to wrong georeferencing of the image, since after the map georeferencing dialog, another dialog is shown which asks for the data's CRS. It defaults to "same as map", but also allows for arbitrary other choices. This is where the data's CRS must be specified correctly.

I have the impression that there is a lot of confusion about georeferencing. Maybe it would help if the georeferencing dialog explained itself a bit more without having to study the manual (therefore my small suggestion above to show some help text in the discussed context).

@yevhenmazur Does this issue still exist?

Everything works very easy and intuitive now. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samlaminilepre picture samlaminilepre  路  7Comments

jan-gerard picture jan-gerard  路  7Comments

sfroyen picture sfroyen  路  6Comments

Symbian9 picture Symbian9  路  3Comments

IamShado picture IamShado  路  3Comments