Skip to content

Conversation

@ptpt
Copy link
Member

@ptpt ptpt commented Jun 24, 2025

This pull request refactors type handling across multiple modules in the mapillary_tools package to improve code consistency and maintainability. Key changes include replacing references to types.UserItem with config.UserItem, introducing new serializers for metadata, and simplifying GPX-related functionality.

Type Refactoring

  • Replaced types.UserItem with config.UserItem in mapillary_tools/authenticate.py to align with the new UserItem schema defined in mapillary_tools/config.py. Updated functions such as _validate_profile, _verify_user_auth, and _list_all_profiles accordingly. [1] [2] [3] [4] [5] [6]

Serializer Integration

  • Introduced DescriptionJSONSerializer and GPXSerializer for metadata handling in mapillary_tools/serializer. Updated methods in mapillary_tools/history.py, process_geotag_properties.py, and process_sequence_properties.py to use these serializers for metadata serialization and validation. [1] [2] [3] [4] [5]

GPX Handling Improvements

  • Added GPXSerializer to mapillary_tools/serializer/gpx.py, enabling streamlined serialization of GPX data. This includes handling image sequences, video metadata, and error metadata as GPX tracks and points.

Utility Function Updates

  • Replaced types.datetime_to_map_capture_time and types.map_capture_time_to_datetime with build_capture_time and parse_capture_time from serializer.description in geotag_images_from_gpx.py and sample_video.py. This simplifies date-time conversions. [1] [2]

Code Cleanup

  • Removed unused imports and consolidated type definitions in config.py. Simplified DEFAULT_MAPILLARY_FOLDER initialization and refactored load_user and list_all_users functions to use the new UserItem type. [1] [2] [3]

@ptpt ptpt changed the title feat: export as GPX feat: export descriptions as GPX Jun 24, 2025
@ptpt ptpt merged commit 5d79955 into main Jun 24, 2025
16 checks passed
@ptpt ptpt deleted the feat-export-as-geojson branch June 24, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants