Image orientation logic in Locus Map calibrator

40° shared this question 9 hours ago
Need Answer

Hello,

I have written an Android application for personal use that allows calibrating raster maps to GPS coordinates. My app can save a calibration profile in an XML format understood by the Locus Map calibrator (using the <photo> tag and a list of <point> tags), so I can quickly open these maps in Locus to get a calibrated map.

I have encountered an issue during import:
When loading the generated XML file into the Locus Map calibrator, the map image may load rotated by 90 degrees. Because of this, the calibrator's coordinate system does not match the coordinate system in which the <point x="..." y="..."> tags were recorded. As a result, the calibration and the image end up mismatched.

What I have checked:

  1. The original image has dimensions of 4608x3456 (width is greater than height).
  2. In the EXIF metadata, the Camera Orientation tag is set to "Orientated Correctly" (normal orientation, no rotation).
  3. Third-party applications and my app display this image strictly horizontally.

My question is:
Could you please tell me what algorithm or criteria the Locus Map calibrator uses to decide whether to rotate the loaded image? Does it rely on EXIF tags, the aspect ratio of the image (portrait/landscape), or the current orientation of the device screen?

I need to understand the logic so that my application can either recalculate the x/y coordinates before saving to XML, or save the image in the form that Locus expects to see it.

Thank you in advance for your answer.

Leave a Comment
 
Attach a file