magnetic declination - functions from qgis won´t work in Qfield #5759
Unanswered
Sickculture
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I´m a absolute beginner in QGIS and Qfield. Now at a starting point of a project I´m missing the expression for magnetic declination. So there is a plugin like "compass routes". It offers a function like to_magnetic to get the magnetic north bearing. In further searching I create a function in QGIS with calculation lat/lon with NOAA Url. It returns me the magnetic declination. But: it won´t work in Qfield, because Qfield won´t support functions. Is it possible to find another way to call the magnetic declination value?
here is the script from Comrade Che (https://gis.stackexchange.com/questions/486836/qgis-how-to-construct-a-declination-diagram/486845#486845)
import requests
import datetime
import pprint
def getDeclination(lat, lon, date=datetime.datetime.now(), model='WMM', result_format='json',
base_url=r'https://www.ngdc.noaa.gov/geomag-web/calculators/calculateDeclination', key='INSETR_YOUR_KEY_HERE'):
"""
For more info see https://www.ngdc.noaa.gov/geomag/calculators/help/declinationHelp.html
I call it with a line layer (geopackage) with eg. getDeclination(48,41).
Perhaps this can be done with an expression? Or I don´t know, but trigger oder javascript? I think, Qfield will understand trigger. What´s that? Found PostGreSQL Trigger???
Beta Was this translation helpful? Give feedback.
All reactions