mapper icon indicating copy to clipboard operation
mapper copied to clipboard

Magnetic declination lookup button does not work (NOAA added a key)

Open rem-maps opened this issue 3 years ago • 1 comments

Steps to reproduce

  1. New file with georeferencing UTM 32N 44.6641 10.7893
  2. Declination lookup button
  3. Browser result: Bad request, check your key

Configuration

Mapper Version: 0.9.5

NOAA added a key for the request to be valid so the Mapper path is no longer OK

viewing the html page source of https://www.ngdc.noaa.gov/geomag/calculators/declinationForm.shtml I found this variable to be added to the path key=zNEw7

so using the previous coordinates:

PATH coming from Mapper (not working anymore): https://www.ngdc.noaa.gov/geomag-web/calculators/calculateDeclination?lat1=44.6641&lon1=10.7893&startYear=2022&startMonth=9&startDay=9&resultFormat=html

PATH with the same coordinates and the new key - that is actually working: https://www.ngdc.noaa.gov/geomag-web/calculators/calculateDeclination?key=zNEw7&lat1=44.6641&lon1=10.7893&startYear=2022&startMonth=9&startDay=9&resultFormat=html

On their page https://www.ngdc.noaa.gov/geomag/calculators/magcalc.shtml it is written "Registration is required to access this service. Please register using the API registration link on the top right" But right now it is possible to use the service without registration and this key=zNEw7 comes out automatically when you push the Calculate button

I tried to get all info I could and I hope this is useful and can give a hint to start debugging, but bear with me I'm no expert so I have no idea if the key is fixed or changing or whatever :-) and even if adding this key to our path is allowed.

rem-maps avatar Sep 09 '22 17:09 rem-maps

Remo, thank you for analyzing and reporting this issue.

I assume that you need to register to use the API functionality, which is something that Mapper doesn't use. As long as anyone can use the web page to request declination information without registration, I see no problem for Mapper to use the same mechanism as well. The value of zNEw7 is not a secret and thus can be used of course by Mapper. It might be changed of course in the future and if this happens to often we need to react, e.g., by making it configurable.

dl3sdo avatar Sep 10 '22 13:09 dl3sdo