PaVi (wasting time with maps)

User projects written in or related to FreeBASIC.
Post Reply
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

PaVi (wasting time with maps)

Post by TJF »

Let me introduce my new project, which I named PaVi (= Path Viewer). It's a GPLv3 licensed GtkApplication (grafical user interface, command line control and DBus integration) designed to:
  • show a worlds map segment (tiles downloaded/cached from different web sources)
  • move in segment (keyboard/mouse: north, east, south, west, zoom in or out)
  • load recorded tracks (NMEA or GPX file format)
  • plot track on map (custom color/width for lines and points)
  • decorate points (scaled and/or colored by elevation, speed or direction)
  • walk in track (map centered at the current track point)
  • show point data
Find details in the projects repository at https://github.com/dtjf/pavi and in the online documentation.

The following screen shot shows a track ploted (by cairo) on top of OSM (Open Street Map) map tiles by red points (60 % translucent) with variable diameter (scaled by the points elevation):

Image

The second screen shot plots the same track on top of Virtual Earth Hybrid map tiles, complemented by a layer providing controls and point info:

Image

Currently the project is work in progress in an early stage. Planed future improvements are:
  • advanced controls (keyboard and popup menues)
  • further command line options
  • replace dummy parameter dialog, save/load parameters
  • additional custom map sources
  • remember custom views (save/load: map segment, track point at map zoom)
  • more track customizations
  • track diagram (ie. elevation vs. time, speed vs. point#)
  • search in track (time, position, point distance, elevation jumps, ...)
  • further track file formats?
  • finalise documentation
  • tiles download for off-line use
Have fun!

[edit]
Link to documentation added. Strikethrough formating removed.
[/edit]
Last edited by TJF on Aug 24, 2023 6:18, edited 2 times in total.
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: PaVi (wasting time with maps)

Post by badidea »

That track looks familiar.
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: PaVi (wasting time with maps)

Post by TJF »

badidea wrote:That track looks familiar.
A nice guy published it on the web, so I've additional stuff to test my parser.

Did you test the app?
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: PaVi (wasting time with maps)

Post by badidea »

TJF wrote:Did you test the app?
Trying to get it to work. Steps so far:
* Download pavi-master
* Download gir_headers-master
* Put Gir folder into pavi-master/src/bas
* Install libgtk-3-dev (not 3.0) + dependencies
* Install libosmgpsmap-1.0-dev + dependencies
* Try fbc64 -exx -w all "pavi.bas", result:

Code: Select all

pavi.o: In function `PAVI_STARTUP':
pavi.c:(.text+0x473): undefined reference to `GUIDATA::GUIDATA(FBSTRING&, _GApplication*)'
pavi.o: In function `PAVI_SHUTDOWN':
pavi.c:(.text+0x642): undefined reference to `GUIDATA::~GUIDATA()'
pavi.o: In function `PAVI_OPEN':
pavi.c:(.text+0x10b4): undefined reference to `TS_ADD::TS_ADD(char const*)'
pavi.c:(.text+0x11d9): undefined reference to `TS_SELECT'
Compilation failed.
* Install cmake + dependencies (I never worked with cmake before)
* Try: ~/Desktop/pavi-master/src/bas$ cmake CMakeLists.txt, result:

Code: Select all

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:62 (ADD_Fbc_SRC_DEPS):
  Unknown CMake command "ADD_Fbc_SRC_DEPS".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.10)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/badidea/Desktop/pavi-master/src/bas/CMakeFiles/CMakeOutput.log".
So, I do not know how to compile this yet.
Possible cause is that my fbc is named fbc64 (and fbc32 for 32 bit). Edit: That wasn't the problem (I think).

* Try form 2 levels up:

Code: Select all

~/Desktop/pavi-master$ cmake CMakeLists.txt
CMake Error at CMakeLists.txt:3 (CMAKE_MINIMUM_REQUIRED):
  CMake 3.14 or higher is required.  You are running version 3.10.2

-- Configuring incomplete, errors occurred!
So, I have to update my system it seems.
When I change 3.14 in pavi-master/CMakeLists.txt to 3.10, I get:

Code: Select all

CMake Error at CMakeLists.txt:24 (PROJECT):
  No CMAKE_Fbc_COMPILER could be found.

  Tell CMake where to find the compiler by setting the CMake cache entry
  CMAKE_Fbc_COMPILER to the full path to the compiler, or to the compiler
  name if it is in the PATH.
I have the feeling that I am getting close, but at the same time I have absolutely no idea what I am doing :-)
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: PaVi (wasting time with maps)

Post by TJF »

Thanks for the detailed report!
badidea wrote:I have the feeling that I am getting close, but at the same time I have absolutely no idea what I am doing :-)
Sure, you're pretty close to success (I guess). It seems you didn't find/follow the build instructions at

https://github.com/DTJF/pavi/blob/maste ... aration.md

Meanwhile a rough documentation is online as well, including the build instructions here.
badidea wrote:So, I have to update my system it seems.
No. The 3.14 request is due to commands in file

https://github.com/DTJF/pavi/blob/maste ... eLists.txt

You can work with CMake 3.10 when you comment the two FILE(CREATE_LINK ... commands (lines 30-39) and uncomment the EXECUTE_PROCESS(COMMAND ... lines (41-50) instead.
badidea wrote:Possible cause is that my fbc is named fbc64 (and fbc32 for 32 bit). Edit: That wasn't the problem (I think).
That will get a problem :-( You'll need the cmakefbc package as well (in order to make CMake work with FreeBASIC language). When cmakefbc checks your system, it tries to execute fbc -version and would report that the FreeBASIC compiler is missing. So make a symlink named fbc that points to your compiler fbc64 (assuming you installed the 64 bit binaries of Gtk/Osm).

So your way to success seems to be:
  • Install cmakefbc package
  • Create symlink fbc -> fbc64
  • Change to EXECUTE_PROCESS(COMMAND ... lines in file src/bas/CMakeLists.txt
  • Execute the standard build procedure (starting in root directory)

    Code: Select all

    mkdir build
    cd build
    cmakefbc ..
    make
  • Start the fresh binary by executing src/bas/pavi (in build folder)
Good luck!

BTW:
When you use git for package downloads (instead of zipped master branches), it'll get much more easy to keep the source trees up to date.
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: PaVi (wasting time with maps)

Post by badidea »

Ok, this time I followed the instructions. With fbc linked to fbc64, the change for cmake 3.10 and again with Gir inside pavi/src/bas/
The build seems successful, but I can only run it from pavi/build/src/bas, else I get:

Code: Select all

pavi
Gtk-Message: 10:46:09.136: Failed to load module "topmenu-gtk-module"

** (pavi:9551): ERROR **: 10:46:09.184: GTK-Builder: Failed to open file “pavi.ui”: No such file or directory
Trace/breakpoint trap (core dumped)
On the first run I got a lot of warnings from OsmGpsMap:

Code: Select all

(pavi:9605): OsmGpsMap-WARNING **: 10:50:21.626: Error getting missing tile

(pavi:9605): OsmGpsMap-WARNING **: 10:50:21.627: Error getting missing tile

(pavi:9605): OsmGpsMap-WARNING **: 10:50:21.628: Error getting missing tile
At some moment I got this below and the program froze. But I cannot reproduce it any more.

Code: Select all

Gtk-Message: 10:50:39.845: GtkDialog mapped without a transient parent. This is discouraged.
pavi: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Killed
Transparency does not seem to work here and the track line thickness seems a bit weird.
Image

I got another crash with log:

Code: Select all

corrupted size vs. prev_size
Aborted (core dumped)
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: PaVi (wasting time with maps)

Post by TJF »

badidea wrote:The build seems successful, but I can only run it from pavi/build/src/bas, else I get:
Congrats, you are a CMake expert now. The executable currently loads the user interface file (named pavi.ui) form its directory, and cannot start without that file. And the file pavi.png should also be present (used in the about dialog).

Once you have all three files in a folder, you can run from that folder (placed anywhere).
badidea wrote:On the first run I got a lot of warnings from OsmGpsMap:

Code: Select all

(pavi:9605): OsmGpsMap-WARNING **: 10:50:21.626: Error getting missing tile

(pavi:9605): OsmGpsMap-WARNING **: 10:50:21.627: Error getting missing tile

(pavi:9605): OsmGpsMap-WARNING **: 10:50:21.628: Error getting missing tile
That's intentional. OsmGpsMap warns that it cannot download the tiles as fast as required. The job gets queued in libsoup and it will download as soon as possible. Once the tiles are cached the warnings wont show again (unless your cache overflows).
badidea wrote:At some moment I got this below and the program froze. But I cannot reproduce it any more.

Code: Select all

Gtk-Message: 10:50:39.845: GtkDialog mapped without a transient parent. This is discouraged.
A transient dialog without parent window. I'll fix it in the pavi.ui file.
badidea wrote:Transparency does not seem to work here and the track line thickness seems a bit weird.
When you load a track, default settings for lines and points are used (some defaults are currently wired - for testing purposes). Later, the setting can get customized in the track PopOver, that opens when you click on the triangle below "Track" (above "Layer"). In the up-coming tree view you can enable/disable each single track (check button), select the active track (radio button) and click on the name to open the track preference dialog (or press <shift>-i key in map for the active tracks dialog). In that dialog you can customize the color, width/diameter and the variable point setting. For colors the standard GtkColorChooser is used. In order to set transparency right click on a color to open a second window for fine-tuning (transparancy is the slider below the color box).

Note: Since most of your tracks don't have <g_spd> or <dir> tags, points scaled by speed or direction will be unvisible.
badidea wrote:I got another crash with log:

Code: Select all

corrupted size vs. prev_size
Aborted (core dumped)
Sorry, too less information how that happened ...
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: PaVi (wasting time with maps)

Post by badidea »

The crash happened when loading a file, but I don't know which file it was and I cannot reproduce it at the moment.

The app the did store <g_spd>, <dir>, <h_acc> and <v_acc> had some problems, so I switched back to an older application which does not store this data.
Also elevation data in the Netherlands is mostly pretty boring.

I did find the menu for track display. Here I had to stop biking and walk a bit:
Image

Just for fun, a run I recorded a few years ago, with the racing track in Zandvoort at the top:
Image
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: PaVi (wasting time with maps)

Post by TJF »

badidea wrote:The crash happened when loading a file, but I don't know which file it was and I cannot reproduce it at the moment.
$%#@ happens ...
badidea wrote:The app the did store <g_spd>, <dir>, <h_acc> and <v_acc> had some problems, so I switched back to an older application which does not store this data.
Also elevation data in the Netherlands is mostly pretty boring.
Elevation is different in Austria (perhaps we should add <wind_spd> and <wind_dir> tags for NL :-) Anyhow, we could compute missing speed and direction values form latitude, longitude, elevation and time stamp. You did this already, at least for speed. Does it make sense?
badidea wrote:Just for fun, a run I recorded a few years ago, with the racing track in Zandvoort at the top:
Mind the Tarzan curve!


It seems that you didn't walk a track yet. One of the loaded tracks is the active track (the last one loaded by default). You can center a (the current) point in that track on the map, getting its data shown in the info pad (right bottom).

In order to walk a track, hold down the <Shift> key (or <Caps-Lock>) and choose an action from the key in table at

https://users.freebasic-portal.de/tjf/P ... ables.html

Ie <Home> jumps to the first track point, <End> to the last, <Right> increases point index by one, <Left> decreases, ... You can walk at any zoom level (<+> or <-> keys).

A <Shift> mouse click makes the point nearest to the click position the new current point (in the active track, when the distance is smaller than a certain radius). A <Shift><Control> mouse click searches in all enabled tracks for the nearest point, possibly changing both, active track and current point.

BTW:
I updated some source files in the repo. Using Zip, you've to start from scratch. In contrast, using GIT download it's just a git pull command to update your local copy.
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: PaVi (wasting time with maps)

Post by marcov »

badidea wrote:
Also elevation data in the Netherlands is mostly pretty boring.
Just go cycling in South Limburg. :-)
Post Reply