﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
23303	Magnetic declination is not considered for drawing the image arrows on photos	rexendor@…	rexendor@…	"==== What steps will reproduce the problem?
1. Load geotagged images with direction in the EXIF
2. Click on a photo and check the arrow drawn next to it.
==== What is the expected result?
The drawn arrow should point in the correct direction of the photo taken.

==== What happens instead?
The arrow direction is offseted depending of the geolocation and the date because the magnetic north is not the true/geographical north on the map. ([https://www.ncei.noaa.gov/sites/default/files/2022-02/Miller%20Projection%20Main%20Field-%20Annual%20Change%20Declination%20%28D%29.pdf example offset map])

==== Please provide any additional information below. Attach a screenshot if possible.

The source file [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java#L528 geoimage/GeoImageLayer.java:528] should add the magnetic declination in order to have a correct geographical direction.

For example OsmAnd [https://github.com/osmandapp/OsmAnd/blob/fdb6570ebe6f7973032a61323591ecb4c3f94799/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java#L532C4-L532C4 adds the declination] by getting it from android.hardware.GeomagneticField, which uses a downloaded model for the calulation (like https://www.ngdc.noaa.gov/geomag/calculators/magcalc.shtml ). 

JOSM should use a similar offline model or query the values from a public api based on the photo time and gps coordinates.


{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-08-29 13:38:40 +0200 (Tue, 29 Aug 2023)
Revision:18822
Build-Date:2023-08-30 01:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18822 en) Linux Debian GNU/Linux trixie/sid
Memory Usage: 334 MB / 4096 MB (179 MB allocated, but free)
Java version: 17.0.9-ea+6-Debian-1, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 3840×2160 (scaling 1.00×1.00)
Maximum Screen Size: 3840×2160
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: en_US
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: XFCE
Java package: openjdk-17-jre:amd64-17.0.9~6ea-1
Java ATK Wrapper package: libatk-wrapper-java:all-0.38.0-1
libcommons-compress-java: libcommons-compress-java:all-1.22-1
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:all-20201225-1
VM arguments: [--module-path=/usr/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djava.net.useSystemProxies=true, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED]

Plugins:
+ FastDraw (36126)
+ HouseNumberTaggingTool (36178)
+ ImportImagePlugin (36184)
+ Mapillary (2.2.0)
+ PicLayer (1.0.3)
+ RoadSigns (36126)
+ apache-commons (36176)
+ apache-http (36176)
+ buildings_tools (36178)
+ ejml (36176)
+ geotools (36176)
+ imagery_offset_db (36126)
+ jackson (36176)
+ jaxb (36118)
+ jna (36176)
+ jts (36004)
+ log4j (36176)
+ measurement (36126)
+ photoadjust (36188)
+ reverter (36126)
+ tageditor (36126)
+ turnlanes-tagging (0.0.5)
+ turnrestrictions (36178)
+ undelete (36126)
+ utilsplugin2 (36178)

Tagging presets:
+ https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/HU.zip

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/HU-HighlightHikingTrailSigns&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/FixmeAndNote&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
+ /tmp/elemstyles-bigfont.mapcss

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/OSMLint&zip=1

Last errors/warnings:
- 00004.679 E: Failed to locate image 'traffic_signs/HU/HU_C-031.png.png'
- 00004.680 W:  No overtaking: Could not get presets icon traffic_signs/HU/HU_C-031.png.png
}}}
"	defect	needinfo	minor		Core image mapping	latest		template_report	
