rinigus / pure-maps

Maps and navigation
https://rinigus.github.io/pure-maps/
GNU General Public License v3.0
243 stars 43 forks source link

Plus Code - Short Form Support #623

Open Logic-gate opened 1 year ago

Logic-gate commented 1 year ago

Before merging, note that 857W+J3 Portofino, Metropolitan City of Genoa, Italy and 857W+J3 Portofino, Italy do not match RE_PLUS_CODE_SHORT regex and raises the following errors.

[W] unknown:93 - file:///usr/share/harbour-pure-maps/qml/MapErrorPage.qml:93:27: Unable to assign [undefined] to QString
[W] unknown:116 - file:///usr/share/harbour-pure-maps/qml/MapErrorPage.qml:116:36: Unable to assign QQuickAnchorLine to double
[W] unknown:0 - "Illegal point coordinates when read as QGeoCoordinate, point 0"

I am not entirely sure why it's happening since C53X+C9X Cicagna, Metropolitan City of Genoa, Italy fails gracefully after matching the regex. I initially thought it had something to do with the 3 part reference location, but it appears that something else is happening. Might be that it's being matched or caught prior to parsing short codes.

rinigus commented 1 year ago

I presume you will try to rewrite or test with splitting on space(s) and then trying to recover full Plus Code. However, small feedback:

  1. parse_plus_code doesn't do anymore what it would be expected from its name
  2. methods in Pure Maps are ordered alphabetically (already from the beginning of the code and legacy of Osmo's days)
Logic-gate commented 1 year ago

Yes, I intend to test your suggestion. I just haven't had the time; even though it's a minor fix. Will hopefully attend to it this week.

In regards to your feedback. Sure, I will follow the code's convention.