tsteven4 [Sun, 19 Nov 2023 02:36:42 +0000 (19:36 -0700)]
simplify usage of homebrew on CI macos-11. (#1234)
homebrew installs are taking an extreme amount of time on macos-11,
with the following message:
Warning: You are using macOS 11.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
To alleviate this pain skip the installation of jing and all it's
dependencies on macos-11.
tsteven4 [Sun, 19 Nov 2023 01:18:04 +0000 (18:18 -0700)]
convert ozi to Format class. (#1232)
* convert ozi to Format class.
There is a subtle difference in the writer, the index is now
reset for every invocation. This only matters if the writer is
used more than once. I believe this was the intent.
* fool with QIODevice and it's inheritence of QIODeviceBase.
tsteven4 [Mon, 13 Nov 2023 23:33:14 +0000 (16:33 -0700)]
jeeps function pointers, GPS_PPacket const correctness, GPS_Serial_[OSP]Packet -> GPS_Serial_Packet (#1215)
* use using for jeeps function prototypes.
* const correctness wrt GPS_PPacket.
The important bit here is in gpssend.cc, Build_Serial_Packet used to rececive a 1KB packet by copy, now it is by const reference.
* delete accidentally committed file.
* rename GPS_PPacket -> GPS_Packet.
original jeeps used GPS_SXXX, GPS_OSXXX, GPS_PXXX for the structure
tag, a typedef of the structure, and a pointer to a typedef of the
structure. In the case of GPS_PPacket this convention was no longer
followed.
* change GPS_Packet back to a structure.
* try harder to change GPS_Packet back to a struct.
tsteven4 [Mon, 30 Oct 2023 00:35:42 +0000 (18:35 -0600)]
consolidate handling of extensions in gpx writer. (#1200)
This is a user visible change.
Previously if gARmIN sPECIAL dATA existed and both garminextensions
and humminbirdextensions were false then the gpx writer would
write a subset if it (and not passthrough any gpx -> gpx data.)
If gARmIN sPECIAL dATA existed and either extension option was true,
then a different subset would be written (and any gpx -> gpx data would
not be passed through.) Now the garminextensions option must
used to have any gARmIN sPECIAL dATA data written.
Previously, when passing through extension data from the gpx reader to
the gpx writer, some elements of the garmin and humminbird extensions
were not included. Now, all foreign elements are included. As before,
passthrough is only used when both extension options are false.
tsteven4 [Fri, 27 Oct 2023 20:07:24 +0000 (14:07 -0600)]
support optional start elements in xmlstreamwriter. (#1193)
this adds methods to xmlstreamwriter to allow conditional writing
of a start element. The conditional element will only be written to
the stream if it has children, which is deteremined when the condtional
element is ended. This simplifies writing of such elements as the
writer does not need to know if it will subsequently write children or
not.
tsteven4 [Mon, 23 Oct 2023 17:57:37 +0000 (11:57 -0600)]
enhance gpx test to validate gpx writer. (#1191)
* enhance gpx test to validate gpx writer.
this reveals our writer producing a schema violation, an exception
is made to avoid testing with this input. The exception should
be removed when we fix the gpx writer.
* fix write order of gpx elements we just pass through.
* collapse writing of waypoint elements common to wpts, rtepts, trkpts.
1. we were off by one when deciding if we could just concatentate
the generated suffix to the name, failing to use the last available
character.
2. when attempting to copy the generated suffix to a presumably
shortened name, and the generated suffix was longer than the name,
the target of the copy was outside the name buffer. In the common
case that the rank of size_t was greater than the rank of int, the
target was well beyond the end of name, not before as one would expect
with signed arithmetic.
With the new algorithm when the target length is insufficient to
fit both the name and the suffix we will only truncate the name as
required to fit the truncated name and the complete suffix in the
target length(as opposed to the original length of the name).
We fatal if this is not possible.
Add a test case to exercise the make unique code.
* fix reference mode.
* add notes for future enhancements
* fix testcase cut and paste booboo
* refactor mkshort input from char* to QByteArray.
Tyler MacDonald [Mon, 28 Aug 2023 22:31:04 +0000 (18:31 -0400)]
Add support for Google Takeout Location History (#1160)
* Add support for Google Takeout Location History
This adds support for parsing the location history provided by Google Takeout.
This makes it possible to convert a month's, year's, or your entire location
history at once instead of having to export one day's history at a time on
Google Maps.
There is documentation in the `xmldoc` folder with some examples.
It works great, but there are one, possibly two, other additions I'd like to
make in following diffs:
1. Add the ability to select date ranges. For example, I went on a road trip
that started in the last week of February, but right now I can only select
tracks at the resolution of a whole month.
2. Add support for the higher-resolution "roadSegment" blocks in newer
"activitySegment" blocks. This will have to be optional as you have to
query the Google Maps API to get lat/long, which costs money. However,
if you're willing to pay for it, you can get great detail out of it.
They look like this:
* don't leak objects when we skip events at exact lat/lon 0/0
* use a reference (even though the compiler would have optimized that away)
* rename to googletakeout
* fix docs
* Address code review requests
* add `googletakeout.h` to HEADERS
* convert most `#define`s to static members
* don't pollute global namespace
* rename logging functions
* convert some methods to static functions for clang-tidy
* `title_case` loop by reference instead of by index (clang-tidy)
* better use of debugging levels
* drop dead simplifiedRawPath code for now
* drop empty tracks
* default constructor for GoogleTakeoutInputStream
* add some tests that check the content of the data
Also, I found some unofficial documentation about the location history
format and added that (thanks @CarlosBergillos !)
* apply @tsteven4 's patch. thank you!!
* add license
* fix logging
* As I assigned the correct license to my code, I am skeptical that this makes a difference, but give Robert co-copyright.
* make the test more boring
* rm xml_slice
* revert constructor change from @tsteven4 's patch
tsteven4 [Wed, 23 Aug 2023 16:32:23 +0000 (10:32 -0600)]
resolve maintanence issue in interpolate & resample filters. (#1161)
* resolve maintanence issue in interpolate filter.
Instead of manually creating a deep copy of the route list with
an empty waypoint list we operate on the original route list by
swapping it's waypoint list with an empty list. This is both more
efficient and easier to maintain.
* resolve maintanence issues in resample filter.
Instead of manually creating a deep copy of the route list with
an empty waypoint list we operate on the original route list by
swapping it's waypoint list with an empty list. This is both more
efficient and easier to maintain.
tsteven4 [Sat, 5 Aug 2023 15:57:33 +0000 (09:57 -0600)]
Introduce efficient member functions for deleting waypoints (#1151)
* Introduce efficient member functions for deleting waypoints
New functions with complexity O(n) for deleting pre-marked
waypoints are:
WaypointList::del_wpts
RouteList::del_wpts
del_wpts
route_del_wpts
track_del_wpts
Use those functions instead of the inefficient versions
WaypointList::waypt_del
RouteList::del_wpt
waypt_del
route_del_wpt
track_del_wpt.
When these functions are using while looping over a waypoint list
the overall complexity is O(n^2). This is because these functions
themselves amortize to O(n).
1. With the length option the last point deleted took the total error
over the specified limit.
2. When computing the total error if another point is deleted it was
possible to refer to an xte record that needed to be updated due to
the deletion of one of its neighbors.
* wip on reduced complexity simplify filter.
* mimic ineheitence of new_trkseg flag in simplify filter.
1. With the length option the last point deleted took the total error
over the specified limit.
2. When computing the total error if another point is deleted it was
possible to refer to an xte record that needed to be updated due to
the deletion of one of its neighbors.
reduce complexity of gdb waypt searchs from O(n^2) to O(n) (#1141)
* use QHash for gdb waypoint searches.
This reduces the complexity from O(n^2) to O(n).
For the reader two parallel hashes are maintained with different
keys but identical values. This is necessary because sometimes
we want to match the name and position, and other times we just want
to match the name.
* workaround missing qHashMulti in Qt5.
and supply missing default for our qHash functions.
* fix MSVC C2666 errors due to an erroneous assumption.
In Qt6 the return type of qHash, and the type of the seed,
happens to be the same as QHash::size_type.
However, this isn't true in Qt5.
Robert Lipe [Wed, 19 Jul 2023 11:01:24 +0000 (06:01 -0500)]
Deprecate navilink, sbn, sbp. (#1138)
As discussed in
https://github.com/GPSBabel/gpsbabel/pull/1090
these units have long since been deprecated by their maker. We have no
known remaining users. Numerous attempts (including phone calls and
attempt to contact via the windsurfing community) to reach the last
known users have all failed.
tsteven4 [Tue, 16 May 2023 21:44:47 +0000 (15:44 -0600)]
refactor unicsv & xcsv date time handling (#1114)
* refactor unicsv date time handling.
* restrict utc option range to match Qt offsetfromutc
* move xcsv from C-style legacy time to Qt.
* fill in lower order date/time fields when parsing.
* don't return date/time if we don't have one!
* enhance xcsv date/time testing, fix bug.
* csv format date time adjustements.
use QDateTime::fromString to parse iso date times.
return invalid QTime from addhms if parsing fails entirely.
* datetime display fixes.
For the xcsv writer:
avoid priting date/time fields when there isn't a valid date/time.
when printing with am/pm use times from a 12 hour clock.
add support for printing dotnet time.
use QDateTime::toString to print ISO time.
For the xcsv and unicsv readers:
use QDateTime::fromString instead of xml_parse_time when reading
ISO datetimes. This avoids xml_parse_times intentional odd behavior
of treating non-timezoned times as UTC.
add a test of the xcsv writer time related fields. This only runs
in America/Denver time zone. As setting the time zone is system
dependent the test only runs if tzselect is available. If so it
assumes America/Denver is available.
correct documentation to give a sensible format for xcsv field GMT_TIME.
* add reference files for new test.
* silence xcsv reader conversion warnings on empty strings.
* warn on parse errors reading excel time.
* xcsv date/time fixes.
fix addhms to account for 12/24 hour clock.
don't print invalid datetimes with iso_time, iso_time_ms.
add testcases to exercise all the xcsv reader date/time flavors.
* clarify HMSL, HMSG wrt 12/24 hour clocks.
* add missing reference file.
* enhance xcsv for HMS[L|G] before or after [LOCAL|GMT]_TIME
* restore YYYYYMMDD to use UTC.
This has been broken for some time. Mail from 2012 indicates the intent
was UTC (https://sourceforge.net/p/gpsbabel/mailman/message/29544538/)
* unicsv review catches
don't ripple into trouble with msec rounding.
pass outputs that may or may not be written as references.
* retire xcsv fields HMSG_TIME, HMSL_TIME.
This is potentially a user visible change. It could require
users to rewrite any style files they have created that use
these fields.
These are replaced by repeated use of GMT_TIME and LOCAL_TIME.
This eliminates our pain over 12/24 hour clock issues. strptime/
strftime (as well as QTime) have distinct conversion specifiers
for hours with 12/24 hour clocks. Our support for HMSG_TIME,
HMSL_TIME used integer conversion specifiers for hours, minutes
and seconds. This made it difficult to decide if a 12 or 24 hour
clock should be used, and made it impossible to have reduced
precision values with 12 hour clock using an AM/PM designation.
We also always printed AM/PM designations.