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) },