Giter Club home page Giter Club logo

interactive_map_tracking's Introduction

##interactive_map_tracking A QGIS 2.6 plugin to track camera of user , AND/OR to autocommit/refresh edit on PostGIS vector layer This QGIS 2.6 plug-in has been developed by Lionel Atty from IGN (France).

Go to the project wiki for more information !

This plug-in was designed to allow concurrent editing awareness or history of editing (tracking), and to enable QGIS to play well with PostGIS database using trigger to reconstruct geometry on the fly ###feature This plug-in add 2 features to QGIS, the user choose what feature he uses

You can see a short video of demos : Demo on video

####tracking the position

  • each time the user change its position on QGIS map canvas, the screen rectangle is saved along with a user id and a timestamp. That is, if the user zoom level is compatible with edition (parameter)
  • with correct QGIS styling, this enable to see :
    • where the other users are editing so two people won't hopefully edit the same area
    • where the other users (and self) were editing, so an user won't come and edit the same area twice
  • Moreover, this tracking data can be analysed to produce :
    • a map of editing time (gives the place where editing was short/long)
    • Reliable stats on editing time and area edited per user, which is essential in a benchmark

####autosave and refresh after an edit

  • QGIS uses a sophisticated Do/Undo mechanism with a delayed writing system. However, when working with a data base that generates geometry on the fly (trigger), it is essential to commit each change immediately.
  • The plug-in does exactly that : each modification (geometry or attribute) is saved immediately to the layer, and the canvas is re-rendered.
  • this instantaneous commit allow to create new user interaction that are within the database, as opposed to be within QGIS. Thus, this interactions can be used in other GIS software, and can be much more complex.

This work was partly supported by Agence Nationale de la Recherche Grant ANR-12-VBDU-0002-09 (TrafiPollu project), and by Thales Training & Simulation SAS within FUI project TerraMobilita. The result of this works is under the co-property of IGN and Thales Training & Simulation SAS

interactive_map_tracking's People

Contributors

attylionelign avatar remi-c avatar yoyonel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

interactive_map_tracking's Issues

Avoid saving a track (TrackingPosition) when we modify a layer (AutoSaveRefresh)

The problem comes from our current approach to refresh the map (epsilon zoom on MapCanvas) that provoke a canvaxextentChanged and launch the tracking.
To avoid this, i add a filter on the actual extent (to save) and the last committed.
If layers are different (with a proper epsilon value), we continue the tracking process else we cancel the tracking.

tracking : error when switching srs while tracking on shapefile

To reproduce :

  • create a tracking shapefile in WGS84 (4326)
  • track some geometry
  • set threshold to 1
  • track more
  • change shapefile SRS to IGNF:LAMB93
  • track
    --> produce the error message

error is :
``Traceback (most recent call last):
File " \interactive_map_tracking\interactive_map_tracking.py", line 505, in canvasExtentsChangedAndRenderComplete
self.update_track_position()
File " \interactive_map_tracking\interactive_map_tracking.py", line 752, in update_track_position
list_points = [xform.transform(point) for point in list_points_from_mapcanvas]
QgsCsException: Poursuivre la transformation de
(-24479.530208, 57767.106935)
PROJ.4: +proj=longlat +datum=WGS84 +no_defs +to +proj=lcc +nadgrids=@null +a=6378137.0000 +rf=298.2572221010000 +lat_0=46.500000000 +lon_0=3.000000000 +lat_1=44.000000000 +lat_2=49.000000000 +x_0=700000.000 +y_0=6600000.000 +units=m +no_defs
Erreur: latitude or longitude exceeded limits`

logging of web-related action is always written to LOG

Hey @yoyonel , a small bug , but very important (it negates all the work on V2 ! )
the log for web related GUI is not concerned by main switch.
It appears in the Main loggin tab, the log chekc box being crossed or not.
Example of log :

2015-03-03T21:44:58 1   ### width : 1080 - height : 768
2015-03-03T21:45:00 1   ## Tab : About
2015-03-03T21:45:00 1   #last_state : 1
2015-03-03T21:45:00 1   ## WebView : OK
2015-03-03T21:45:00 1   ### width : 1024 - height : 768

develop shows error

Error when activating hte extension in qgis 👍

Traceback (most recent call last): File "C:/PROGRA~1/QGISBR~1/apps/qgis/./python\qgis\utils.py", line 217, in startPlugin plugins[packageName].initGui() File "C:/Users/Remi/.qgis2/python/plugins\interactive_map_tracking\interactive_map_tracking.py", line 290, in initGui self.init_plugin() File "C:/Users/Remi/.qgis2/python/plugins\interactive_map_tracking\interactive_map_tracking.py", line 377, in init_plugin QObject.connect(self.dlg.threshold_extent, SIGNAL("returnPressed ()"), self.thresholdChanged()) TypeError: arguments did not match any overloaded call: QObject.connect(QObject, SIGNAL(), QObject, SLOT(), Qt.ConnectionType=Qt.AutoConnection): argument 3 has unexpected type 'NoneType' QObject.connect(QObject, SIGNAL(), callable, Qt.ConnectionType=Qt.AutoConnection): argument 3 has unexpected type 'NoneType' QObject.connect(QObject, SIGNAL(), SLOT(), Qt.ConnectionType=Qt.AutoConnection): argument 2 has unexpected type 'str'

Tracking : trying to set attributes of selection desactivate tracking

how to reproduce :

  • start tracking a postgis layer
  • select a set of tracked camera
  • try to update the user_id field of the selected camera
  • it will do nothing
  • now the tracking is supposed to be activated, but it does nothing (more exactly, it tries to do something, but nothing happen)
  • More important, even saving/closing qgis won't solve the problem, we have to add the tracking layer again to start fresh

infinite loop in web display when offline

BUG :
when offline, rapidly switching from one tab to the oter mutliple times starts an infinite loop,
with messages :

2015-03-05T15:16:00 0   webview_loadFinished - #last_state : offline
2015-03-05T15:16:00 0   webview_loadFinished - ## WebView : FAILED TO LOAD
2015-03-05T15:16:00 0   webview_loadFinished - #last_state : offline
2015-03-05T15:16:00 0   webview_loadFinished - ## WebView : FAILED TO LOAD
2015-03-05T15:16:00 0   webview_loadFinished - #last_state : offline
2015-03-05T15:16:00 0   webview_loadFinished - ## WebView : FAILED TO LOAD
2015-03-05T15:16:00 0   webview_loadFinished - #last_state : offline
2015-03-05T15:16:00 0   webview_loadFinished - ## WebView : FAILED TO LOAD
2015-03-05T15:16:00 0   webview_loadFinished - #last_state : offline
2015-03-05T15:16:00 0   webview_loadFinished - ## WebView : FAILED TO LOAD

error with proxyon develop branch

Hey,
here is the error
Impossible de charger l'extension interactive_map_tracking provoque une erreur lors de l'appel de sa méthode classFactory()

Traceback (most recent call last):
  File "C:/PROGRA~1/QGISBR~1/apps/qgis/./python\qgis\utils.py", line 208, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/Remi/.qgis2/python/plugins\interactive_map_tracking\__init__.py", line 35, in classFactory
    return interactive_map_tracking(iface)
  File "C:/Users/Remi/.qgis2/python/plugins\interactive_map_tracking\interactive_map_tracking.py", line 253, in __init__
    proxy.setHostName(proxyHost)
UnboundLocalError: local variable 'proxy' referenced before assignment

(optional) playing flash video in plug GUI doc tab

Proposition of improvement, it is clearly a non necessary stuff, but it could be a cool trick to know for you @yoyonel .
the main page of doc (User guide) includes a youtube video, in flash.
Currently, the plugin GUI doesn't display it.
It would be super cool to have video in plugin,
and it seems to be feasible :

QWebSettings().PluginsEnabled = True

Change plugin GUI

Small cosmetic changes :

  • v2 by default activated, change name for "Asynchronous tracking commit (smoooth)"
  • Add 2 tabs :
    • Tab "About", with correct credit
    • Tab "User Doc", displaying basic html with images (simplified "User Guide" of our wiki)

Work dispatchment :

  • @yoyonel GUI change in code
  • @yoyonel Check that is it is possible to display simple html in the User doc
    then
  • @Remi-C write simplified UserGuide in html, with images

error in develop, when tracking

Here is the error
Simply zoom in to reproduce

Traceback (most recent call last): File "C:/Documents and Settings/T0111151/.qgis2/python/plugins\interactive_map_tracking\interactive_map_tracking.py", line 589, in canvasExtentsChangedAndRenderComplete self.update_track_position() File "C:/Documents and Settings/T0111151/.qgis2/python/plugins\interactive_map_tracking\interactive_map_tracking.py", line 938, in update_track_position "\tThreshold size= " + str(threshold)) NameError: global name 'threshold' is not defined

add a buton in tracking to autoamtically create a in-memory tracking layer

This is a pure enhancement,
for futur realease.

The idea is that starting from 2.8, it is possible to create in memory vector layer.
Now it could be very useful to propose to the user to directly create a tracking layer with correct user_id and w_time, so it would be a one click operation to start tracking in a mono-user mode.

Refactoring Code : Signals Manager

Refactor code
Section : Signals Manager

Help to :

  • clean code
  • increase robustness
  • increase readability (for comprehension, help debug, ...)

tracking : Error when srs=4326 and threshold is low

To reproduce :
create a shapefile of type polygon with user_id::text and w_time::text
Set the shapefile srs to 4326 (WGS84).
WGS84 unit is not meter but degree.

Setting the threshold to 1 or 0.1 or 0,1 slow down conserably the plugin,
finally freezing qgis with one CPU fully occuped.

Tracking : GUI : select in list does nothing

branch Develop
CRITICAL :
when having 2 possible layers for tracking (one shape, one PostGIS)
We can select the correct layer in the list.
In the log it correctly show the selected layer.
BUT : the update happen to first layer

Refactoring Code : Auto-Save

Same 'spirit ' than # 43
Some works for extract Auto -Save feature and lighten the labor component script file ( interactiv_map_tracking.py )
This work/issue help end to increase readability and robustness

Edit dev doc to a minimal level

The dev doc should be at a minimum level before releasing to first version milestone@"Release 1.0"
This include

  • a little bit of high level dev doc (principle of each feature implementation, pointer to most important functions)
  • a little bit of issue specific doc, that is explain what was tried but unsuccessful.

big memory leak with QWebView

On Win or Linux :
the memory consumption is increasing when swithcing between tabs.
To reproduce :

  • go in the doc tab
  • note qgiis memory usage
  • click on video , this will open youtube
  • note qgis memory usage
  • switch tab, open again the doc tab
  • note the qgis memory usage

It seems that some of the memory is cleaned, but not all of it.
Maybe there is a cache mechanism in QWebViewer

AttributeError when attempting to initialize dialog UI

Plugin failed to start after QGIS restart:

2017-11-28T15:18:27  1 Traceback (most recent call last):
       File "C:/OSGEO4W/apps/qgis/./python\qgis\utils.py", line 334, in startPlugin
         plugins[packageName] = package.classFactory(iface)
       File "C:/Documents and Settings/ti2/.qgis2/python/plugins\interactive_map_tracking\__init__.py", line 34, in classFactory
         from .interactive_map_tracking import interactive_map_tracking
       File "C:/OSGEO4W/apps/qgis/./python\qgis\utils.py", line 608, in _import
         mod = _builtin_import(name, globals, locals, fromlist, level)
       File "C:/Documents and Settings/ti2/.qgis2/python/plugins\interactive_map_tracking\interactive_map_tracking.py", line 28, in <module>
         from interactive_map_tracking_dialog import interactive_map_trackingDialog
       File "C:/OSGEO4W/apps/qgis/./python\qgis\utils.py", line 608, in _import
         mod = _builtin_import(name, globals, locals, fromlist, level)
       File "C:/Documents and Settings/ti2/.qgis2/python/plugins\interactive_map_tracking\interactive_map_tracking_dialog.py", line 29, in <module>
         os.path.dirname(__file__), 'interactive_map_tracking_dialog_base.ui'))
       File "C:\OSGEO4W\apps\Python27\lib\site-packages\PyQt4\uic\__init__.py", line 210, in loadUiType
         winfo = compiler.UICompiler().compileUi(uifile, code_string, from_imports, resource_suffix)
       File "C:\OSGEO4W\apps\Python27\lib\site-packages\PyQt4\uic\Compiler\compiler.py", line 139, in compileUi
         w = self.parse(input_stream, resource_suffix)
       File "C:\OSGEO4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py", line 992, in parse
         actor(elem)
       File "C:\OSGEO4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py", line 890, in readResources
         for include in elem.getiterator("include"):
       File "C:\OSGEO4W\apps\Python27\lib\xml\etree\ElementTree.py", line 486, in getiterator
         PendingDeprecationWarning, stacklevel=2
       File "C:/OSGEO4W/apps/qgis/./python\qgis\utils.py", line 78, in showWarning
         message = unicode(str(message).decode('cp1250'))
       File "C:\OSGEO4W\apps\Python27\lib\site-packages\future\types\newstr.py", line 330, in __getattribute__
         raise AttributeError("decode method has been disabled in newstr")
     AttributeError: decode method has been disabled in newstr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.