「Plugins gps」の版間の差分

提供: OSGeo.JP Wiki
移動: 案内検索
(タグ・画像調整前に一旦配下を統合)
(タグ一括置換状態(+"\%"箇所のみ追加)で一旦保存)
行1: 行1:
<H2>
+
=== GPS Plugin ===
GPS Plugin
+
<span id='label_plugingps'></span>
</H2>
+
  
<P>
+
==== What is GPS? ====
<BR><HR>
+
<span id='whatsgps'></span>
<!--Table of Child-Links-->
+
<STRONG>Subsections</STRONG>
+
 
+
<UL CLASS="ChildLinks">
+
<LI>[[What is GPS?]]
+
<LI>[[Loading GPS data from a file]]
+
<LI>[[GPSBabel]]
+
<LI>[[Importing GPS data]]
+
<LI>[[Downloading GPS data from a device]]
+
<LI>[[Uploading GPS data to a device]]
+
<LI>[[Defining new device types]]
+
</UL>
+
<!--End of Table of Child-Links-->
+
<BR><HR>
+
 
+
<H3>
+
What is GPS?
+
</H3>
+
 
+
<P>
+
 
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, 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.
 
It is used as an aid in navigation, for example in airplanes, in boats and by hikers.
 
It 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.
 
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 <SPAN  CLASS="textit">waypoints</SPAN>), sequences of locations that make up a planned <SPAN  CLASS="textit">route</SPAN> and a tracklog or <SPAN  CLASS="textit">track</SPAN> of the receivers movement over time.
+
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 receivers movement over time.
 
Waypoints, routes and tracks are the three basic feature types in GPS data.
 
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.
 
QGIS displays waypoints in point layers while routes and tracks are displayed in linestring layers.
  
<P>
+
==== Loading GPS data from a file ====
<BR><HR>
+
<span id='label_loadgps'></span>
 
+
<H3>
+
Loading GPS data from a file
+
</H3>
+
 
+
<P>
+
 
There are dozens of different file formats for storing GPS data.
 
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.
 
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.
  
<P>
 
 
To load a GPX file you first need to load the plugin.
 
To load a GPX file you first need to load the plugin.
Plugins &gt; mActionShowPluginManagerPlugin
+
{{Template:MainMenuOpt|Plugins}} > {{Template:DropMenuOptTwo|mActionShowPluginManager|Plugin
Manager... &gt; GPS Tools. When this plugin is loaded a button with a  
+
Manager...}} > {{Template:CheckBox|GPS Tools}}. When this plugin is loaded a button with a  
 
small handheld GPS device will show up in the toolbar. An example GPX file is  
 
small handheld GPS device will show up in the toolbar. An example GPX file is  
 
available in the QGIS sample dataset:
 
