From c4bb29c49cac0528144fdc6753b9c521ddc938c9 Mon Sep 17 00:00:00 2001 From: Andrei Kislitsyn <49092338+AndreiKingsley@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:40:52 +0400 Subject: [PATCH] fix crs (#955) --- .../org/jetbrains/kotlinx/dataframe/geo/GeoDataFrame.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo/GeoDataFrame.kt b/dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo/GeoDataFrame.kt index eacf0cf8b6..a8f6fc0139 100644 --- a/dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo/GeoDataFrame.kt +++ b/dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo/GeoDataFrame.kt @@ -34,12 +34,9 @@ class GeoDataFrame(val df: DataFrame, val crs: CoordinateRe * @return A new `GeoDataFrame` with reprojected geometries and the specified CRS. */ fun applyCrs(targetCrs: CoordinateReferenceSystem): GeoDataFrame { - if (crs == null) { - return GeoDataFrame(df, targetCrs) - } if (targetCrs == this.crs) return this // Use WGS 84 by default TODO - val sourceCRS: CoordinateReferenceSystem = this.crs + val sourceCRS: CoordinateReferenceSystem = this.crs ?: DEFAULT_CRS val transform = CRS.findMathTransform(sourceCRS, targetCrs, true) return GeoDataFrame( df.update { geometry }.with { JTS.transform(it, transform) },