Outdated version of the documentation. Find the latest one here.

` `

Módulo GPS

O que é o GPS?

GPS, the Global Positioning System, is a satellite-based system that allows anyone with a GPS receiver to find their exact position anywhere in the world. GPS is used as an aid in navigation, for example in airplanes, in boats and by hikers. The GPS receiver uses the signals from the satellites to calculate its latitude, longitude and (sometimes) elevation. Most receivers also have the capability to store locations (known as waypoints), sequences of locations that make up a planned route and a tracklog or track of the receiver’s movement over time. Waypoints, routes and tracks are the three basic feature types in GPS data. QGIS displays waypoints in point layers, while routes and tracks are displayed in linestring layers.

Note

QGIS supports also GNSS receivers. But we keep using the term GPS in this documentation.

Carregando dados GPS a partir de um ficheiro

There are dozens of different file formats for storing GPS data. The format that QGIS uses is called GPX (GPS eXchange format), which is a standard interchange format that can contain any number of waypoints, routes and tracks in the same file.

To load a GPX file, you first need to load the plugin. Plugins ‣ showPluginManager Plugin Manager... opens the Plugin Manager Dialog. Activate the checkbox GPS Tools checkbox. When this plugin is loaded, a button with a small handheld GPS device will show up in the toolbar and in Layer ‣ Create Layer ‣ :

  • importGPX GPS Tools
  • createGPX Create new GPX Layer

For working with GPS data, we provide an example GPX file available in the QGIS sample dataset: qgis_sample_data/gps/national_monuments.gpx. See section Sample Data for more information about the sample data.

  1. Select Vector ‣ GPS ‣ GPS Tools or click the importGPX GPS Tools icon in the toolbar and open the Load GPX file tab (see figure_GPS).
  2. Browse to the folder qgis_sample_data/gps/, select the GPX file national_monuments.gpx and click [Open].
../../../_images/loadgpx.png

The GPS Tools dialog window

Use the [Browse...] button to select the GPX file, then use the checkboxes to select the feature types you want to load from that GPX file. Each feature type will be loaded in a separate layer when you click [OK]. The file national_monuments.gpx only includes waypoints.

Note

GPS units allow you to store data in different coordinate systems. When downloading a GPX file (from your GPS unit or a web site) and then loading it in QGIS, be sure that the data stored in the GPX file uses WGS 84 (latitude/longitude). QGIS expects this, and it is the official GPX specification. See http://www.topografix.com/GPX/1/1/.

GPSBabel

Since QGIS uses GPX files, you need a way to convert other GPS file formats to GPX. This can be done for many formats using the free program GPSBabel, which is available at http://www.gpsbabel.org. This program can also transfer GPS data between your computer and a GPS device. QGIS uses GPSBabel to do these things, so it is recommended that you install it. However, if you just want to load GPS data from GPX files you will not need it. Version 1.2.3 of GPSBabel is known to work with QGIS, but you should be able to use later versions without any problems.

Importando dados GOS

Para importar dados GPS a partir de um ficheiro que não é ficheiro GPX, pode usar a ferramenta Importar outro ficheiro na janela das Ferramentas GPS. Aqui selecciona o ficheiro que que importar (e o tipo de ficheiro), que tipo de elemento quer importar, onde quer armazenar o ficheiro GPX convertido e que nome da nova camada irá ter. Tenha atenção que nem todos os formatos de dados GPS irão suportar os três tipos de elementos, portanto para muitos formatos apenas poderá escolher entre um ou dois tipos.

Transferindo dados GPS a partir do dispositivo

QGIS can use GPSBabel to download data from a GPS device directly as new vector layers. For this we use the Download from GPS tab of the GPS Tools dialog (see Figure_GPS_download). Here, we select the type of GPS device, the port that it is connected to (or USB if your GPS supports this), the feature type that you want to download, the GPX file where the data should be stored, and the name of the new layer.

../../../_images/download.png

A ferramenta de transferência

O tipo de dispositivo que seleciona no menu do dispositivo GPS determina como o GPSBbabel tentará comunicar com o seu dispositivo GPS. Se nenhum dos tipos disponíveis não trabalha com o seu dispositivo GPS pode criar um novo tipo (veja secção Definindo novos tipos de dispositivos).

A porta pode ser um nome de ficheiro ou outro nome que o seu sistema operativo usa como referência a uma porta física no seu computador no qual o dispositivo GPS está ligado. Pode ser um simples USB, para dispositivos GPS com USB.

  • nix No Linux é algo do género como /dev/ttyS0 ou /dev/ttyS1.

  • win No Windows é COM1 ou COM2.

When you click [OK], the data will be downloaded from the device and appear as a layer in QGIS.

Uploading os dados GPS para o dispositivo

You can also upload data directly from a vector layer in QGIS to a GPS device using the Upload to GPS tab of the GPS Tools dialog. To do this, you simply select the layer that you want to upload (which must be a GPX layer), your GPS device type, and the port (or USB) that it is connected to. Just as with the download tool, you can specify new device types if your device isn’t in the list.

This tool is very useful in combination with the vector-editing capabilities of QGIS. It allows you to load a map, create waypoints and routes, and then upload them and use them on your GPS device.

