TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: FELIX on September 07, 2019, 11:26:11 PM

Title: Magnetic Declination
Post by: FELIX on September 07, 2019, 11:26:11 PM
Any reference on how to get the magnetic declination and annual variation of a geographical point?
Title: Re: Magnetic Declination
Post by: VovKa on September 08, 2019, 12:57:09 PM
i want to calculate it yourself or just get it from the remote source?
Title: Re: Magnetic Declination
Post by: FELIX on September 08, 2019, 02:26:48 PM
By remote source already solves me.

If I can calculate and it's simple, I'm interested too.
Title: Re: Magnetic Declination
Post by: VovKa on September 08, 2019, 05:21:33 PM
there's the program with the source code https://www.ngdc.noaa.gov/geomag/geom_util/gmpole.shtml
it calculates only the position of geomagnetic pole (no declination)
and it does not look simple at all
Title: Re: Magnetic Declination
Post by: FELIX on September 08, 2019, 07:41:50 PM
This URL return the two values I need (magnetic declination and annual variation). Can you make the program call of this calculator?

https://www.ngdc.noaa.gov/geomag/calculators/magcalc.shtml

(https://www.dropbox.com/s/oc87m5lr557qzoz/Sem%20t%C3%ADtulo.png?dl=0)

Title: Re: Magnetic Declination
Post by: FELIX on September 08, 2019, 10:47:45 PM
Got it:

Code: [Select]
(SETQ XML (vk_ReadXML (STRCAT "http://www.ngdc.noaa.gov/geomag-web/calculators/calculateDeclination?lat1=" (RTOS LATGR1 2 8) "&lon1=" (RTOS LONGR1 2 8) "&resultFormat=xml")))