-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: geologic compass #1882
Comments
This has been accepted as an enhancement request. Good job 👍 Enhancement requests are very valuable to make QField better. They sometimes attract others and just happen magically. More often however they need someone to jump in and make them come true. |
this is great, thank you. I (and everyone I convert from ESRI and/or paper) use QField daily for geologic mapping and surveying, and this would be a very useful feature. |
dont want to be a wisenheimer, hope this could be useful: https://x-io.co.uk/open-source-imu-and-ahrs-algorithms/ and https://ahrs.readthedocs.io/en/latest/ |
I would also appreciate very much this feature (which would be a good reason for me to switch from FieldMove to QField). Not sure this is a very constructive comment but if it helps to show user support... |
Hi r-gibs,
It's actually only partially true, and totally more complex. As we both know a plane is perfectly defined in terms of dip direction / dip, which is indeed a line. But there are differences, both in measurement and in notation. In terms of taking the reading, when you measure a line you need to align some reference of your device (probably the long axis) with the linear feature. I presume the device then records its orientation (from the compass), and its inclination (from the tilt-meter) along the relevant axis, which are your trend and plunge. So if you have access to sensors, that's trivial. In some cases it makes sense to link the line and the plane: think of a fault with slickenslides (probably recorded as pitch in this case), or a foliation+lineation is a SL fabric rock (your will probably record the L as trend/plunge). In these cases the L and the S should be measured concurrently, to ensure that the line belongs to the plane geometrically (again, a concept my 2nd years struggle to grasp...). In terms of recording the data, now there are different conventions, which would be useful to implement for different users and/or use cases:
If you are curious, I'm attaching my current database that demonstrates these constrains and options on the "observations" layer. Have a look at the form, and what happens if you create a new observation. As you say, what it lacks now is a "fill from compass" button at the bottom of the form (blue placeholder...). (by the way, the form is live - see what happens if you type strike or dip - but I'm not sure I understand why it works, as I have the warnings that I cannot use fields in default values. I'm happy like that but I just hope it's not just implementation specific and will go away with the next update). |
Hi jfmoyen,
and 2) the angle of the x axis ("GRAVITY_X_ANGLE" in the script). The only thing one has to do when measuring lineaments is aligning one side of the phone/tablet on the linear to be measured, and rotating the device on this axis until the value = 0, meaning the device is aligned horizontally on the short axis. When aligned this way the values for dipdir and dip are correct for that linear feature. This is exactly the same procedure like measuring a linear feature with a breithaupt compass. the question of the used notation is independent from all that, this can be calculated from the measured values afterwards. what would be more important is to save the date / time / location to every measurement to execute true north corrections afterwards. The necessary correction should of coure be build in the app but the uncorrected raw data should be saved too. Here the used correction values must be saved also for reproducibility. Attached my experiment script for illustration the above written for use with a device with magnetometer and gravity sensor. install the app "droidscript", remane the attached .txt to .js and load that file and run it. Consider the script as a naive experiment for illustration purpose only. this script is not be usable in the field because a lot of useful things are not implemented (sensor drift compensation, no gyro info implemented etc etc). |
Hi keinadmin (Lukas ?), Thanks for the script, it is quite nice indeed. I would perhaps take a slightly different approach, by combining gravity_x and gravity_y (if I read your code properly) to get the orientation of the gravity vector relative to the device (= i.e., the pitch of the device) and do a bit of trig to extract the dip dir out of that. In my view this has the benefit (i) of allowing to measure a plane just by laying the device on the surface, with no need to orient it further (lazy !) and (ii) more critically perhaps, to measure a line and a plane without moving the device, thereby ensuring that geometric consistency (i.e. the line is guaranteed to belong to the plane, which is a desirable feature when you do e.g. paleostress on faults). This highlights, however, a possible key problem here: we are thinking of an interface that suits our specific needs and ways of recording field data. Now, one great feature of Qfield is that we are not tied to one way, we can organize our project the way we want it. I do not think QField developers will be wanting to develop something very specific to one use-case (nor should they). So we do not need so much an interface or way to organize the data - we need tools to allow everybody to develop one (well, everybody with some understanding of coding etc., granted, but frankly I doubt anybody who doesn't will be using the attribute form editor, default values and such like anyway). Let's face it, a geological compass is a niche, unlikely to be a priority. On the other hand, a "low level" solution may be easier to implement (without the hassle of writing the GUI), and useful for a larger user base. Of course the down-side is that it would leave more work to the end user to customize and integrate it into his/her workflow. I can see a couple of ways to enlarge "our" problem (a geological compass) to make it general enough to be worth developing - QField developers, it would be great if you could jump in the conversation at that stage and tell us what you think is feasible, realistic, desirable etc. !
Armed with that, it would be not to difficult to add a default value to your table, along the lines of "strike" = atan(@gravity_x/@gravity_y) [I did not check the trig, but it should be something like that]. So the moment you'd create a point, by default QField would populate it with the current compass readings (you can always overwrite the defaults, remember...). Interestingly, this may be a valuable option for other use cases. A bee keeper, for instance, may be interested in monitoring the noise level around the hives and use @noise_level in a table !
Then, everybody would be able to develop scripts suiting the individual use cases. keinadmin's example being a sound basis for one. So in summary, my two suggestions/feature requests would be
Best, Jeff PS- Brunton or Breithaupt? ;-) |
Hi Jeff, |
Oh, python and js are not that different, porting the code shouldn't be too difficult (famous last words). Returning to the topic, how much of the complexities re. magnetic field, rotation etc. are left to be dealt with by the user, and how much are already managed at device level ? When your device returns, say, an orientation (and droidscript gives an example of this, by the way: CreateSensor("Orientation") ), has all the pre-processing been done already behind the scenes ? |
when implemented properly everything runs behind the scenes. the goal is find good algorithms for calculating the "orientation" value. By the way, i even dont't know if madgwicks algorithm is perfect for this - i assume. Perhaps there are better solutions? |
The goal is to get good orientation values for a variety of devices out there and the variety of build in sensors. You have lots of different stuff and you have to find a way to deal with that properly - eg as mentioned above the sensor drift is a proplem one has to deal with. it needs some technical skill and understanding of electronics to find a good solution. |
Yes, I see your point. I was hoping, naively it would appear, that the correction algorithms were dealt with at lower level, in such a way that the user would be served a "reliable" value (i.e. one already corrected for drift, and so on) through whatever API (s)he is using... Apparently such is not the case, which adds another layer of complexity to the whole story ! |
If you choose a good algorithm the things should run behind the scenes. this thing must deliver good orientation values. the point is, that one could calculate this himself with the raw (low level) sensor data in qfield as an intermediate level. The goal is only HOW to calculate these values. This approach must be watertight and bulletproof and must work best for a variety of devices - and this on the whole earth! As mentioned this is no trivial task and needs understanding in the behaviour of electronic sensors and lots more. On TOP of that we then can calculate our orientation(z) x gravity (z) or whatever we want with highlevel operations also in qfield. PS: -) Have also a look at the ahrs library if you want to https://ahrs.readthedocs.io/en/latest/index.html# -) We still have our good old analog compasses and dont have to deal with all the above stuff if we dont want to :-) I hope this helps in some way |
Interesting reading indeed, many complexities I was woefully unaware of ! I digged a little bit further along this line. It seems to me that Android is already doing the AHRS calculations before serving the value to the user: So you should be downstream of this point the moment you call the API. That is, if you call orientation sensor, apparently a virtual sensor combining the input from two physical ones. You can still call the magnetometer and accelerometer and do the calculation yourself. I have no experience with Apple but apparently it is also doing that, probably even better if anything. However: ... suggesting, amongst other things, that one of the issue is noise and sensor fluctuation, and that you want to average your reading for a period of time. |
Just another voice chiming in to say that I too would be interested in these features. Of course since most qfield users aren't geologists I don't expect qfield to implement a geological compass, but the idea (described above) of being able to get as @ tags some of these orientation values from the system (hopefully after android/iOS has already cleaned them up in some way) or other phone sensor values in project fields would be great for using the phone as a geological compass or using it to record topographic shielding, etc. I I guess the reliability of the sensors in smartphones is variable (c.f https://doi.org/10.1016/j.jsg.2017.02.015) but nevertheless it would be useful especially when you don't have enough geological compasses to go round or not all the participants are trained to use geological compasses. |
I certainly would not use a smartphone for any "serious" structural work - something that would require precise measurements, good statistics, and so on. However I find it perfectly satisfying for regional mapping, students field camps or my own field work when I'm basically after a foliation attitude more than exact paleostress, for instance. It's also great when hiking with the kids, to take a quick reading of something you see on the way without actually stopping and pulling your notebook out :-) Lastly - and this is where Qfield comes into the picture- it saves one rather tedious step, copying your notebook into some computer format to go to GIS. Saving the measurements directly in numeric form is actually great. Still, even then, I would not get out without my compass. 10% of the time perhaps, I get a completely bogus reading, for no immediately obvious reason (they can range from a nearby powerline, to me having kept my hammer in the same hand, to me "locking" the measurement at the wrong time, to compass calibration....). Returning to the topic of new features, the more I think about it the more convinced I am that the right way would be to allow QField to access all sensors on the device (perhaps with a @tag, same as GNSS info). Since all sensors have a similar API and are all accessed by the same QSensor library, it would probably not be more difficult to implement all than one - and it would bring functionalities to more than geologists. |
You are very strict with your requirements Jeff. Besides the fact i know a couple of geologists who even don't make a north correction (strict south ahead) i would be fully stisfied if the thing has an accuracy of +-5°. Besides the fact that the size of the measuring area (phone vs tablet) has a big impact of the measuring result, geologic planes are usually never exactly planar in space and undulate/vary from bigger to smaller scale (at least where i live). |
Well, it's actually the opposite - I'm not a structural geologist, I'm perfectly aware of what I'm doing is not on par with proper structural work, and in any case I don't have enough interest in structures to take the trouble to assess how reliable my measurements are - so I rather err on the side of caution. Having said that, the paper I was citing a few days ago seems to conclude that a (good) smartphone produces results that are not worse than a compass. And yes I agree, in real life 1° accuracy is not serious, natural variation, irregular surface and what next mean that you are probably measuring within 5° (another reason why I was not too bothered by the compass issues we were discussing earlier in this thread). Which is my whole point I guess. With a mid-range Android smartphone and an app not fully optimized (as we may get in QField), you can probably not expect more than 5-10 ° accuracy, for all the reasons we have been discussing. If this acceptable for your purpose - great ! Go for it by all means. But if you require something more precise, shop somewhere else... PS- try ignoring North correction when you are working in Southern Africa -- Mag North is no less than 22° from True North ! That can seriously mess up your results... |
I am aware of the problems and the possible traps. By the way thanks for the Allmendinger et.al. manuskript . I've read it some time ago - a profound analysis and summary. I am very curious about the solution the qfield developers will implement :-) |
|
Hi Marco, I'm perfectly aware of that. Still the discussion has been instructive in that it helped to delineate what was feasible/desirable/realistic (and also prompted me to explore what was already there). To keep the discussion on topic, I'd like to make several suggestions/requests/comments (feedback welcome !):
Regarding option (a) - I can code some but I have no experience with android deployment, so I can help but hardly do it on my own (not in a time compatible with a full time job, anyway...). I've never done QML, too, but it seems simple enough. |
An estimate would be great - I'd happily donate to a crowdfunding campaign and spread the word - we might be able to persuade some oil/mining companies or universities to donate as well and speed up the process. |
I contacted QField about feature development several years ago and they thought estimated hundreds to thousands of euros (depending on format). An external sensor format might be the best option (like a separate app that QField grabs the strike/dip from). |
Nice. Please shoot us a mail to [email protected] |
I am a maintainer of Rockd, the app mentioned at the top here. Our compass works quite well and, since Rockd is a geology-focused app, it's a little more realistic for us to maintain a well-integrated compass than leaving it to the QField team. We've indeed spent hundreds to low thousands of dollars keeping the compass feature working in the last few years (as part of broader update costs). One path forward would potentially be to allow orientations collected on our structural compass to be easily exported to QField. We'd be open to making modifications to allow better cooperative mapping between apps. |
@davenquinn , we have implemented sensor handling capability to QField's upcoming 2.8 and QGIS 3.32. The three raw sensor types implemented ATM are: TCP socket, UDP multicast socket, and serial port (for windows & linux, not as interesting for mobile devices). It would be great to test out your geological compass app streaming values through TCP or UDP socket and caught by QField. Let me know if you need some help. |
The new version of QField (3.3) appears to allow plugins - hopefully this means a geological compass plugin can be made reasonably easily. |
As a geologist I measure the orientation of geologic features in the field as part of a standard geologic mapping workflow. Currently, I measure geologic features with a compass or separate app and manually fill in the attributes of a point "structure" layer. It would be nice if the tablet sensors (magnetometer and gyroscope) could be used to measure the orientation of structural features and record:
It would be helpful to have a functionality that allows me to take these measurements from within the attribute form using the tablet or phone sensors. I suggest an additional button / action on the attribute form of this layer that opens a dialogue and asks to align the phone along a planar feature and select "take measurement" once aligned, data can then be written to dip direction and dip attributes. Linear geologic features are measured differently than planar features, a "planar or linear" option could be included in the dialogue or a separate button / action could be used for linear features.
This feature should also prompt the user to recalibrate the compass when needed and specify if a magnetic declination was applied.
In an advanced version this dialogue should show a visualization of the structural measurement with a compass circle and dip / dip direction symbol along with numeric dip / dip direction attributes (see Rockd compass visualization screenshot below).
The text was updated successfully, but these errors were encountered: