Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit precision in gpx.fmt #156

Closed
WGroleau opened this issue Sep 12, 2022 · 9 comments
Closed

Limit precision in gpx.fmt #156

WGroleau opened this issue Sep 12, 2022 · 9 comments

Comments

@WGroleau
Copy link

WGroleau commented Sep 12, 2022

The following request has some inaccuracies due to a lack of understanding on my part. I have suggested an alternative in the following comments.

I suggest this file should format lat/long to seven decimal places or less. Seven would be one centimeter or less.

(-p gpx-fmt causes -c to be ignored.)

With the claim that there are devices with greater accuracy, an alternative might be for some other part of the perl code to make the -c not be ignored. Otherwise everyone would have to maintain their own copy of gpx.fmt for whatever precision they prefer.

@StarGeekSpaceNerd
Copy link
Collaborator

This post disagrees with that assessment.

See the -c (-coordFormat) option. By default, exiftool will copy with 8 decimal points for the seconds, but only two when printing.

If you're using the -n (--printConv) option, then you're getting the raw number. See the above -coodFormat link if you want to limit the output.

@WGroleau
Copy link
Author

WGroleau commented Sep 12, 2022

The issue is with gpx.fmt (see title). -p gpx-fmt causes -c to be ignored.

I did not use -n but I suspect it would also be ignored.

But your link tells me I am wrong about accuracy—that there are devices with greater accuracy than the GPS system can provide. I've edited the suggestion to acknowledge that possibility.

@StarGeekSpaceNerd
Copy link
Collaborator

Ah, my apologies. I indeed did not read the title closely enough.

If you look at the gpx.fmt file you will see that the tag names in it all have a trailing hashtag. This is a shortcut for the -n (--printConv) option. So that option is in effect and will override the -coodFormat option. I would think this is to prevent problems where a user might add options that would affect the output and lead to undesired results, which would make it harder to trouble shoot.

If you change line 30 to remove the hashtags, then the -coodFormat option should work. Line 31 could also be edited if desired, but line 32 should probably be left alone.

@WGroleau
Copy link
Author

OK, I would revise the request to leave the # out of the "official" file so that the user can decide the format on the command line.

@boardhead
Copy link
Contributor

I think it is best to write the full precision to the GPX file by default. If I made the change you suggest then people would complain about a loss in precision.

@WGroleau
Copy link
Author

Then perhaps text in the file comments and in the man page to explain the option for folks who have the same lack of knowledge that I had. Not knowing that the # in the file overrides the -coordformat might induce some frustration.

@boardhead
Copy link
Contributor

boardhead commented Sep 13, 2022

I like the idea of adding a note to this effect in the gpx.fmt file. Here is what I came up with:

#            4) Coordinates are written at full resolution.  To change this,
#               remove the "#" from the GPSLatitude/Longitude tag names below
#               and use the -c option to set the desired precision.
  • Phil

@WGroleau
Copy link
Author

WGroleau commented Sep 13, 2022 via email

@boardhead
Copy link
Contributor

The -d isn’t needed now since you have put the equivalent into the format file.

Good point, thanks. I'll update this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants