Giter Club home page Giter Club logo

hikingmap's People

Contributors

mrvdb avatar roelderickx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hikingmap's Issues

Exception raised for a specific track

The track has been added to the tests, currently only in the testsuite branch.
Debug output of the runtests script is

calc_border_point: prev_coord is not inside page area!
  prev_coord = 0.045005,36.552529
  coord = 0.041981,36.554021
  page area = detail map 5 (landscape): 0.07902,36.368927 - 0.233663,36.454339
Error while calculating permutation 0, track order = 0.115582,36.429966 // 0.033205,36.488041 // 0.261325,36.34589 // 0.308385,36.244406

Some parts of a track are not rendered

I created my own track by combining several GPX tracks in 1 file:

  1. http://www.grsentiers.org/GPX/GR121_Ed1-20180609.gpx
  2. https://www.gr-infos.com/divers/gpx/gr121a.gpx
  3. https://www.gr-infos.com/divers/gpx/gr121b.gpx
  4. https://www.gr-infos.com/divers/gpx/gr121c.gpx

I removed the overlap between the first and the second file and I made sure the second tracks starts where the first finishes, to make hikingmap combine all tracks to 1 single track. All tracks are separate trkseg tags in the GPX file.
But the result is that some parts are not rendered for no apparent reason. If overlap, scale or paper size parameters are modified, it works correctly.

Exception when calculating border coordinates

As reported by @hspitzer in the comments on commit ef33f07:

I'm running the following command:
hikingmap --pagewidth 28.1 --pageheight 40.4 --pageoverlap 1 --overview --gpx render_osm/data/GPX_all.gpx -- hm_render_maperitive/hm_render_maperitive.py -d 300

Output and error traceback without my fix

Reading file render_osm/data/GPX_all.gpx
Found track HRP
=> new track 0
Found track GR10
=> new track 1
Found track GR11
=> new track 2
Generating waypoints for track 0: -1.773994,43.373254 - 3.129561,42.481879
Total track distance: 741.91 km
Generating waypoints for track 1: -1.77406,43.373138 - 3.129097,42.482052
Total track distance: 892.09 km
Generating waypoints for track 2: -1.792386,43.393209 - 3.321879,42.319296
Total track distance: 818.52 km
Too many tracks to calculate all track permutations
Traceback (most recent call last):
  File "/Users/hannah.spitzer/opt/miniconda3/envs/hrp/bin/hikingmap", line 33, in <module>
    sys.exit(load_entry_point('hikingmap', 'console_scripts', 'hikingmap')())
  File "/Users/hannah.spitzer/projects/personal/render_osm/hikingmap/hikingmap/hikingmap.py", line 74, in main
    trackfinder.calculate_pages(tracks)
  File "/Users/hannah.spitzer/projects/personal/render_osm/hikingmap/hikingmap/trackfinder.py", line 80, in calculate_pages
    prev_coord = self.__add_point(prev_coord, coord)
  File "/Users/hannah.spitzer/projects/personal/render_osm/hikingmap/hikingmap/trackfinder.py", line 101, in __add_point
    prev_coord = self.__add_next_point(prev_coord, coord)
  File "/Users/hannah.spitzer/projects/personal/render_osm/hikingmap/hikingmap/trackfinder.py", line 137, in __add_next_point
    self.__currentpage.add_next_point(border_coord)
  File "/Users/hannah.spitzer/projects/personal/render_osm/hikingmap/hikingmap/page.py", line 133, in add_next_point
    self.__add_point_to_track_area(coord)
  File "/Users/hannah.spitzer/projects/personal/render_osm/hikingmap/hikingmap/page.py", line 99, in __add_point_to_track_area
    if coord.lon < self.track_area.minlon:
AttributeError: 'NoneType' object has no attribute 'lon'
Removing temp file /var/folders/s9/0d6yy20d44v60qd0nfkjlqdd541mvv/T/hikingmap_temp_waypointsmue94igj.gpx

Combination of several tracks in a GPX file may render incorrect

Hikingmap has a problem rendering all tracks correctly if a complex combination of tracks is given. An example is the GPX file for the GR 573, downloadable at http://www.grsentiers.org/GPX/GR573_Ed6_CW-20180913.gpx . Some parts of the track will not be rendered at all and some pages are generated with invalid sizes (which mapnik scales to A4 format).
A quick solution is to manually edit out the side tracks, the main track will render successful.

Center map optimalisation

Currently the track on a given page is centered, either horizontally for landscape or vertically for portrait orientation. In some cases there are other tracks on the page, centering the track we're currently processing is not always the most optimal decision.
The page boundaries should be chosen so that:

  • The part of the track we are currently processing is still on the page
  • A maximum of other tracks are also on the same page

Implementing this will replace the need to check all track permutations.

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.