Definindo novos tipos de dispositivos

There are lots of different types of GPS devices. The QGIS developers can’t test all of them, so if you have one that does not work with any of the device types listed in the Download from GPS and Upload to GPS tools, you can define your own device type for it. You do this by using the GPS device editor, which you start by clicking the [Edit devices] button in the download or the upload tab.

To define a new device, you simply click the [New device] button, enter a name, enter download and upload commands for your device, and click the [Update device] button. The name will be listed in the device menus in the upload and download windows – it can be any string. The download command is the command that is used to download data from the device to a GPX file. This will probably be a GPSBabel command, but you can use any other command line program that can create a GPX file. QGIS will replace the keywords %type, %in, and %out when it runs the command.

%type será substituído por -w se está a transferir sítios de interesse, -r se está a transferir rotas e -t se está a transferir trilhos. Estes são as opções da linha de comandos que informam o GPSBabel que tipo de elemento irá transferir.

%in will be replaced by the port name that you choose in the download window and %out will be replaced by the name you choose for the GPX file that the downloaded data should be stored in. So, if you create a device type with the download command gpsbabel %type -i garmin -o gpx %in %out (this is actually the download command for the predefined device type ‘Garmin serial’) and then use it to download waypoints from port /dev/ttyS0 to the file output.gpx, QGIS will replace the keywords and run the command gpsbabel -w -i garmin -o gpx /dev/ttyS0 output.gpx.

O comando de upload é o comando que é usado para fazer upload de dados para o dispositivo. As mesmas palavras-chave são usadas, mas %in é agora substituída pelo o nome do ficheiro GPX para a camada que vai ser feita um upload, e %out é substituída pelo o nome da porta.

You can learn more about GPSBabel and its available command line options at http://www.gpsbabel.org.

Após ter criado um novo tipo de dispositivo irá aparecer na lista de dispositivos para as ferramentas de transferência e upload.

Transferência de pontos/trilhos a partir de unidades GPS

As described in previous sections QGIS uses GPSBabel to download points/tracks directly in the project. QGIS comes out of the box with a pre-defined profile to download from Garmin devices. Unfortunately there is a bug #6318 that does not allow create other profiles, so downloading directly in QGIS using the GPS Tools is at the moment limited to Garmin USB units.

Garmin GPSMAP 60cs

MS Windows

Install the Garmin USB drivers ​from http://www8.garmin.com/support/download_details.jsp?id=591

Ligue o aparelho. Abra as Ferramentas GPS e use type=garmin serial e port=usb: Preencha os campos Nome da camada e Ficheiro de saída. Poderá ter problemas algumas vezes a guardar numa pasta, usando algo como c:\temp funcionará.

Ubuntu/Mint GNU/Linux

É preciso ter em conta as permissões do dispositivo, como é descrito em https://wiki.openstreetmap.org/wiki/USB_Garmin_on_GNU/Linux. Pode tentar criar um ficheiro /etc/udev/rules.d/51-garmin.rules contendo esta regra

ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", MODE="666"

Depois disto é necessário ter a certeza que o módulo kernel do garmin_gps não está carregado

rmmod garmin_gps

and then you can use the GPS Tools. Unfortunately there seems to be a bug #7182 and usually QGIS freezes several times before the operation work fine.

BTGP-38KM datalogger (apenas com Bluetooth)

MS Windows

O erro atrás referido não permite que possa transferir os dados a partir do QGIS, por isso é necessário usar o GPSBabel a partir da linha de comandos ou usá-lo através da sua interfac. O comando que o executa é

gpsbabel -t -i skytraq,baud=9600,initbaud=9600 -f COM9 -o gpx -F C:/GPX/aaa.gpx

Ubuntu/Mint GNU/Linux

Use o mesmo comando (ou configurações se usa o GUI do GPSBabel) como no Windows. No Linux aparecerá uma mensagem como

skytraq: Too many read errors on serial port

É uma questão de desligá-lo e ligá-lo no datalogger e voltar a tentar.

BlueMax GPS-4044 datalogger (com BT e USB)

MS Windows

Note

É necessário instalar os controladores antes de usar o Windows 7. Veja o site do fabricante para a transferência correcta.

Transferindo com o GPSBabel, com o USB e BT retorna sempre um erro como

gpsbabel -t -i mtk -f COM12 -o gpx -F C:/temp/test.gpx
mtk_logger: Can't create temporary file data.bin
Error running gpsbabel: Process exited unsuccessfully with code 1

Ubuntu/Mint GNU/Linux

Com USB

Após ter ligado o cabo use o comando dmesg para perceber que porta está a ser usada, por exemplo /dev/ttyACM3. De seguida como é habitual use o GPSBabel a partir do CLI ou GUI

gpsbabel -t -i mtk -f /dev/ttyACM3 -o gpx -F /home/user/bluemax.gpx

Com Bluetooth

Use o Gestor de Dispositivos Blueman para emparelhar os dispositivos e torná-los disponíveis através do sistema de portas, e de seguida corra o GPSBabel

gpsbabel -t -i mtk -f /dev/rfcomm0 -o gpx -F /home/user/bluemax_bt.gpx