Installing phpMyGPX on openSUSE
Table of Contents
1 Prepare Web Server and Database
1.1 Install the Web and LAMP Server pattern and additional php5 packages
- With YaST, install the Web and LAMP Server pattern.
-
Additionally install the following php5 packages:
-
php5-exif -
php5-gd -
php5-mbstring -
php5-curl
-
1.2 Start Apache
rcapache2 start
or use the YaST runlevel editor to start Apache permanently at boot time.
1.3 Start MySQL
rcmysql start
or use the YaST runlevel editor to start MySQL (mariadb) permanently at boot time.
rcmysql spits out the following warning:
Creating MySQL privilege database... Installing MariaDB/MySQL system tables... 100607 14:43:07 [Warning] The syntax '--skip-locking' is deprecated and will be removed in a future release. Please use --skip-external-locking instead. OK Filling help tables... 100607 14:43:09 [Warning] The syntax '--skip-locking' is deprecated and will be removed in a future release. Please use --skip-external-locking instead. OK PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h oldfrechet.suse.de password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the MySQL manual for more instructions. You can start the MariaDB daemon with: rcmysql start
Run the mentioned commands:
/usr/bin/mysqladmin -u root password 'suseNEPO' /usr/bin/mysqladmin -u root -h oldfrechet.suse.de password 'suseNEPO'
The second command results in:
/usr/bin/mysqladmin: connect to server at 'oldfrechet.suse.de' failed error: 'Host 'oldfrechet.suse.de' is not allowed to connect to this MySQL server'
You can ignore this error message and continue with securing your installation using:
/usr/bin/mysql_secure_installation
1.3.1 Create and configure the database user
For more info, see http://dba.fyicenter.com/faq/mysql/mysql_managing_users_and_privileges_2.html
Start mysql as root and enter:
mysql> create user 'mygpx'@'localhost' identified by 'suseTUX'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'mygpx'@'localhost' IDENTIFIED BY 'suseTUX' WITH GRANT OPTION; mysql> \q
2 Install and Configure phpMyGPX
2.1 Download
From http://phpmygpx.tuxfamily.org/phpmygpx.php download http://phpmygpx.tuxfamily.org/download.php?file=phpMyGPX-0.6.tar.bz2 as of today (2010-06-07).
2.2 Unpack as user 'tux'
cd ~/public_html tar xvf /tmp/phpMyGPX-0.6.tar.bz2
or set an Apache alias and unpack it at that location; in my setup,
/etc/apache2/conf.d/phpmygpx.conf points to the unpacked phpMyGPX
directory as follows:
Alias /mygpx/ "/usr/src/ke/tux/phpmygpx/"
<Directory "/usr/src/ke/tux">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from .suse.de .suse.cz
# Allow from all
</Directory>
Shell commands for unpacking:
mkdir /usr/src/ke/tux cd /usr/src/ke/tux tar xvf /tmp/phpMyGPX-0.6.tar.bz2
2.3 Fix file permissions
cd /usr/src/ke/tux chown -R wwwrun phpmygpx
2.4 Run the phpMyGPX installation process
-
To start the phpMyGPX installation process, load
http://oldfrechet.suse.de/mygpx/. Select your language and the
installation method.
and click Continue.
Do not miss the workaround needed for installing version 0.6, see: http://phpmygpx.tuxfamily.org/bugs/index.php?do=details&task_id=42#comment44
-
As long as "Environment checks" are not green, click the back button
and fix the issues.
If all tests are successfully done, click Continue.
-
In the "Configuration" step, enter the administration data.
Datenbankname: gpx osm Admin-Password: osm-pass
Define start coordinates.
To work around the install trouble with version 0.6, install version 0.5.1 first:
cd /usr/src/ke/tux tar xvf /tmp/phpMyGPX-0.5.1.tar.bz2 chown -R wwwrun phpmygpx
and then upgrade with unpacking 0.6 into the same directory:
cd /usr/src/ke/tux tar xvf /tmp/phpMyGPX-0.6.tar.bz2 chown -R wwwrun phpmygpx
2.5 Troubleshooting
In case of trouble with limited resources, consider to increase the
memory a PHP script may use. Change memory_limit in
/etc/php5/apache2/php.ini (default is 128MB):
memory_limit = 256M
3 Uploading Tracks and Photos
3.1 Downloading tracks from the Garmin device
- First install gpsbabel.
-
Download waypoints with
gpsbabel:date=$(date --iso) sudo gpsbabel -i garmin -f usb: -o gpx -F wpt-$date.gpx
If it fails unload the garmin_gps kernel module as root with:
rmmod garmin_gps
3.2 Login as admin and upload tracks
3.3 Login as admin and upload photos
- Before uploading photos, geotagging is necessary (see below geotag-photos).
- Upload photos use the phpMyGPX GUI. For good browsing experience later, connect the photos with the appropriate GPX track. Select the GPX ID from the pull-down list at the bottom.
4 Browsing Tracks and Photos
5 Geotagging Photos
5.1 Using gpsphoto
First install gpsphoto. It is not part of the default distribution.
Add the Application:Geo software repository
(http://download.opensuse.org/repositories/Application:/Geo/openSUSE_Factory)
and select it for installation. exiftool for manipulating jpeg
meta data is also required and will get installed automatically.
Take a picture of your GPS device displaying the GPS time. Then
determine the time offset of your photo camera by comparing the GPS
time with the time of the GPS photo (camera). Use exiftool to
display the time of the GPS photo (camera):
exiftool IMG_0233.JPG | grep -i date File Modification Date/Time : 2010:06:08 07:45:46+02:00 Modify Date : 2010:06:08 06:45:46 Date/Time Original : 2010:06:08 06:45:46 Create Date : 2010:06:08 06:45:46 Date Stamp Mode : Off
GPS: 08:46:24
Because the camera is set to GMT this means, that the GPS device is 38 seconds ahead. Formula for calculationg the time offset:
GPS - IMG (Date/Time Original) - TZ = OFFSET 08:46:24 - 06:45:46 - 2:00:00 = 0:00:38
To adjust the time and add the location info from the GPX file, e.g. call
gpsPhoto as follows:
gpsPhoto --gpsfile 20100608.gpx -i ../Pictures/362CANON/IMG_0233.JPG \ --timeoffset 38 \ --overwrite-geotagged
Found 1 total gps file name. Parsing GPX file "/suse/ke/src/gpx/20100608.gpx": 243 points. Processed 243 coordinates. Found 1 total image file name. /usr/src/ke/Pictures/362CANON/IMG_0233.JPG, 2010-06-08T06:45:46Z, timediff=13 to 06:46:11 Lat 49.473769, Lon 11.105481 - Bearing: 0 - Altitude: 325m Found coordinates for 1 images out of 1 images ... done.
If the result matches your expectations, adjust all the files belonging to this GPX track in one go (and consider to write a KML file):
gpsPhoto --gpsfile 20100608.gpx --dir ../Pictures/362CANON \ --timeoffset 38 \ --overwrite-geotagged --kml 20100608.kml
If your GPX track is rather sparse on track points, which might be
caused by not moving for several minutes (because of taking
photographs ;) ), the --maxtimediff option (default: 120 seconds)
is usefull, e.g.:
gpsPhoto --gpsfile 20100608.gpx --dir ../Pictures/362CANON \ --timeoffset 38 --maxtimediff=1200 \ --overwrite-geotagged --kml 20100608.kml
Other tools such as josm can make use of this geotag information.
5.2 More geotagging software
Date: 2010-06-11 Fri
HTML generated by org-mode 6.33x in emacs 23