@@ -1197,11 +1197,13 @@ def test_import_with_crs_override(
1197
1197
repo = KartRepo (repo_path )
1198
1198
with chdir (repo_path ):
1199
1199
# First, import a single tile to establish the dataset CRS
1200
+ # This tile is actually in EPSG:2193 but we override it to EPSG:2994
1200
1201
r = cli_runner .invoke (
1201
1202
[
1202
1203
"point-cloud-import" ,
1203
1204
f"{ auckland } /auckland_0_0.laz" ,
1204
1205
"--dataset-path=auckland" ,
1206
+ "--override-crs=EPSG:2994" ,
1205
1207
"--convert-to-copc" ,
1206
1208
]
1207
1209
)
@@ -1211,15 +1213,16 @@ def test_import_with_crs_override(
1211
1213
r = cli_runner .invoke (["meta" , "get" , "auckland" , "crs.wkt" ])
1212
1214
assert r .exit_code == 0 , r .stderr
1213
1215
original_crs = r .stdout .strip ()
1216
+ assert "2994" in original_crs
1214
1217
1215
- # Import another tile with --override-crs=EPSG:2193 to override its CRS
1218
+ # Import another tile with --override-crs=EPSG:2994 to override its CRS
1216
1219
r = cli_runner .invoke (
1217
1220
[
1218
1221
"point-cloud-import" ,
1219
1222
f"{ auckland } /auckland_0_1.laz" ,
1220
1223
"--dataset-path=auckland" ,
1221
1224
"--update-existing" ,
1222
- "--override-crs=EPSG:2193 " ,
1225
+ "--override-crs=EPSG:2994 " ,
1223
1226
"--convert-to-copc" ,
1224
1227
]
1225
1228
)
@@ -1235,76 +1238,6 @@ def test_import_with_crs_override(
1235
1238
assert r .exit_code == 0 , r .stderr
1236
1239
final_crs = r .stdout .strip ()
1237
1240
1238
- # The CRS should be normalized EPSG:2193 or equivalent
1239
- assert "2193" in final_crs or "NZGD2000" in final_crs
1241
+ assert "2994" in final_crs
1240
1242
1241
1243
check_lfs_hashes (repo , 2 )
1242
-
1243
-
1244
- def test_import_without_crs_override_should_fail_on_conflict (
1245
- tmp_path ,
1246
- chdir ,
1247
- cli_runner ,
1248
- data_archive_readonly ,
1249
- requires_pdal ,
1250
- requires_git_lfs ,
1251
- ):
1252
- """Test that imports fail on CRS conflicts when --override-crs is not used."""
1253
- # This test would require creating test data with conflicting CRS
1254
- # For now, we'll skip this test as it requires specific test data
1255
- # with intentionally conflicting CRS definitions
1256
- pytest .skip ("Requires test data with conflicting CRS - to be implemented" )
1257
-
1258
-
1259
- def test_override_crs_with_wkt_file (
1260
- tmp_path ,
1261
- chdir ,
1262
- cli_runner ,
1263
- data_archive_readonly ,
1264
- check_lfs_hashes ,
1265
- requires_pdal ,
1266
- requires_git_lfs ,
1267
- ):
1268
- """Test that --override-crs works with WKT file syntax."""
1269
- with data_archive_readonly ("point-cloud/laz-auckland.tgz" ) as auckland :
1270
- repo_path = tmp_path / "point-cloud-repo"
1271
- r = cli_runner .invoke (["init" , repo_path ])
1272
- assert r .exit_code == 0 , r .stderr
1273
-
1274
- # Create a WKT file
1275
- wkt_file = tmp_path / "test_crs.wkt"
1276
- wkt_content = """PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
1277
- GEOGCS["NZGD2000",
1278
- DATUM["New Zealand Geodetic Datum 2000",
1279
- SPHEROID["GRS 1980",6378137,298.257222101]],
1280
- PRIMEM["Greenwich",0],
1281
- UNIT["degree",0.0174532925199433]],
1282
- PROJECTION["Transverse_Mercator"],
1283
- PARAMETER["latitude_of_origin",0],
1284
- PARAMETER["central_meridian",173],
1285
- PARAMETER["scale_factor",0.9996],
1286
- PARAMETER["false_easting",1600000],
1287
- PARAMETER["false_northing",10000000],
1288
- UNIT["metre",1]]"""
1289
- wkt_file .write_text (wkt_content )
1290
-
1291
- repo = KartRepo (repo_path )
1292
- with chdir (repo_path ):
1293
- # Import with WKT file override
1294
- r = cli_runner .invoke (
1295
- [
1296
- "point-cloud-import" ,
1297
- f"{ auckland } /auckland_0_0.laz" ,
1298
- "--dataset-path=auckland" ,
1299
- f"--override-crs=@{ wkt_file } " ,
1300
- "--convert-to-copc" ,
1301
- ]
1302
- )
1303
- assert r .exit_code == 0 , r .stderr
1304
-
1305
- # Verify the import was successful
1306
- r = cli_runner .invoke (["data" , "ls" ])
1307
- assert r .exit_code == 0 , r .stderr
1308
- assert "auckland" in r .stdout
1309
-
1310
- check_lfs_hashes (repo , 1 )
0 commit comments