Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to be able to fill a form and, before, during or after, be able to cath a GPS point. I already know the GPS extension but I have to catch the point and enter attributes after... Idea how I can do that?

Martin F

share|improve this question
add comment

2 Answers

view->panels->gps info

to toggle the live gps tracking tool.

Connect your GPS to QGIS and be sure to have it connected also to the satellites. At this point you should see in the canvas your position.

Load any vector layer and toggle editing, then just hit "add feature" in the gps info panel, and you will add a point/line/polygon (using the GPS position/track) in your layer (and of course it will pop up the dialog asking for attributes).

share|improve this answer
    
Giovanni Yes, I know that. But supposed that I built my own form (QT4). I want to be able to enter attributes "before" catch the GPS point. I think that QGIS is not the right tool for that (my team is in a truck and want to enter data before arriving on the point to take) –  Martin F Aug 13 '12 at 15:32
add comment

Martin,

Since QGIS's feature forms require (I think) a feature to exist before you can write to its attribute table (GPS location data) or define the feature's geometry, you can take the following approach as a possible solution:

  • QgsGPSConnectionRegistry class is available via the QGIS API.
    Note: the GPS classes were just added today to the docs and should show up on that page after tonight's automated 'nightly' build. Though the API docs are for the current development 'master' branch, the API calls should work with QGIS 1.8.0.
  • If a GPS has been verified via the live tracking tool, it's QgsGPSConnection should be available via Python in the QgsGPSConnectionRegistry.
  • QgsGPSConnection::currentGPSInformation() function will provide you with QgsGPSInformation, which contains the current lat/long from your GPS. You can use this to update an existing point feature's geometry (i.e. location).
  • Create a custom feature form that is extended with some Python logic attached to a Qt button that will update the selected (or new) point feature's location with your GPS's location info. See NathanW's blog post for info on extending the form with Python.

The solution would work like this:

  • Before arriving: you create a temporary point (maybe close to anticipated capture location) and fill out its form. When you get to the capture location, use the Identify tool and click on the temporary point, thereby allowing you to update it location with current GPS location via your custom edit form. If you also had another data column that signified it was a temp point, you could use Rule-based symbology to mark it with a different symbol. Updating the location with GPS info could also clear that temp field, and update the symbol with a 'captured' one.
  • During: same as above, but just update with GPS location as you fill out the form.

Assuming this solution actually works (not tested in any way), it could also be made into a PyQGIS plugin. Or, you could start with the plugin approach.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.