Skip to content

Commit c4bb29c

Browse files
fix crs (#955)
1 parent 98093dd commit c4bb29c

File tree

1 file changed

+1
-4
lines changed
  • dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo

1 file changed

+1
-4
lines changed

dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo/GeoDataFrame.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ class GeoDataFrame<T : WithGeometry>(val df: DataFrame<T>, val crs: CoordinateRe
3434
* @return A new `GeoDataFrame` with reprojected geometries and the specified CRS.
3535
*/
3636
fun applyCrs(targetCrs: CoordinateReferenceSystem): GeoDataFrame<T> {
37-
if (crs == null) {
38-
return GeoDataFrame(df, targetCrs)
39-
}
4037
if (targetCrs == this.crs) return this
4138
// Use WGS 84 by default TODO
42-
val sourceCRS: CoordinateReferenceSystem = this.crs
39+
val sourceCRS: CoordinateReferenceSystem = this.crs ?: DEFAULT_CRS
4340
val transform = CRS.findMathTransform(sourceCRS, targetCrs, true)
4441
return GeoDataFrame(
4542
df.update { geometry }.with { JTS.transform(it, transform) },

0 commit comments

Comments
 (0)