Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[fix] Trip Layer: issues for path from 2 points (#2101)

Igor Dykhta7f01ca1c9e72
diff --git a/src/layers/src/trip-layer/trip-utils.ts b/src/layers/src/trip-layer/trip-utils.ts
index 5e6d1a673..217497800 100644
--- a/src/layers/src/trip-layer/trip-utils.ts
+++ b/src/layers/src/trip-layer/trip-utils.ts
@@ -121,9 +121,7 @@ export function parseTripGeoJsonTimestamp(dataToFeature: any[]) {
// Analyze type based on coordinates of the 1st lineString
// select a sample trip to analyze time format
const empty = {dataToTimeStamp: [], animationDomain: null};
- const sampleTrip = dataToFeature.find(
- f => f && f.geometry && f.geometry.coordinates && f.geometry.coordinates.length >= 3
- );
+ const sampleTrip = dataToFeature.find(f => f?.geometry?.coordinates?.[0]?.length > 3);
// if no valid geometry
if (!sampleTrip) {