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

Incomplete segmentation lost useful vessel trajectory information #83

Closed
tsuzzy opened this issue Jul 18, 2024 · 0 comments
Closed

Incomplete segmentation lost useful vessel trajectory information #83

tsuzzy opened this issue Jul 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tsuzzy
Copy link
Collaborator

tsuzzy commented Jul 18, 2024

Description
The segmentation function split_timedelta, in combination with _splits_idx and _segment_rng, produce incomplete segments when processing AIS data. This issue potentially removes useful vessel information from the segmented tracks, leaving the incomplete visualization of vessel movements.

Sample code to reproduce the issue

MMSI = 636018124

# Set the start and end times for the query
start_time = datetime.strptime("2018-01-01 00:00:00", '%Y-%m-%d %H:%M:%S')
end_time = datetime.strptime("2018-01-31 00:00:00", '%Y-%m-%d %H:%M:%S')

with aisdb.SQLiteDBConn(dbpath=dbpath) as dbconn:
    qry = aisdb.DBQuery(
        dbconn=dbconn,
        dbpath='./data/meridian_2018_vacuumed.db',
        start=start_time,
        end=end_time,
        mmsi = MMSI,
        callback=aisdb.database.sqlfcn_callbacks.in_timerange_hasmmsi,
    )
    rowgen = qry.gen_qry()
    tracks = aisdb.track_gen.TrackGen(rowgen, decimate=False)
    
    # Split the tracks into segments based on the maximum time interval
    track_segments = aisdb.split_timedelta(tracks, timedelta(hours=24))
    
    aisdb.web_interface.visualize(
        track_segments,
        domain=domain,
        visualearth=True,
        open_browser=True,
    )

Before segmentation:
image

After segmentation with 24 hours as the max time interval:
image

Expected output is for the trajectory to be split into multiple single-voyage track segments. However, the actual output may only contain partial segments of these expected trajectories.

@tsuzzy tsuzzy self-assigned this Jul 18, 2024
@tsuzzy tsuzzy added the bug Something isn't working label Sep 9, 2024
@tsuzzy tsuzzy closed this as completed in ec2747d Sep 11, 2024
tsuzzy added a commit that referenced this issue Sep 11, 2024
Fix #83 track segments visualization issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant