Skip to content

Upload track as ZIP instead of GPX to reduce file size (#64) #506

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Andyporras
Copy link
Contributor

@Andyporras Andyporras commented Feb 10, 2025

This PR modifies the track upload process by compressing the GPX file into a ZIP before uploading to the OSM server, addressing issue,

Changes:

  • Instead of uploading a raw GPX file, the track is now zipped before upload.
  • Ensures compatibility with OSM, which supports ZIP uploads natively.
  • Reduces file size, making uploads faster and more efficient.

Benefits:

  • Smaller file size → Saves bandwidth and reduces upload time.
  • Optimized for mobile users → Less data consumption when not on Wi-Fi.
  • Preserves all track data → No loss of information in the compression process.

Dependency:
⚠️ Before merging this PR, PR #501: Improved GPX Sharing: Share as ZIP must be approved and merged.

Let me know if any adjustments are needed! 🚀

* @param fileGPX GPX file.
* @return The created ZIP file or null if an error occurred.
*/
public static File zipFile(Context context, long trackId, File fileGPX) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zipGPXFile sounds like a better name for this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready ✅

@jamescr
Copy link
Member

jamescr commented Feb 11, 2025

Check if osmapi needs a PR to better suit this purpose.

@Andyporras Andyporras reopened this Feb 11, 2025
@jamescr jamescr added this to the 2025.07 milestone Feb 28, 2025
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

Successfully merging this pull request may close these issues.

2 participants