Giter Site home page Giter Site logo

davedavenport / gpx-viewer Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 6.0 2.41 MB

GPX Viewer is a simple tool to visualize tracks and waypoints stored in a gpx file.

License: GNU General Public License v2.0

Shell 0.11% Vala 56.11% C 41.96% Meson 1.82%

gpx-viewer's People

Contributors

albfan avatar andrewharvey avatar chkr-private avatar chrila avatar davedavenport avatar madprog avatar ricotz avatar yakushabb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gpx-viewer's Issues

New graph view

Hi,

I couldn't find an private email, so I am using this issue now to ask some questions:

I really like this project and would like to do some coding for it to bring it on par with Turtle Sport (for me). I know that you don't intend this app to be a fitness tracker, but I think it's not far from there I think and I am also happy to continue the effort under a different name if thats necessary, I just would love to have an "native" app for this!
For one, I'd like to change the graph view to react on mouse over and display the value that are below the mouse (but keep the select functionality). Also the dot on the map should follow the current mouse position. I'd also like the graph to show 4 curves at the same time, selectable:

Heart rate, altitude, speed and cadence (see this screenshot:
selection_068)

Now the reason I am asking is that I saw that you have an updated Graph class. Is there a point on continuing with that class? Or should I base my effort on the old one?

Cheers,

Wolf

Build fails

Trying to build on Artix GNU/Linux, an Arch Linux based distribution, rolling release, so all packages are usually quite up to date with latest upstream release.

build according to this build recipe:

meson --prefix /usr --buildtype=plain . builddir
ninja -C builddir

Build fails with :

gpx-viewer-path-layer.vala:259.3-259.31: error: overriding method `Gpx.Viewer.PathLayer.set_view' is incompatible with base method `void Champlain.Layer.set_view (Champlain.View?)': incompatible type of parameter 1.``:
The Meson build system
Version: 1.2.0
Source dir: /home/felics/.cache/yay/gpxviewer-git/src/gpxviewer-git
Build dir: /home/felics/.cache/yay/gpxviewer-git/src/gpxviewer-git/builddir
Build type: native build
Project name: gpx-viewer
Project version: 0.5.0
C compiler for the host machine: ccache cc (gcc 13.1.1 "cc (GCC) 13.1.1 20230714")
C linker for the host machine: cc ld.bfd 2.40.0
Vala compiler for the host machine: valac (valac 0.56.9)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Configuring config.h using configuration
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Run-time dependency gmodule-2.0 found: YES 2.76.4
Run-time dependency gtk+-3.0 found: YES 3.24.38
Run-time dependency libxml-2.0 found: YES 2.11.4
Run-time dependency gdl-3.0 found: YES 3.40.0
Run-time dependency champlain-0.12 found: YES 0.12.21
Run-time dependency champlain-gtk-0.12 found: YES 0.12.21
Run-time dependency clutter-gtk-1.0 found: YES 1.8.4
Library m found: YES
Program msgfmt found: YES (/usr/bin/msgfmt)
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Build targets in project: 19

gpx-viewer 0.5.0

  User defined options
    buildtype: plain
    prefix   : /usr

Found ninja-1.11.1 at /usr/bin/ninja
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.                                      
ninja: Entering directory `builddir'
[15/33] Compiling Vala source ../libgpx/gpx-parser-fit.vala ../libgpx/gpx-con....vala ../libgpx/gpx-viewer-map-view.vala ../libgpx/gpx-viewer-path-layer.vala
FAILED: libgpx/libgpx.a.p/gpx-parser-fit.c libgpx/libgpx.a.p/gpx-convert.c libgpx/libgpx.a.p/gpx-file-base.c libgpx/libgpx.a.p/gpx-graph.c libgpx/libgpx.a.p/gpx-parser-xml.c libgpx/libgpx.a.p/gpx-parser-json.c libgpx/libgpx.a.p/gpx-point.c libgpx/libgpx.a.p/gpx-playback.c libgpx/libgpx.a.p/gpx-settings.c libgpx/libgpx.a.p/gpx-track.c libgpx/libgpx.a.p/gpx-track-treemodel.c libgpx/libgpx.a.p/gpx-viewer-map-view.c libgpx/libgpx.a.p/gpx-viewer-path-layer.c libgpx/gpx.h libgpx/gpx.vapi 
valac -C --vapidir /home/[...]/.cache/yay/gpxviewer-git/src/gpxviewer-git/vapi --pkg config --use-header --disable-assert --pkg clutter-gtk-1.0 --pkg champlain-gtk-0.12 --pkg champlain-0.12 --pkg gdl-3.0 --pkg libxml-2.0 --pkg gtk+-3.0 --pkg gmodule-2.0 --color=always --directory libgpx/libgpx.a.p --basedir ../libgpx --library gpx --header libgpx/gpx.h --vapi ../gpx.vapi ../libgpx/gpx-parser-fit.vala ../libgpx/gpx-convert.vala ../libgpx/gpx-file-base.vala ../libgpx/gpx-graph.vala ../libgpx/gpx-parser-xml.vala ../libgpx/gpx-parser-json.vala ../libgpx/gpx-point.vala ../libgpx/gpx-playback.vala ../libgpx/gpx-settings.vala ../libgpx/gpx-track.vala ../libgpx/gpx-track-treemodel.vala ../libgpx/gpx-viewer-map-view.vala ../libgpx/gpx-viewer-path-layer.vala
Command-line option `--use-header` is deprecated and will be ignored
../libgpx/gpx-parser-xml.vala:86.13-86.23: warning: `null' incompatible with return type `Gpx.Point'
   86 |             return null;
      |             ^~~~~~~~~~~ 
../libgpx/gpx-graph.vala:354.10-354.19: warning: `Gtk.Menu.popup' has been deprecated since 3.22
  354 | 					    menu.popup (null, null, null, event.button, event.time);
      | 					    ^~~~~~~~~~                                              
../libgpx/gpx-graph.vala:678.14-678.29: warning: `Gdk.cairo_create' has been deprecated since 3.22
  678 | 			var ctx = Gdk.cairo_create(win.get_window());
      | 			          ^~~~~~~~~~~~~~~~                   
../libgpx/gpx-viewer-path-layer.vala:111.3-111.33: warning: `Clutter.CairoTexture' has been deprecated since 1.12
  111 | 		Clutter.CairoTexture path_actor;
      | 		^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
../libgpx/gpx-viewer-path-layer.vala:132.4-132.22: warning: `Clutter.Actor.paint' has been deprecated since 1.12
  132 | 			content_group.paint ();
      | 			^~~~~~~~~~~~~~~~~~~    
../libgpx/gpx-viewer-path-layer.vala:138.4-138.22: warning: `Clutter.Actor.paint' has been deprecated since 1.12
  138 | 			content_group.paint ();
      | 			^~~~~~~~~~~~~~~~~~~    
../libgpx/gpx-viewer-path-layer.vala:259.3-259.31: error: overriding method `Gpx.Viewer.PathLayer.set_view' is incompatible with base method `void Champlain.Layer.set_view (Champlain.View?)': incompatible type of parameter 1.
  259 | 		public override void set_view (Champlain.View view)
      | 		^~~~~~~~~~~~~~~~~~~~~~~~~~~~~                      
../libgpx/gpx-viewer-path-layer.vala:80.3-80.21: warning: Gpx.Viewer.PathLayer.visible hides inherited property `Clutter.Actor.visible'. Use the `new' keyword if hiding was intentional
   80 | 		public bool visible {
      | 		^~~~~~~~~~~~~~~~~~~  
../libgpx/gpx-viewer-path-layer.vala:208.13-208.29: warning: `Clutter.CairoTexture.create' has been deprecated since 1.8
  208 | 			var cr = path_actor.create ();
      | 			         ^~~~~~~~~~~~~~~~~    
../libgpx/gpx-viewer-path-layer.vala:176.5-176.26: warning: `Clutter.Actor.unparent' has been deprecated since 1.10
  176 | 				content_group.unparent ();
      | 				^~~~~~~~~~~~~~~~~~~~~~    
../libgpx/gpx-viewer-path-layer.vala:122.20-122.39: warning: `Clutter.Group.new' has been deprecated since 1.10
  122 | 			content_group = new Clutter.Group ();
      | 			                ^~~~~~~~~~~~~~~~~~~~ 
../libgpx/gpx-viewer-path-layer.vala:123.4-123.27: warning: `Clutter.Actor.set_parent' has been deprecated since 1.10
  123 | 			content_group.set_parent (this);
      | 			^~~~~~~~~~~~~~~~~~~~~~~~        
../libgpx/gpx-viewer-path-layer.vala:124.21-124.40: warning: `Clutter.CairoTexture' has been deprecated since 1.12
  124 | 			path_actor = new Clutter.CairoTexture (256, 256);
      | 			                 ^~~~~~~~~~~~~~~~~~~~            
../libgpx/gpx-viewer-path-layer.vala:125.4-125.26: warning: `Clutter.Container.add_actor' has been deprecated since 1.10
  125 | 			content_group.add_actor (path_actor);
      | 			^~~~~~~~~~~~~~~~~~~~~~~              
Compilation failed: 1 error(s), 13 warning(s)
ninja: build stopped: subcommand failed.

Note that there is also a warning

``Command-line option `--use-header` is deprecated and will be ignored``.

Tools information:

  • valac --version: Vala 0.56.9
  • ninja --version: 1.11.1
  • meson --version: 1.2.0
  • gcc --version | head -n1: gcc (GCC) 13.1.1 20230714

Add extra information

Use case: I just run a triathlon and I loose my chip at very beggining. In the end, organization only register start and end time (classification)

I wear gps watch and cyclocomputer so I have exact tracks for all the run.

The thing is a triathlon tracks should not only cover swing, bycicle and run but transitions. In order to extract that data:

  • Gpx graph needs to show time for each point (done but DateTime.to_local() do not counts correctly summer time)
  • Gpx graph should show partial time from beginning
  • Rename tracks
  • cut tracks (for transition)

Compare gpx tracks

There are lot of interesting comparisons between routes

Elevation
Hill grades
Distance

And even for tracks (more if they are for same route):

  • Time comparisons
  • cadence
  • heart rate
  • speed

From #19, adding an array of tracks It can represent more than one track at time.

I have some data to show examples of gpx comparison.

Automation

Hi,
I am the author of phone app called Oribooklet that helps doing maps for a sport called Orienteering.
GPX Viewer fits very well to show what the mapper is doing in a graphic way, without I had to write a new code to show it.
My question is if your app accepts an intents to show a file, called from another application?

Parse correctly fit files

Using FitSdk

https://developer.garmin.com/fit/download/

I was able to parse recent fit files

java -jar FitCsvTool.jar -b input.fit output.csv

bug gpx-viewer do not parse the file (do not find records and do not create track)

Will use this java impl to find what changed. Is the current implementation working with any fit file @DaveDavenport ? I ask to support different versions, or check if this sdk support both formats. I can upload one example of recent fit file

Remove gps jumps

gps is know to produce jumps from time to time, tracks going back and forth, movements up/down left right.

Filter those (by max speed, follow path or similar) will allow a better review of gpx tracks

Can't display gpx tracks without timing information

It is not possible to display gpx tracks without timing information.

How to reproduce

  • use an gpx file without time tags
  • load in gpx-viewer

Current behavior

  • no route is displayed
  • lot of errors on the command line like this:
gpx-viewer-Message: 19:39:24.974: gpx-parser-xml.vala:139: Failed to get point: trkpt
gpx-viewer-Message: 19:39:24.974: gpx-parser-xml.vala:139: Failed to get point: trkpt
gpx-viewer-Message: 19:39:24.974: gpx-parser-xml.vala:139: Failed to get point: trkpt
gpx-viewer-Message: 19:39:24.974: gpx-parser-xml.vala:139: Failed to get point: trkpt
  • crash when using "View -> Show track list"

Comments

  • the problem is, that gpx-viewer's gpx xml parser only accepts track points with a timestamp
    (
    if(p.time != null) {
    return p;
    }
    )
  • the problem got probably introduced with commit 5bb1bc1
  • the rest of the code looks like it can handle that a Gpx.Point:get_time() returns 0, so a tiny patch like the following fixes the problem
diff --git a/libgpx/gpx-parser-xml.vala b/libgpx/gpx-parser-xml.vala
index 77134fd..584b99b 100644
--- a/libgpx/gpx-parser-xml.vala
+++ b/libgpx/gpx-parser-xml.vala
@@ -82,9 +82,7 @@ namespace Gpx
                     pointNode = pointNode->next;
                 }
 
-                if(p.time != null) {
-                    return p;
-                }
+                return p;
             }
             return null;
         }
  • however, I don't know the code well enough to determine if the patch would have any unwanted side effects

Enhancements on Champlain view

1- On start map looks really small.
2- Loading a track map gets greyed for some time

start-gpx-viewer.mp4

For 1 Gnome maps shows a continuous horizontal map (and probably guess the available height to determine the zoom

Captura de pantalla de 2021-09-13 20-30-24

For 2, probably set the map on bounding box for track will help, showing gears until tiles are loaded, not really sure how to fix this. Is there a signal in champlain when an area is fully loaded?

Gpx graph abstraction

It could be a great idea to isolate gpx graph as a new library providing this component.

It would help with #3 and might allow other projects to easily plot data

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.