available in the QGIS sample dataset:
/qgis_sample_data/gps/national_monuments.gpx. See
+
{{Template:FileName|/qgis_sample_data/gps/national_monuments.gpx}}. See
Section&nbsp;[[#label_sampledata]] for more information about the sample data.
+
Section~[[label_sampledata]] for more information about the sample data.
  
<P>
+
<ol>
 +
<li>Click on the {{Template:ToolBtnTwo|gps_importer|GPS Tools}} icon and open the
 +
{{Template:Tab|Load GPX file}} tab (see figure [[figure gpxloader]]).
 +
<li>{{Template:Button|Browse}} to the folder {{Template:FileName|qgis_sample_data/gps/}},
 +
select the GPX file {{Template:FileName|national_monuments.gpx}} and click {{Template:Button|Open}}.
 +
</ol>
  
<OL>
+
<table align='center'>
<LI>Click on the gps_importerGPS Tools icon and open the
+
<caption>'''Figure xx:''' <span id='gpxloader'></span>The ''GPS Tools'' dialog window {{Template:Nix</caption>
Load GPX file tab (see figure [[#figure_gpxloader]]).
+
<tr><td>}caption}
</LI>
+
[[File:loadgpx.png|454px]]</td></tr></table>
<LI>Browse to the folder qgis_sample_data/gps/,
+
select the GPX file national_monuments.gpx and click Open.
+
</LI>
+
</OL>
+
  
<P>
+
Use the browse button {{Template:BrowseButton}} to select the GPX file, then use the
 
+
<DIV ALIGN="CENTER"><A NAME="gpxloader"></A><A NAME="83"></A>
+
<TABLE>
+
<CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>
+
The <SPAN  CLASS="textit">GPS Tools</SPAN> dialog window </CAPTION>
+
<TR><TD>
+
<DIV ALIGN="CENTER">
+
[clip=true, width=12cm]loadgpx
+
 
+
</DIV></TD></TR>
+
</TABLE>
+
</DIV>
+
 
+
<P>
+
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.
 
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.
+
Each feature type will be loaded in a separate layer when you click {{Template:Button|OK}}.
The file national_monuments.gpx only includes waypoints.
+
The file {{Template:FileName|national_monuments.gpx}} only includes waypoints.
  
<P>
+
==== GPSBabel ====
  
<H3>
 
GPSBabel
 
</H3>
 
 
<P>
 
 
Since QGIS uses GPX files you need a way to convert other GPS file formats to GPX.
 
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 can be done for many formats using the free program GPSBabel, which is available at {{Template:URL|http://www.gpsbabel.org}}.
 
This program can also transfer GPS data between your computer and a GPS device.
 
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.
 
QGIS uses GPSBabel to do these things, so it is recommended that you install it.
行98: 行51:
 
any problems.
 
any problems.
  
<P>
 
<BR><HR>
 
  
<H3>
+
==== Importing GPS data ====
Importing GPS data
+
</H3>
+
  
<P>
+
To import GPS data from a file that is not a GPX file, you use the tool {{Template:Tab|Import other file}} in the GPS Tools dialog.
To import GPS data from a file that is not a GPX file, you use the tool Import other file in the GPS Tools dialog.
+
 
Here you select the file that you want to import (and the file type), which feature type you want to import from it, where you want to store the converted GPX file and what the name of the new layer should be.  Note that not all GPS  
 
Here you select the file that you want to import (and the file type), which feature type you want to import from it, where you want to store the converted GPX file and what the name of the new layer should be.  Note that not all GPS  
 
data formats will support all three feature types, so for many formats  
 
data formats will support all three feature types, so for many formats  
 
you will only be able to choose between one or two types.  
 
you will only be able to choose between one or two types.  
  
<P>
+
==== Downloading GPS data from a device ====
  
<H3>
 
Downloading GPS data from a device
 
</H3>
 
 
<P>
 
 
QGIS can use GPSBabel to download data from a GPS device directly as new vector layers.
 
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 [[#figure_download|55]]). Here, we  
+
For this we use the {{Template:Tab|Download from GPS}} tab of the GPS Tools dialog (see Figure [[figure_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.
 
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.
  
<P>
+
<table align='center'>
 +
<caption>'''Figure xx:''' <span id='figure_download'></span>The download tool {{Template:Nix</caption>
 +
<tr><td>}caption}
 +
[[File:download.png|454px]]</td></tr></table>
  
<DIV ALIGN="CENTER"><A NAME="figure_download"></A><A NAME="84"></A>
 
<TABLE>
 
<CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>
 
The download tool </CAPTION>
 
<TR><TD>
 
<DIV ALIGN="CENTER">
 
[clip=true, width=12cm]download
 
 
 
</DIV></TD></TR>
 
</TABLE>
 
</DIV>
 
 
<P>
 
 
The device type you select in the GPS device menu determines how GPSBabel tries to communicate with your GPS device.
 
The device type you select in the GPS device menu determines how GPSBabel tries to communicate with your GPS device.
If none of the available types work with your GPS device you can create a new type (see section [[node8.html#sec:Defining-new-device|12.7.7]]).
+
If none of the available types work with your GPS device you can create a new type (see section [[sec:Defining-new-device]]).
  
<P>
 
 
The port may be a file name or some other name that your operating system uses as a reference to the physical port in your computer that the GPS device is connected to. It may also be simply usb, for usb enabled GPS units.
 
The port may be a file name or some other name that your operating system uses as a reference to the physical port in your computer that the GPS device is connected to. It may also be simply usb, for usb enabled GPS units.
On Linux this is something like /dev/ttyS0 or /dev/ttyS1 and on Windows it's COM1 or COM2.
+
{{Template:Nix}} On Linux this is something like /dev/ttyS0 or /dev/ttyS1 and on {{Template:Win}} Windows it's COM1 or COM2.
  
<P>
+
When you click {{Template:Button|OK}} the data will be downloaded from the device and appear as a layer in QGIS.
When you click OK the data will be downloaded from the device and appear as a layer in QGIS.
+
  
<P>
+
==== Uploading GPS data to a device ====
  
<H3>
+
You can also upload data directly from a vector layer in QGIS to a GPS device using the {{Template:Tab|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),  
Uploading GPS data to a device
+
</H3>
+
 
+
<P>
+
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.
 
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.
 
Just as with the download tool you can specify new device types if your device isn't in the list.
  
<BR><BR>
 
 
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.
 
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.
  
<P>
+
==== <span id='sec:Defining-new-device ====
<BR><HR>
+
Defining new device types'></span>
 
+
<H3>
+
Defining new device types
+
</H3>
+
 
+
<P>
+
 
There are lots of different types of GPS devices.
 
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.
+
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 {{Template:Tab|Download from GPS}} and {{Template:Tab|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 tabs.
+
You do this by using the GPS device editor, which you start by clicking the {{Template:Button|Edit devices}} button in the download or the upload tabs.
  
<P>
+
To define a new device you simply click the {{Template:Button|New device}} button, enter a name, a download command and an upload command for your device, and click the {{Template:Button|Update device}} button.
To define a new device you simply click the New device button, enter a name, a download command and an upload command for your device, and click the Update device button.
+
 
The name will be listed in the device menus in the upload and download windows, and can be any string.
 
The name will be listed in the device menus in the upload and download windows, and can be any string.
 
The download command is the command that is used to download data from the device to a GPX file.
 
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.
 
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.
+
QGIS will replace the keywords {{Template:UserText|%type}}, {{Template:UserText|%in}}, and {{Template:UserText|%out}} when it runs the command.
 +
{{Template:UserText|These are command line options that tell GPSBabel which feature type to download.
  
<br>
+
{{Template:UserText|%type}} will be replaced by "{{Template:UserText|-w}}" if you are downloading waypoints, "{{Template:UserText|-r}}" if you are downloading routes and "{{Template:UserText|-t}}" if you are downloading tracks.
%type will be replaced by ``-w'' if you are downloading waypoints, ``-r'' if you are downloading routes and ``-t'' if you are downloading tracks.
+
 
These are command line options that tell GPSBabel which feature type to download.
 
These are command line options that tell GPSBabel which feature type to download.
  
<br>
+
{{Template|%in}} will be replaced by the port name that you choose in the download window and {{Template|%out}} will be replaced by the name you choose for the GPX file that the downloaded data should be stored in.
%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 "{{Template:UserText|gpsbabel %type -i garmin -o gpx %in %out}'' (this is actually the download command for the predefined device type {{Template|SelectString|GPS device:|Garmin serial}})and then use it to download waypoints from port "{{Template:UserText{/dev/ttyS0}" to the file "{{Template:UserText|output.gpx}}", QGIS will replace the keywords and run the command "{{Template:UserText|gpsbabel -w -i garmin -o gpx /dev/ttyS0 output.gpx}}".
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 GPS device: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''.
+
  
<br>
 
 
The upload command is the command that is used to upload data to the device.
 
The upload command is the command that is used to upload data to the device.
The same keywords are used, but %in is now replaced by the name of the GPX file for the layer that is being uploaded, and %out is replaced by the port name.
+
The same keywords are used, but {{Template:UserText|%in}} is now replaced by the name of the GPX file for the layer that is being uploaded, and {{Template|%out}} is replaced by the port name.
 +
You can learn more about GPSBabel and it's available command line options at {{Template:URL|http://www.gpsbabel.org}}
  
<br>
 
You can learn more about GPSBabel and it's available command line options at http://www.gpsbabel.org
 
<br>
 
 
Once you have created a new device type it will appear in the device lists for the download and upload tools.
 
Once you have created a new device type it will appear in the device lists for the download and upload tools.

2009年10月5日 (月) 21:58時点における版

GPS Plugin

What is 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. It 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 receivers 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.

Loading GPS data from a file

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 > MActionShowPluginManager.png Plugin Manager... > CheckBox.pngGPS Tools. When this plugin is loaded a button with a small handheld GPS device will show up in the toolbar. An example GPX file is available in the QGIS sample dataset: /qgis_sample_data/gps/national_monuments.gpx. See Section~label_sampledata for more information about the sample data.

  1. Click on the Gps importer.png GPS Tools icon and open the Load GPX file tab (see figure figure gpxloader).
  2. Browse to the folder qgis_sample_data/gps/, select the GPX file national_monuments.gpx and click Open.
Figure xx: The GPS Tools dialog window {{Template:Nix
}caption} Loadgpx.png

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.

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.


Importing GPS data

To import GPS data from a file that is not a GPX file, you use the tool Import other file in the GPS Tools dialog. Here you select the file that you want to import (and the file type), which feature type you want to import from it, where you want to store the converted GPX file and what the name of the new layer should be. Note that not all GPS data formats will support all three feature types, so for many formats you will only be able to choose between one or two types.

Downloading GPS data from a device

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 figure_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.

Figure xx: The download tool {{Template:Nix
}caption} Download.png

The device type you select in the GPS device menu determines how GPSBabel tries to communicate with your GPS device. If none of the available types work with your GPS device you can create a new type (see section sec:Defining-new-device).

The port may be a file name or some other name that your operating system uses as a reference to the physical port in your computer that the GPS device is connected to. It may also be simply usb, for usb enabled GPS units. Nix.png On Linux this is something like /dev/ttyS0 or /dev/ttyS1 and on Win.png Windows it's COM1 or COM2.

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

Uploading GPS data to a device

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.

==== 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 tabs.

To define a new device you simply click the New device button, enter a name, a download command and an upload command for your device, and click the Update device button. The name will be listed in the device menus in the upload and download windows, and 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. {{Template:UserText|These are command line options that tell GPSBabel which feature type to download.

%type will be replaced by "-w" if you are downloading waypoints, "-r" if you are downloading routes and "-t" if you are downloading tracks. These are command line options that tell GPSBabel which feature type to download.

テンプレート:Template will be replaced by the port name that you choose in the download window and テンプレート:Template 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 "{{Template:UserText|gpsbabel %type -i garmin -o gpx %in %out} (this is actually the download command for the predefined device type テンプレート:Template)and then use it to download waypoints from port "{{Template:UserText{/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".

The upload command is the command that is used to upload data to the device. The same keywords are used, but %in is now replaced by the name of the GPX file for the layer that is being uploaded, and テンプレート:Template is replaced by the port name. You can learn more about GPSBabel and it's available command line options at http://www.gpsbabel.org

Once you have created a new device type it will appear in the device lists for the download and upload tools.