{"record":{"id":"8dba2fd618f6c501","repo":"mifi/lossless-cut","slug":"no-gps-points-found","errorCode":null,"errorMessage":"No GPS points found","messagePattern":"No GPS points found","errorType":"exception","errorClass":"UserFacingError","httpStatus":null,"severity":"warning","filePath":"src/renderer/src/components/GpsMap.tsx","lineNumber":57,"sourceCode":"  const [points, setPoints] = useState<Awaited<ReturnType<typeof getGpsTrack>>>();\n\n  useEffect(() => {\n    (async () => {\n      try {\n        const allGpsPoints = await getGpsTrack({ filePath, streamIndex });\n\n        // limit number of points, or else severe map slowdown\n        const maxPointsToShow = 500;\n        let gpsPoints = allGpsPoints;\n        if (allGpsPoints.length > maxPointsToShow) {\n          gpsPoints = Array.from({ length: maxPointsToShow }).flatMap((_, i) => {\n            const p = allGpsPoints[Math.floor(i * (allGpsPoints.length / maxPointsToShow))];\n            return p != null ? [p] : [];\n          });\n        }\n\n        if (gpsPoints.length === 0) {\n          throw new UserFacingError(i18n.t('No GPS points found'));\n        }\n\n        setPoints(gpsPoints);\n      } catch (err) {\n        handleError({ err });\n      }\n    })();\n  }, [filePath, handleError, streamIndex]);\n\n  const firstPoint = points?.[0];\n\n  if (points == null || firstPoint == null) {\n    return null;\n  }\n\n  return (\n    <div style={{ width: '80vw', height: '60vh' }}>\n      <MapContainer center={[firstPoint.lat, firstPoint.lng]} zoom={16} style={{ width: '100%', height: '100%' }}>","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/mifi/lossless-cut/blob/3b9a59c288bf6e11076b583c932cfa48ddab3b02/src/renderer/src/components/GpsMap.tsx#L39-L75","documentation":"Thrown in GpsMap.tsx after extracting GPS points from a stream's metadata/subtitle track and (optionally) down-sampling to maxPointsToShow, when the resulting gpsPoints array is empty. The map component cannot draw a track without points, so it surfaces the failure via handleError. It indicates the selected stream was parsed but yielded zero usable coordinates.","triggerScenarios":"Selecting a telemetry/GPS stream whose SRT or subtitle data parsed to no coordinate frames; a DJI/Garmin SRT where the regex/parser matched nothing; a stream flagged as gps but containing only non-GPS text; corrupt or truncated metadata that dropped every point.","commonSituations":"DJI drone footage whose SRT track is absent or in an unrecognized format; a GPS subtitle stream in a locale/format the parser does not support; selecting the wrong stream index as the GPS source; metadata stripped during a previous transcode.","solutions":["Confirm the file actually contains a GPS/telemetry track using `ffprobe -show_streams` and inspect the subtitle/SRT data.","Select the correct stream index that carries the GPS data in the streams selector.","If the format is unsupported, extract the SRT/subtitle to a file and verify coordinates are present.","Catch the error and show 'this stream has no GPS data' rather than failing the whole map."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// After computing gpsPoints, decide whether to render the map at all\nif (!gpsPoints || gpsPoints.length === 0) {\n  setPoints(undefined); // render 'no GPS data' state instead of throwing\n  return;\n}","typeGuard":"const hasGpsPoints = (pts: unknown): pts is GpsPoint[] => Array.isArray(pts) && pts.length > 0;","tryCatchPattern":"try {\n  // ...extract gpsPoints...\n  if (gpsPoints.length === 0) throw new UserFacingError(i18n.t('No GPS points found'));\n  setPoints(gpsPoints);\n} catch (err) {\n  handleError({ err }); // already routed in source\n}","preventionTips":["Confirm the stream actually carries GPS data with ffprobe before selecting it.","Select the correct stream index that contains the telemetry/SRT track.","Render an explicit empty-state UI instead of surfacing the error when no points exist.","Handle the unsupported SRT format gracefully by warning the user."],"tags":["gps","map","telemetry","metadata","srt","dji"],"backgroundTag":null,"analyzedSha":"3b9a59c288bf6e11076b583c932cfa48ddab3b02","analyzedAt":"2026-08-12T20:54:25.651Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}