question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration of calculated coordinates does not support square brackets

See original GitHub issue

Describe your problem!

Migration of formulas with square brackets does not work. The old waypoint calculator supported square brackets as “normal” brackets. While migration to the new calculator, the square brackets remain and are there not considered as “normal” brackets anymore but (I guess) as range indicator. Hence the (old valid) formula is now not valid anymore.

How to reproduce?

Create waypoint with calculated coordinates in old waypoint-calculator (e.g. N48 45.[A+B][C+D][E+F] E 9 05.000). Set values for all variables.

Open waypoint -> migration-dialog will be shown -> do the migration

Actual result after these steps?

migrated waypoint seems to have valid coordinates

Open new waypoint calculator -> the coordinates are not valid, because “[A+B][C+D][E+F]” could not be evaluated, replace the ssquare brackets with normal ones -> coordinates can be evaluated

Expected result after these steps?

The new waypoint calculator should have a vaild formula.

Suggestion:

  • Replace the square brackets during migration with round brackets (I don’t know if there was a special function for the square brackets in the old waypoint calculator)
  • Show old and new calculation result in the migration dialog to compare the results

Reproducible

Yes

c:geo Version

2022.02.12-NB1-9a59645

System information

## System information

c:geo version: 2022.02.12-NB1-9a59645

Device:
-------
- Device type: SM-G980F (x1sxx, samsung)
- Available processors: 8
- Android version: 11
- Android build: RP1A.200720.012.G980FXXUBDUI5
- Screen resolution: 1080x2178px (360x726dp)
- Pixel density: 3.3000002
- System font scale: 1.1 / used scale: 1.1
- Sailfish OS detected: false
- Google Play services: enabled - 21.48.15 (150408-414534850)

Sensor and location:
-------
- Low power mode: active
- Compass capabilities: yes
- Rotation vector sensor: present
- Orientation sensor: present
- Magnetometer & Accelerometer sensor: present
- Direction sensor used: rotation vector

Program settings:
-------
- Settings: v9, Count:141
- Set language: de
- System date format: dd.MM.yy
- Time zone: GMT+01:00
- Debug mode active: no
- Last backup: 12. Feb., 17:46
- Routing mode: Walk
- Live map mode: true
- OSM multi-threading: false / threads: 1
- Map: Kombiniert (Offline)
  - Id: cgeo.geocaching.maps.mapsforge.MapsforgeMapProvider$OfflineMultiMapSource
  - Atts: Germany (OAM).map: / Maps: (c)Christian Kernbeis, Themes: (c)Tobias Kuehn, www.openandromaps.org 2012-2021 /  / germany.map: / Map data (c) OpenStreetMap contributors /  / switzerland.map: / Map data (c) OpenStreetMap contributors
  - Theme: Elevate.zip:Elevate.xml

Filters:
-------
- Hide waypoints: original parking visited
- LIVE: Status:Gefunden=Nein,Archivierte ausschließen ([:inconclusive=false:advanced=true]status:found_no:exclude_archived)
- OFFLINE: Keine ([:inconclusive=false:advanced=true])

Stored Filters (#10):
- _Standard: [_Standard:inconclusive=false:advanced=false]AND(status:found_no:exclude_archived))
- _Tour: [_Tour:inconclusive=false:advanced=false]AND(status:found_no:has_offline_found_log_no:solved_mystery_yes:exclude_disabled:exclude_archived))
- _unsaved: [_unsaved:inconclusive=false:advanced=false]AND(status:found_no:exclude_archived;stored_since:-10:-10))
- Events: [Events:inconclusive=false:advanced=false]AND(hidden:2021-09-21:-;type:EVENT))
- hasTrackable: [hasTrackable:inconclusive=false:advanced=true]AND(status:has_trackable_yes))
- LabStation: [LabStation:inconclusive=false:advanced=false]AND(note::is_present;type:ADVLAB:USER_DEFINED;status))
- Offlinelog: [Offlinelog:inconclusive=false:advanced=false]AND(status:has_offline_found_log_yes))
- toLog_Bianca: [toLog_Bianca:inconclusive=false:advanced=false]AND(stored_list:86;status:found_yes;log_entry:biansch :contains:inverse=true:logtext=:logtext=contains))
- toLog_Carolin: [toLog_Carolin:inconclusive=false:advanced=false]AND(stored_list:86;status:found_yes;log_entry:carosch:contains:inverse=true:logtext=:logtext=contains))
- winter: [winter:inconclusive=false:advanced=true]AND(attributes:winter_no:inverse=true:attributesources=3))

Services:
-------
- Geocaching sites enabled:
   geocaching.com: Logged in (Anmeldung OK) / PREMIUM
   Geocaching.com Adventure Lab
   opencaching.de: Logged in (Anmeldung OK)
- Geocaching.com date format: dd MMM yy
- Routing: internal / BRouter installed: false
- Installed c:geo plugins:  none

Permissions & paths:
-------
- Fine location permission: granted
- Write external storage permission: granted
- System internal c:geo dir: /data/user/0/cgeo.geocaching (76,5 GB free) v3 internal isDir(6 entries)
- Legacy User storage c:geo dir: /data/user/0/cgeo.geocaching (76,5 GB free) v3 internal isDir(6 entries)
- Geocache data: /storage/emulated/0/Android/data/cgeo.geocaching/files/GeocacheData (76,5 GB free) v3 external non-removable isDir(49 entries)
- Internal theme sync (is turned off): /data/user/0/cgeo.geocaching/MapThemeData (76,5 GB free) v3 internal isDir(0 entries)
- Public Folders: #11
  - BASE: SD-Karte/CGeo (User-Defined)[SD-Karte/CGeo[DOCUMENT#0:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo, Av:true, files:>=17, dirs:>=15, totalFileSize:>=6,2 GB, free space: 108,2 GB, files on device: 0)
  - OFFLINE_MAPS: SD-Karte/CGeo/maps (Default)[SD-Karte/CGeo/maps[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/maps]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Fmaps, Av:true, files:8, dirs:1, totalFileSize:6,2 GB, free space: 108,2 GB, files on device: 0)
  - OFFLINE_MAP_THEMES: SD-Karte/CGeo/maps/_themes (Default)[SD-Karte/CGeo/maps/_themes[PERSISTABLE_FOLDER(OFFLINE_MAPS)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/maps/_themes]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Fmaps%2F_themes, Av:true, files:2, dirs:0, totalFileSize:468,1 KB, free space: 108,2 GB, files on device: 0)
  - LOGFILES: SD-Karte/CGeo/logfiles (Default)[SD-Karte/CGeo/logfiles[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/logfiles]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Flogfiles, Av:true, files:3, dirs:0, totalFileSize:8,9 MB, free space: 108,2 GB, files on device: 0)
  - GPX: SD-Karte/CGeo/gpx (Default)[SD-Karte/CGeo/gpx[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/gpx]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Fgpx, Av:true, files:6, dirs:0, totalFileSize:2,7 MB, free space: 108,2 GB, files on device: 0)
  - BACKUP: SD-Karte/CGeo/backup (Default)[SD-Karte/CGeo/backup[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/backup]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Fbackup, Av:true, files:>=10, dirs:>=7, totalFileSize:>=234,5 MB, free space: 108,2 GB, files on device: 0)
  - FIELD_NOTES: SD-Karte/CGeo/field-notes (Default)[SD-Karte/CGeo/field-notes[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/field-notes]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Ffield-notes, Av:true, files:1, dirs:0, totalFileSize:656 B, free space: 108,2 GB, files on device: 0)
  - SPOILER_IMAGES: SD-Karte/CGeo/GeocachePhotos (Default)[SD-Karte/CGeo/GeocachePhotos[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/GeocachePhotos]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2FGeocachePhotos, Av:true, files:>=2, dirs:>=24, totalFileSize:>=8,3 MB, free space: 108,2 GB, files on device: 0)
  - ROUTING_BASE: SD-Karte/CGeo/routing (Default)[SD-Karte/CGeo/routing[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/routing]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Frouting, Av:true, files:8, dirs:1, totalFileSize:179,3 MB, free space: 108,2 GB, files on device: 0)
  - ROUTING_TILES: SD-Karte/CGeo/routing/segments4 (Default)[SD-Karte/CGeo/routing/segments4[PERSISTABLE_FOLDER(ROUTING_BASE)#1:p-content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo::/routing/segments4]] (Uri: content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo/document/3438-3261%3ACGeo%2Frouting%2Fsegments4, Av:true, files:1, dirs:0, totalFileSize:179,2 MB, free space: 108,2 GB, files on device: 0)
  - TEST_FOLDER: [Legacy]/data/user/0/cgeo.geocaching/files/unittest (Default)[/data/user/0/cgeo.geocaching/files/unittest[FILE#1:p-file:///data/user/0/cgeo.geocaching/files::/unittest]] (Uri: file:///data/user/0/cgeo.geocaching/files/unittest, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 76,5 GB, files on device: -1)
- Map render theme path: Elevate.zip:Elevate.xml
- PersistedDocumentUris: #1
- UNUSED_TRACK: null
- Persisted Uri Permissions: #1
  - content://com.android.externalstorage.documents/tree/3438-3261%3ACGeo (12. Feb., 17:48):RW
- Database: /data/user/0/cgeo.geocaching/databases/data (v98, Size:52,8 MB) on system internal storage

--- End of system information ---

Additional Information

Migration works fine so far…

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
eddiemuccommented, Feb 18, 2022

migration for beta-users is required

Nope, the calculated coordinate feature is not visible to beta users. Only nightly users are affected, no migration support for those.

0reactions
eddiemuccommented, Feb 19, 2022

Ok, I created now PR #12775 which will simply migrate square brackets to normal ones. No change on syntax for formulas in this one (e.g. users may not use square brackets as “normal” brackets after migration any more)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it fair to lose marks over not putting brackets around ... - Quora
Is it fair to lose marks over not putting brackets around coordinates?
Read more >
What does this square bracket and parenthesis bracket ...
A bracket - [ or ] - means that end of the range is inclusive -- it includes the element listed. A parenthesis...
Read more >
Square Bracket - an overview | ScienceDirect Topics
Square brackets are used to denote concentration of the particular compound in the ... support from the surrounding shales as the gas reservoir...
Read more >
Why not use square brackets? - MATLAB Answers - MathWorks
I realize that the square brackets here are not necessary, but is there some cost to including them? Are parentheses more computationally efficient?...
Read more >
Indentation in square brackets - auctex - Emacs Stack Exchange
I would like to be able to indent content inside square brackets [...] . It would be useful for tikz option lists, for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found