Search This Blog

Friday 8 January 2016

Use maps and sensors in your phone as one tool with the help of OpenWebGIS



Now, many phones, smartphones, tablets and so on (your mobile devices) have accelerometers, gyroscopes, magnetic field sensors, light (illumination) sensors, pressure sensors, etc. Data from these sensors is used in various applications for Android (hereinafter, it will be written about the use of sensors in the operating system Android). For different purposes, it may be useful not only to get (detect the parameters changes) the sensor output at any time, but to collect them during a large period of time with the reference to the space (map). For example it will be interesting to measure the illumination of the night streets in your city block, then interpolate these data and mathematically determine places where it is necessary to add a street lamp, or identify places where there is more magnetic field strength. It may be interesting to follow the direction change of your phone in space and in time according to cardinal points or follow your phone rotation angles according to the axes (x, y, z), for example so you can determine the moments when the phone is next to your ear during a call.

You can collect sensor data and refer them to the geographical coordinates in OpenWebGIS. To do this, first turn on geolocation of your device . Then you need to run on your device OpenWebGIS version for Android, after that select in the first window - local version (see Figure 1).

Figure 1 - Run on your device OpenWebGIS version for Android, after that select in the first window - local version
Then click on the button at the top right corner of the map (see Figure 2), then a window will appear with the settings geolocation.
Figure 2 - Click on the button at the top right corner of the map to get geolocation settings

Set the desired time «Updating in seconds» and click on «start» button. After that, new layers will be added to the list of layers. Points and a track of your movements will be added to these new layers. The additional popup window will also appear, which will show and update geolocation information and sensor data - light (illumination), magnetic field and temperature (see Figure 3), and other sensors outputs will be added to the attributes of the respective layer (see Figure 4). In these figures the sensors data is given as an example but is not real.
Figure 3 - The additional popup window shows and updates geolocation information and sensor data

Figure 4 -All data recorded at each point is added to the attributes

All data recorded at each point, you can see if you select Layer's name ("MyLocation" - in our case) in the dropdown list "Editable Layer". Then click (on the map) on the point you are interested in. The values of all attributes of the point you can see by hovering the cursor over it and clicking on it (if while hovering over a feature, it is not activated, then move the map a little bit and then again hover the cursor). After clicking on the feature you are interested in , the pop-up window will be opened. In this window you will see all layer attributes (see Figure 5).
Figure 5 - After clicking on the feature (point) you are interested in , the pop-up window will be opened
There is another way to see all data: if you open the attribute table using the menu item "Edit-> Open attribute table" (see Figure 6).
Figure 6 -Open the attribute table using the menu item "Edit-> Open attribute table"


Figure 7 - Result of interpolation of collected illumination data
At the moment in OpenWebGIS you can automatically collect data of the following sensors: accelerometer, gyroscope, light, temperature, magnetic field, pressure, rotation vector. The presence or absence of any of these sensors is determined by OpenWebGIS automatically.
The information about the sensors that Android supports, the Android sensor framework, units of measurement and axes (x, y, z) orientation that's used by the Sensor API can be found here:
http://developer.android.com/guide/topics/sensors/sensors_overview.html

Android version of OpenWebGIS is created for operating system Android version 4.4 and later. Speed of motion is determined only if the geolocation is set via GPS.

The source code of OpenWebGIS for OS Android can be downloaded from GitHub here.

Ready to use Android apk file for your mobile devices is available from GitHub, for  downloading at Itch.io, Google Drive, Mobango.com and also at other app stores. Last new version always for your mobile devices is available for downloading at itch.io , Google Drive, GitHub.

The OpenWebGIS blog and full list of articles about OpenWebGIS provide a lot of information about possibilities of OpenWebGIS.

Please test and report bugs or suggestions for improvement.



2 comments:

  1. This was really an interesting topic and I kinda agree with what you have mentioned here
    facebook

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete