points2prints
¶
Python package for the points_to_prints project.
Modules:
-
bd_topo–Specific to the BD TOPO dataset.
-
lidar_hd–Specific to the LiDAR HD dataset.
-
main–Main entry point for the CLI application.
-
outline–Process the initial outlines for the pipeline.
-
pipeline–Run the pipeline with the expected structure, using LiDAR HD and BD TOPO as the two inputs.
-
point_cloud–Process the point clouds.
-
polygon_deformation–Experiments with the polygon deformation algorithm and visualisation of its behaviour on toy datasets.
-
roof–Create the roofs.
-
utils–Generic utilities
-
validation–Preparation of the validation dataset and metrics utilities.
bd_topo
¶
Specific to the BD TOPO dataset.
Modules:
-
convert–
Functions:
-
convert_bd_topo_implementation–Convert a BD TOPO file to Parquet format.
convert_bd_topo_implementation
¶
convert_bd_topo_implementation(input_path: Path, output_path: Path, input_output: InputOutput)
Convert a BD TOPO file to Parquet format.
Parameters:
-
(input_path¶Path) –Path to the input BD TOPO file containing all the layers including the buildings layer (e.g., a .gpkg file).
-
(output_path¶Path) –Path to the output parquet file.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/bd_topo/convert.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
convert
¶
Functions:
-
convert_bd_topo_call–Convert a BD TOPO file to Parquet format.
-
convert_bd_topo_implementation–Convert a BD TOPO file to Parquet format.
convert_bd_topo_call
¶
convert_bd_topo_call(input_path: Path, output_path: Path, input_output: InputOutput, verbose: Verbose)
Convert a BD TOPO file to Parquet format.
Parameters:
-
(input_path¶Path) –Path to the input BD TOPO file containing all the layers including the buildings layer (e.g., a .gpkg file).
-
(output_path¶Path) –Path to the output parquet file.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
Source code in points2prints/bd_topo/convert.py
convert_bd_topo_implementation
¶
convert_bd_topo_implementation(input_path: Path, output_path: Path, input_output: InputOutput)
Convert a BD TOPO file to Parquet format.
Parameters:
-
(input_path¶Path) –Path to the input BD TOPO file containing all the layers including the buildings layer (e.g., a .gpkg file).
-
(output_path¶Path) –Path to the output parquet file.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/bd_topo/convert.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
lidar_hd
¶
Specific to the LiDAR HD dataset.
Modules:
-
download–
Functions:
-
download_lidar_hd_data_implementation–Download LiDAR HD data for a specified bounding box.
download_lidar_hd_data_implementation
¶
download_lidar_hd_data_implementation(xmin: int, xmax: int, ymin: int, ymax: int, output_path_template: Path, input_output: InputOutput, concurrency: Optional[int])
Download LiDAR HD data for a specified bounding box.
Parameters:
-
(xmin¶int) –Minimum X coordinate of the requested bounding box in EPSG:2154.
-
(xmax¶int) –Maximum X coordinate of the requested bounding box in EPSG:2154.
-
(ymin¶int) –Minimum Y coordinate of the requested bounding box in EPSG:2154.
-
(ymax¶int) –Maximum Y coordinate of the requested bounding box in EPSG:2154.
-
(output_path_template¶Path) –Path to save the downloaded files. The path can contain the values {xmin}, {ymin}, {xmax}, {ymax}, {file_name} which will be replaced with the corresponding values. The values also have their kilometre equivalents {xmin_km}, {ymin_km}, {xmax_km}, {ymax_km}.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(concurrency¶Optional[int]) –Maximum number of concurrent download workers.
Source code in points2prints/lidar_hd/download.py
download
¶
Functions:
-
collect_existing_tiles–Collect the best matching WFS tile for each requested tile box.
-
download_lidar_hd_call–Download LiDAR HD data for a specified bounding box.
-
download_lidar_hd_data_async–Download LIDAR HD tiles covering a requested EPSG:2154 bounding box.
-
download_lidar_hd_data_implementation–Download LiDAR HD data for a specified bounding box.
-
download_tiles–Download the selected tiles in parallel.
-
validate_downloaded_files–Validate downloaded LAZ files using PDAL.
collect_existing_tiles
async
¶
collect_existing_tiles(tiles: List[Box2154], concurrency: int = DEFAULT_CONCURRENCY) -> Dict[str, Optional[str]]
Collect the best matching WFS tile for each requested tile box.
Parameters:
-
(tiles¶List[Box2154]) –Requested tiles in EPSG:2154.
-
(concurrency¶int, default:DEFAULT_CONCURRENCY) –Maximum HTTP concurrency for the client.
Returns:
Source code in points2prints/lidar_hd/download.py
download_lidar_hd_call
¶
download_lidar_hd_call(xmin: int, xmax: int, ymin: int, ymax: int, output_path_template: Path, input_output: InputOutput, verbose: Verbose, concurrency: Optional[int])
Download LiDAR HD data for a specified bounding box.
Parameters:
-
(xmin¶int) –Minimum X coordinate of the requested bounding box in EPSG:2154.
-
(xmax¶int) –Maximum X coordinate of the requested bounding box in EPSG:2154.
-
(ymin¶int) –Minimum Y coordinate of the requested bounding box in EPSG:2154.
-
(ymax¶int) –Maximum Y coordinate of the requested bounding box in EPSG:2154.
-
(output_path_template¶Path) –Path to save the downloaded files. The path can contain the values {xmin}, {ymin}, {xmax}, {ymax}, {file_name} which will be replaced with the corresponding values. The values also have their kilometre equivalents {xmin_km}, {ymin_km}, {xmax_km}, {ymax_km}.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
-
(concurrency¶Optional[int]) –Maximum number of concurrent download workers.
Source code in points2prints/lidar_hd/download.py
download_lidar_hd_data_async
async
¶
download_lidar_hd_data_async(xmin: int, xmax: int, ymin: int, ymax: int, output_path_template: Path, input_output: InputOutput, concurrency: Optional[int]) -> None
Download LIDAR HD tiles covering a requested EPSG:2154 bounding box.
Parameters:
-
(xmin¶int) –Minimum X coordinate of the requested bounding box in EPSG:2154.
-
(xmax¶int) –Maximum X coordinate of the requested bounding box in EPSG:2154.
-
(ymin¶int) –Minimum Y coordinate of the requested bounding box in EPSG:2154.
-
(ymax¶int) –Maximum Y coordinate of the requested bounding box in EPSG:2154.
-
(output_path_template¶Path) –Output path template supporting the tile placeholders.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(concurrency¶Optional[int]) –Maximum HTTP concurrency for tile discovery and downloading.
Source code in points2prints/lidar_hd/download.py
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | |
download_lidar_hd_data_implementation
¶
download_lidar_hd_data_implementation(xmin: int, xmax: int, ymin: int, ymax: int, output_path_template: Path, input_output: InputOutput, concurrency: Optional[int])
Download LiDAR HD data for a specified bounding box.
Parameters:
-
(xmin¶int) –Minimum X coordinate of the requested bounding box in EPSG:2154.
-
(xmax¶int) –Maximum X coordinate of the requested bounding box in EPSG:2154.
-
(ymin¶int) –Minimum Y coordinate of the requested bounding box in EPSG:2154.
-
(ymax¶int) –Maximum Y coordinate of the requested bounding box in EPSG:2154.
-
(output_path_template¶Path) –Path to save the downloaded files. The path can contain the values {xmin}, {ymin}, {xmax}, {ymax}, {file_name} which will be replaced with the corresponding values. The values also have their kilometre equivalents {xmin_km}, {ymin_km}, {xmax_km}, {ymax_km}.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(concurrency¶Optional[int]) –Maximum number of concurrent download workers.
Source code in points2prints/lidar_hd/download.py
download_tiles
async
¶
download_tiles(name_to_url: Dict[str, str], name_to_path: Dict[str, Path], concurrency: int = DEFAULT_CONCURRENCY) -> Tuple[int, List[Tuple[str, str]], List[Path]]
Download the selected tiles in parallel.
Parameters:
-
(name_to_url¶Dict[str, str]) –Mapping from tile name to download URL.
-
(name_to_path¶Dict[str, Path]) –Mapping from tile name to output path.
-
(concurrency¶int, default:DEFAULT_CONCURRENCY) –Maximum number of concurrent download workers.
Returns:
-
tuple[int, list[tuple[str, str]], list[Path]]–Downloaded count, failures, and successfully written files.
Source code in points2prints/lidar_hd/download.py
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
validate_downloaded_files
¶
Validate downloaded LAZ files using PDAL.
Parameters:
Returns:
Source code in points2prints/lidar_hd/download.py
main
¶
Main entry point for the CLI application. This module defines the main Typer app and registers all sub-apps for different functionalities.
outline
¶
Process the initial outlines for the pipeline.
Modules:
intersections
¶
Functions:
-
intersections_call–summary
intersections_call
¶
intersections_call(bd_topo_file: Path, output_edges_file: Path, output_intersections_file: Path, output_building_groups_file: Path, input_output: InputOutput, verbose: Verbose)
summary
Parameters:
-
(bd_topo_file¶Path) –Input BD TOPO file (Parquet) containing the building geometries.
-
(output_edges_file¶Path) –Output Parquet file where the edges will be saved.
-
(output_intersections_file¶Path) –Output Parquet file where the intersections will be saved.
-
(output_building_groups_file¶Path) –Output Parquet file where the building groups will be saved.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
Source code in points2prints/outline/intersections.py
pipeline
¶
Run the pipeline with the expected structure, using LiDAR HD and BD TOPO as the two inputs.
Modules:
Functions:
-
compute_metrics_implementation–Compare the pipeline output to a validation dataset.
-
prepare_bd_topo_implementation–Prepare the BD TOPO data for the pipeline.
-
run_pipeline_implementation–Execute the complete pipeline to compute roofprints from LiDAR HD data.
compute_metrics_implementation
¶
compute_metrics_implementation(validation_dataset_indiv_file: Path, validation_dataset_aggreg_file: Path, bd_topo_file: Path, tiles_dirs: List[Path], output_comparison_dir: Path, output_format: str, id_column: str, spacing_m: float, keep_columns: Optional[List[str]], input_output: InputOutput, num_workers: Optional[int])
Compare the pipeline output to a validation dataset.
Parameters:
-
(validation_dataset_indiv_file¶Path) –Path to the individual building validation dataset (Parquet file).
-
(validation_dataset_aggreg_file¶Path) –Path to the aggregated building validation dataset (Parquet file).
-
(bd_topo_file¶Path) –Path to the BD TOPO polygon dataset to compare.
-
(tiles_dirs¶List[Path]) –List of tile directories containing the pipeline output to compare.
-
(output_comparison_dir¶Path) –Directory where the comparison results will be saved.
-
(output_format¶str) –Format to save the comparison results (e.g., 'parquet', 'csv', 'json').
-
(id_column¶str) –Name of the column containing the building IDs in the datasets.
-
(spacing_m¶float) –Spacing in meters to use for the comparison.
-
(keep_columns¶Optional[List[str]]) –List of additional column names to keep in the output comparison results (in addition to the id_column). If None, only the id_column will be kept.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(num_workers¶Optional[int]) –Number of worker processes for multiprocessing (None = CPU count)
Source code in points2prints/pipeline/pipeline.py
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 | |
prepare_bd_topo_implementation
¶
prepare_bd_topo_implementation(bd_topo_source_file: Path, bd_topo_output_dir: Path, input_output: InputOutput)
Prepare the BD TOPO data for the pipeline.
Parameters:
-
(bd_topo_source_file¶Path) –Path to the source BD TOPO file (e.g., GeoPackage) to prepare.
-
(bd_topo_output_dir¶Path) –Directory where the prepared BD TOPO files will be saved.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/pipeline/bd_topo.py
run_pipeline_implementation
¶
run_pipeline_implementation(bd_topo_dir: Path, tile_dir: Path, stop_after_roofprints: bool, stop_after_lod22: bool, input_output: InputOutput, num_workers: Optional[int])
Execute the complete pipeline to compute roofprints from LiDAR HD data.
Parameters:
-
(bd_topo_dir¶Path) –Directory containing BD TOPO data
-
(tile_dir¶Path) –Working directory for intermediate and output files
-
(stop_after_roofprints¶bool) –Whether to stop after computing roofprints
-
(stop_after_lod22¶bool) –Whether to stop after computing LoD2.2 models
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(num_workers¶Optional[int]) –Number of worker processes for multiprocessing (None = CPU count)
Source code in points2prints/pipeline/pipeline.py
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | |
bd_topo
¶
Functions:
-
prepare_bd_topo_call–Prepare the BD TOPO data for the pipeline.
-
prepare_bd_topo_implementation–Prepare the BD TOPO data for the pipeline.
prepare_bd_topo_call
¶
prepare_bd_topo_call(bd_topo_source_file: Path, bd_topo_output_dir: Path, input_output: InputOutput, verbose: Verbose)
Prepare the BD TOPO data for the pipeline.
Parameters:
-
(bd_topo_source_file¶Path) –Path to the source BD TOPO file (e.g., GeoPackage) to prepare.
-
(bd_topo_output_dir¶Path) –Directory where the prepared BD TOPO files will be saved.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
Source code in points2prints/pipeline/bd_topo.py
prepare_bd_topo_implementation
¶
prepare_bd_topo_implementation(bd_topo_source_file: Path, bd_topo_output_dir: Path, input_output: InputOutput)
Prepare the BD TOPO data for the pipeline.
Parameters:
-
(bd_topo_source_file¶Path) –Path to the source BD TOPO file (e.g., GeoPackage) to prepare.
-
(bd_topo_output_dir¶Path) –Directory where the prepared BD TOPO files will be saved.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/pipeline/bd_topo.py
pipeline
¶
Functions:
-
compute_metrics_call–Compare the pipeline output to a validation dataset.
-
compute_metrics_implementation–Compare the pipeline output to a validation dataset.
-
run_pipeline_call–Execute the complete pipeline to compute roofprints from LiDAR HD data.
-
run_pipeline_implementation–Execute the complete pipeline to compute roofprints from LiDAR HD data.
compute_metrics_call
¶
compute_metrics_call(validation_dataset_indiv_file: Path, validation_dataset_aggreg_file: Path, bd_topo_file: Path, tiles_dirs: List[Path], output_comparison_dir: Path, output_format: str, id_column: str, spacing_m: float, keep_columns: Optional[List[str]], input_output: InputOutput, verbose: Verbose, num_workers: Optional[int])
Compare the pipeline output to a validation dataset.
Parameters:
-
(validation_dataset_indiv_file¶Path) –Path to the individual building validation dataset (Parquet file).
-
(validation_dataset_aggreg_file¶Path) –Path to the aggregated building validation dataset (Parquet file).
-
(bd_topo_file¶Path) –Path to the BD TOPO polygon dataset to compare.
-
(tiles_dirs¶List[Path]) –List of tile directories containing the pipeline output to compare.
-
(output_comparison_dir¶Path) –Directory where the comparison results will be saved.
-
(output_format¶str) –Format to save the comparison results (e.g., 'parquet', 'csv', 'json').
-
(id_column¶str) –Name of the column containing the building IDs in the datasets.
-
(spacing_m¶float) –Spacing in meters to use for the comparison.
-
(keep_columns¶Optional[List[str]]) –List of additional column names to keep in the output comparison results (in addition to the id_column). If None, only the id_column will be kept.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
-
(num_workers¶Optional[int]) –Number of worker processes for multiprocessing (None = CPU count)
Source code in points2prints/pipeline/pipeline.py
compute_metrics_implementation
¶
compute_metrics_implementation(validation_dataset_indiv_file: Path, validation_dataset_aggreg_file: Path, bd_topo_file: Path, tiles_dirs: List[Path], output_comparison_dir: Path, output_format: str, id_column: str, spacing_m: float, keep_columns: Optional[List[str]], input_output: InputOutput, num_workers: Optional[int])
Compare the pipeline output to a validation dataset.
Parameters:
-
(validation_dataset_indiv_file¶Path) –Path to the individual building validation dataset (Parquet file).
-
(validation_dataset_aggreg_file¶Path) –Path to the aggregated building validation dataset (Parquet file).
-
(bd_topo_file¶Path) –Path to the BD TOPO polygon dataset to compare.
-
(tiles_dirs¶List[Path]) –List of tile directories containing the pipeline output to compare.
-
(output_comparison_dir¶Path) –Directory where the comparison results will be saved.
-
(output_format¶str) –Format to save the comparison results (e.g., 'parquet', 'csv', 'json').
-
(id_column¶str) –Name of the column containing the building IDs in the datasets.
-
(spacing_m¶float) –Spacing in meters to use for the comparison.
-
(keep_columns¶Optional[List[str]]) –List of additional column names to keep in the output comparison results (in addition to the id_column). If None, only the id_column will be kept.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(num_workers¶Optional[int]) –Number of worker processes for multiprocessing (None = CPU count)
Source code in points2prints/pipeline/pipeline.py
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 | |
run_pipeline_call
¶
run_pipeline_call(bd_topo_dir: Path, tile_dir: Path, stop_after_roofprints: bool, stop_after_lod22: bool, input_output: InputOutput, verbose: Verbose, num_workers: Optional[int])
Execute the complete pipeline to compute roofprints from LiDAR HD data.
Parameters:
-
(bd_topo_dir¶Path) –Directory containing BD TOPO data
-
(tile_dir¶Path) –Working directory for intermediate and output files
-
(stop_after_roofprints¶bool) –Whether to stop after computing roofprints
-
(stop_after_lod22¶bool) –Whether to stop after computing LoD2.2 models
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
-
(num_workers¶Optional[int]) –Number of worker processes for multiprocessing (None = CPU count)
Source code in points2prints/pipeline/pipeline.py
run_pipeline_implementation
¶
run_pipeline_implementation(bd_topo_dir: Path, tile_dir: Path, stop_after_roofprints: bool, stop_after_lod22: bool, input_output: InputOutput, num_workers: Optional[int])
Execute the complete pipeline to compute roofprints from LiDAR HD data.
Parameters:
-
(bd_topo_dir¶Path) –Directory containing BD TOPO data
-
(tile_dir¶Path) –Working directory for intermediate and output files
-
(stop_after_roofprints¶bool) –Whether to stop after computing roofprints
-
(stop_after_lod22¶bool) –Whether to stop after computing LoD2.2 models
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(num_workers¶Optional[int]) –Number of worker processes for multiprocessing (None = CPU count)
Source code in points2prints/pipeline/pipeline.py
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | |
point_cloud
¶
Process the point clouds.
Modules:
-
las_manipulations–Merge multiple point cloud files into a single output file while preserving all attributes.
Functions:
-
classification_mapping_implementation–Map the classification values in a LAS/LAZ file to a new set of values based on a provided mapping.
-
merge_files–Merge multiple point cloud files into a single output file.
-
split_point_cloud_implementation–Split a point cloud file into multiple files based on a specified dimension.
classification_mapping_implementation
¶
classification_mapping_implementation(input_file: Path, output_file: Path, mapping: Dict[int, int], input_output: InputOutput)
Map the classification values in a LAS/LAZ file to a new set of values based on a provided mapping.
Parameters:
-
(input_file¶Path) –Input LAS/LAZ file.
-
(output_file¶Path) –Output LAS/LAZ file.
-
(mapping¶Dict[int, int]) –Mapping of old classification values to new classification values.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/point_cloud/las_manipulations.py
merge_files
¶
merge_files(input_files: List[Path], output_file: Path, input_output: InputOutput) -> None
Merge multiple point cloud files into a single output file.
Parameters:
-
(input_files¶List[Path]) –List of input point cloud file paths.
-
(output_file¶Path) –Output point cloud file path.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/point_cloud/las_manipulations.py
split_point_cloud_implementation
¶
split_point_cloud_implementation(input_file: Path, output_file_template: Path, dimension: str, input_output: InputOutput) -> List[Path]
Split a point cloud file into multiple files based on a specified dimension.
Parameters:
-
(input_file¶Path) –Input LAS/LAZ file path.
-
(output_file_template¶Path) –Template for output file paths (should include # placeholder).
-
(dimension¶str) –Dimension to split on (e.g., "Classification").
-
(input_output¶InputOutput) –The handler for input and output file issues.
Returns:
Raises:
-
ValueError–If the output file template doesn't contain a # placeholder.
Source code in points2prints/point_cloud/las_manipulations.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
las_manipulations
¶
Merge multiple point cloud files into a single output file while preserving all attributes. Uses PDAL to perform the merge operation.
Functions:
-
classification_mapping_implementation–Map the classification values in a LAS/LAZ file to a new set of values based on a provided mapping.
-
create_merge_pipeline–Create a PDAL pipeline that merges multiple point cloud files.
-
merge_files–Merge multiple point cloud files into a single output file.
-
split_point_cloud_implementation–Split a point cloud file into multiple files based on a specified dimension.
classification_mapping_implementation
¶
classification_mapping_implementation(input_file: Path, output_file: Path, mapping: Dict[int, int], input_output: InputOutput)
Map the classification values in a LAS/LAZ file to a new set of values based on a provided mapping.
Parameters:
-
(input_file¶Path) –Input LAS/LAZ file.
-
(output_file¶Path) –Output LAS/LAZ file.
-
(mapping¶Dict[int, int]) –Mapping of old classification values to new classification values.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/point_cloud/las_manipulations.py
create_merge_pipeline
¶
Create a PDAL pipeline that merges multiple point cloud files.
Args: input_files: List of input point cloud file paths output_file: Output file path
Returns: Dictionary representing the PDAL pipeline
Source code in points2prints/point_cloud/las_manipulations.py
merge_files
¶
merge_files(input_files: List[Path], output_file: Path, input_output: InputOutput) -> None
Merge multiple point cloud files into a single output file.
Parameters:
-
(input_files¶List[Path]) –List of input point cloud file paths.
-
(output_file¶Path) –Output point cloud file path.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/point_cloud/las_manipulations.py
split_point_cloud_implementation
¶
split_point_cloud_implementation(input_file: Path, output_file_template: Path, dimension: str, input_output: InputOutput) -> List[Path]
Split a point cloud file into multiple files based on a specified dimension.
Parameters:
-
(input_file¶Path) –Input LAS/LAZ file path.
-
(output_file_template¶Path) –Template for output file paths (should include # placeholder).
-
(dimension¶str) –Dimension to split on (e.g., "Classification").
-
(input_output¶InputOutput) –The handler for input and output file issues.
Returns:
Raises:
-
ValueError–If the output file template doesn't contain a # placeholder.
Source code in points2prints/point_cloud/las_manipulations.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
polygon_deformation
¶
Experiments with the polygon deformation algorithm and visualisation of its behaviour on toy datasets.
Modules:
geometry
¶
Classes:
-
Segment–
Segment
¶
Methods:
-
distance_to_point–Computes the distance from a point to the segment.
-
projection_on_line–Projects a point onto the line defined by the segment and checks if the projection lies on the segment.
Source code in points2prints/polygon_deformation/geometry.py
distance_to_point
¶
Computes the distance from a point to the segment. The distance is divided between the distance in the direction of the normal vector and the distance in the direction of the segment. The distance in the direction of the segment is defined as the distance between the projection on the line and the projection on the segment.
Args: point (Point): The point from which the distance is calculated.
Returns: [float, float]: The distance in the direction of the normal vector and the distance in the direction of the segment.
Source code in points2prints/polygon_deformation/geometry.py
projection_on_line
¶
Projects a point onto the line defined by the segment and checks if the projection lies on the segment.
Args: point (Point): The point to be projected.
Returns: tuple[Point, bool]: The projected point and a boolean indicating if it lies on the segment.
Source code in points2prints/polygon_deformation/geometry.py
plot_recorder
¶
Classes:
-
PlotRecorder–Stores named snapshots of geometry and can render/show/save them.
PlotRecorder
¶
PlotRecorder(style: Optional[PlotStyle] = None)
Stores named snapshots of geometry and can render/show/save them.
Methods:
-
save_all_combined–Save all snapshots as subplots in a single figure.
-
save_combined_as_video–Save all snapshots as frames in a video.
Source code in points2prints/polygon_deformation/plot_recorder.py
save_all_combined
¶
Save all snapshots as subplots in a single figure.
Source code in points2prints/polygon_deformation/plot_recorder.py
save_combined_as_video
¶
save_combined_as_video(output_path: Path, fps: int = 10, dpi: int = 150, show_axes: bool = True) -> None
Save all snapshots as frames in a video.
Source code in points2prints/polygon_deformation/plot_recorder.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
roof
¶
Create the roofs.
Modules:
-
roof–
Functions:
-
roofprints_to_lod22_implementation–Creates a 3D roof model from roofprints and a point cloud.
roofprints_to_lod22_implementation
¶
roofprints_to_lod22_implementation(point_cloud_path: Path, roofprints_path: Path, roof_path: Path, input_output: InputOutput) -> None
Creates a 3D roof model from roofprints and a point cloud. This simply calls roofer with the appropriate arguments, and then converts the CityJSONSeq output to CityJSON.
Parameters:
-
(point_cloud_path¶Path) –Path to the point cloud file (LAS/LAZ).
-
(roofprints_path¶Path) –Path to the roofprints file (Parquet, GeoPackage, Shapefile, ...).
-
(roof_path¶Path) –Path where the resulting 3D roof model will be saved (CityJSON).
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/roof/roof.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
roof
¶
Functions:
-
roofprints_to_lod22_call–Creates a 3D roof model from roofprints and a point cloud.
-
roofprints_to_lod22_implementation–Creates a 3D roof model from roofprints and a point cloud.
roofprints_to_lod22_call
¶
roofprints_to_lod22_call(point_cloud_path: Path, roofprints_path: Path, roof_path: Path, input_output: InputOutput, verbose: Verbose) -> None
Creates a 3D roof model from roofprints and a point cloud. This simply calls roofer with the appropriate arguments, and then converts the CityJSONSeq output to CityJSON.
Parameters:
-
(point_cloud_path¶Path) –Path to the point cloud file (LAS/LAZ).
-
(roofprints_path¶Path) –Path to the roofprints file (Parquet, GeoPackage, Shapefile, ...).
-
(roof_path¶Path) –Path where the resulting 3D roof model will be saved (CityJSON).
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
Source code in points2prints/roof/roof.py
roofprints_to_lod22_implementation
¶
roofprints_to_lod22_implementation(point_cloud_path: Path, roofprints_path: Path, roof_path: Path, input_output: InputOutput) -> None
Creates a 3D roof model from roofprints and a point cloud. This simply calls roofer with the appropriate arguments, and then converts the CityJSONSeq output to CityJSON.
Parameters:
-
(point_cloud_path¶Path) –Path to the point cloud file (LAS/LAZ).
-
(roofprints_path¶Path) –Path to the roofprints file (Parquet, GeoPackage, Shapefile, ...).
-
(roof_path¶Path) –Path where the resulting 3D roof model will be saved (CityJSON).
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/roof/roof.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
utils
¶
Generic utilities
Modules:
-
custom_logging– -
input_output– -
result–
Classes:
-
InputOutput– -
Result–Rust-like Result type:
Functions:
-
run_command_with_tqdm_logging–Run a command and handle logging its standard output and standard error properly.
InputOutput
¶
Bases: Enum
Methods:
-
get_output_actions–Handle input and output files based on the specified output action.
-
handle_input–Validate input files.
-
handle_output–Handle output files based on the specified output action.
get_output_actions
¶
get_output_actions(message_prefix: str, output_files: Sequence[Sequence[Path]]) -> List[OutputAction]
Handle input and output files based on the specified output action.
Parameters:
-
(message_prefix¶str) –A prefix for log messages.
-
(output_files¶Sequence[Sequence[Path]]) –A list of list of paths to output files. The first level of the handles all elements independently while the second level expects all or none to exist. For example, if output_files = [[path1, path2], [path3]], we need path1 and path2 to both exist or none to exist, and path3 can exist or not independently.
Returns:
-
List[OutputAction]–A list of output actions corresponding to the input and output files.
Raises:
-
NotImplementedError–If the current InputOutput has an unexpected value.
Source code in points2prints/utils/input_output.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
handle_input
¶
handle_input(message_prefix: str, input_files: List[Path])
Validate input files.
Parameters:
-
(message_prefix¶str) –A prefix for log messages.
-
(input_files¶List[Path]) –A list of paths to input files.
Raises:
-
InputFileNotFoundError–If any of the input files do not exist.
-
InputFileIsNotFileError–If any of the input files are not valid files.
-
InputFileIsEmptyError–If any of the input files are empty.
Source code in points2prints/utils/input_output.py
handle_output
¶
handle_output(message_prefix: str, behaviour: OutputBehaviour, output_files: Sequence[Sequence[Path]]) -> OutputActionEnum
Handle output files based on the specified output action.
Parameters:
-
(message_prefix¶str) –A prefix for log messages.
-
(behaviour¶OutputBehaviour) –The handler for input and output file issues.
-
(output_files¶Sequence[Sequence[Path]]) –A list of list of paths to output files. The first level of the handles all elements independently while the second level expects all or none to exist. For example, if output_files = [[path1, path2], [path3]], we need path1 and path2 to both exist or none to exist, and path3 can exist or not independently.
Returns:
-
OutputActionEnum–The output action corresponding to the input and output files.
Source code in points2prints/utils/input_output.py
Result
¶
Result(inner: Union[Ok[T], Err[E]])
Bases: Generic[T, E]
Rust-like Result type: - Ok(value) - Err(error)
Use unwrap() / expect() to fail fast.
Methods:
-
expect–Return value or raise RuntimeError(message) chained from stored error.
-
unwrap–Return value or raise stored error.
-
unwrap_err–Return error or raise if this is Ok.
Source code in points2prints/utils/result.py
run_command_with_tqdm_logging
¶
Run a command and handle logging its standard output and standard error properly.
Parameters:
-
(command¶list[str]) –The command to run.
-
(display¶bool, default:True) –Whether to display the command output. By default False.
Returns:
-
int–description
Source code in points2prints/utils/custom_logging.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
custom_logging
¶
Functions:
-
run_command_with_tqdm_logging–Run a command and handle logging its standard output and standard error properly.
run_command_with_tqdm_logging
¶
Run a command and handle logging its standard output and standard error properly.
Parameters:
-
(command¶list[str]) –The command to run.
-
(display¶bool, default:True) –Whether to display the command output. By default False.
Returns:
-
int–description
Source code in points2prints/utils/custom_logging.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
input_output
¶
Classes:
InputOutput
¶
Bases: Enum
Methods:
-
get_output_actions–Handle input and output files based on the specified output action.
-
handle_input–Validate input files.
-
handle_output–Handle output files based on the specified output action.
get_output_actions
¶
get_output_actions(message_prefix: str, output_files: Sequence[Sequence[Path]]) -> List[OutputAction]
Handle input and output files based on the specified output action.
Parameters:
-
(message_prefix¶str) –A prefix for log messages.
-
(output_files¶Sequence[Sequence[Path]]) –A list of list of paths to output files. The first level of the handles all elements independently while the second level expects all or none to exist. For example, if output_files = [[path1, path2], [path3]], we need path1 and path2 to both exist or none to exist, and path3 can exist or not independently.
Returns:
-
List[OutputAction]–A list of output actions corresponding to the input and output files.
Raises:
-
NotImplementedError–If the current InputOutput has an unexpected value.
Source code in points2prints/utils/input_output.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
handle_input
¶
handle_input(message_prefix: str, input_files: List[Path])
Validate input files.
Parameters:
-
(message_prefix¶str) –A prefix for log messages.
-
(input_files¶List[Path]) –A list of paths to input files.
Raises:
-
InputFileNotFoundError–If any of the input files do not exist.
-
InputFileIsNotFileError–If any of the input files are not valid files.
-
InputFileIsEmptyError–If any of the input files are empty.
Source code in points2prints/utils/input_output.py
handle_output
¶
handle_output(message_prefix: str, behaviour: OutputBehaviour, output_files: Sequence[Sequence[Path]]) -> OutputActionEnum
Handle output files based on the specified output action.
Parameters:
-
(message_prefix¶str) –A prefix for log messages.
-
(behaviour¶OutputBehaviour) –The handler for input and output file issues.
-
(output_files¶Sequence[Sequence[Path]]) –A list of list of paths to output files. The first level of the handles all elements independently while the second level expects all or none to exist. For example, if output_files = [[path1, path2], [path3]], we need path1 and path2 to both exist or none to exist, and path3 can exist or not independently.
Returns:
-
OutputActionEnum–The output action corresponding to the input and output files.
Source code in points2prints/utils/input_output.py
result
¶
Classes:
-
Result–Rust-like Result type:
Result
¶
Result(inner: Union[Ok[T], Err[E]])
Bases: Generic[T, E]
Rust-like Result type: - Ok(value) - Err(error)
Use unwrap() / expect() to fail fast.
Methods:
-
expect–Return value or raise RuntimeError(message) chained from stored error.
-
unwrap–Return value or raise stored error.
-
unwrap_err–Return error or raise if this is Ok.
Source code in points2prints/utils/result.py
validation
¶
Preparation of the validation dataset and metrics utilities.
Modules:
-
metrics– -
processing–
Functions:
-
compare_polygon_datasets_implementation–Compute metrics against a prebuilt aggregated ground-truth dataset.
-
prepare_validation_dataset_implementation–Persist both the raw validation dataset and the dissolved aggregate dataset.
compare_polygon_datasets_implementation
¶
compare_polygon_datasets_implementation(ground_truth_path: Path, scored_path: Path, output_path: Path, id_column: str, spacing_m: float, keep_columns: list[str] | None, input_output: InputOutput) -> None
Compute metrics against a prebuilt aggregated ground-truth dataset.
Parameters:
-
(ground_truth_path¶Path) –Path to the aggregated ground-truth polygon dataset.
-
(scored_path¶Path) –Path to the scored polygon dataset.
-
(output_path¶Path) –Path where the per-pair metrics table will be written (.csv, .parquet or .json).
-
(id_column¶str) –Column name of unique IDs in the scored dataset.
-
(spacing_m¶float) –Sampling spacing in metres used for boundary distances.
-
(keep_columns¶list[str] | None) –Additional columns from the ground-truth dataset to keep in the output.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/validation/metrics.py
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 | |
prepare_validation_dataset_implementation
¶
prepare_validation_dataset_implementation(input_ground_truth_path: Path, id_column: str, individual_output_path: Path, aggregated_output_path: Path, keep_columns: list[str] | None, input_output: InputOutput) -> None
Persist both the raw validation dataset and the dissolved aggregate dataset.
Source code in points2prints/validation/processing.py
metrics
¶
Classes:
-
PolygonMetricsResult–Container for the per-pair metrics and global summary.
Functions:
-
clean_polygon_topology_call–Call wrapper for :func:
clean_polygon_topology_implementation. -
clean_polygon_topology_implementation–Clean polygon topology by snapping nearby vertices and rebuilding rings.
-
compare_polygon_datasets_call–Entry-point wrapper for dataset comparison with logging context.
-
compare_polygon_datasets_implementation–Compute metrics against a prebuilt aggregated ground-truth dataset.
-
write_comparison_results–Write comparison results to CSV, GeoParquet or JSON.
-
write_polygon_topology_results–Persist cleaned polygon topology results to disk.
PolygonMetricsResult
dataclass
¶
clean_polygon_topology_call
¶
clean_polygon_topology_call(input_path: Path, output_path: Path, threshold_m: float, input_output: InputOutput, verbose: Verbose) -> None
Call wrapper for :func:clean_polygon_topology_implementation.
Parameters:
-
(input_path¶Path) –Path to the input polygon dataset.
-
(output_path¶Path) –Path where the cleaned polygon dataset will be written.
-
(threshold_m¶float) –Vertex merge threshold in metres.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
Source code in points2prints/validation/metrics.py
clean_polygon_topology_implementation
¶
clean_polygon_topology_implementation(input_path: Path, output_path: Path, threshold_m: float, input_output: InputOutput) -> None
Clean polygon topology by snapping nearby vertices and rebuilding rings.
Parameters:
-
(input_path¶Path) –Path to the input polygon dataset (.parquet or .gpkg).
-
(output_path¶Path) –Path where the cleaned polygon dataset will be written (.parquet or .gpkg).
-
(threshold_m¶float) –Distance threshold in metres used to merge nearby vertices.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/validation/metrics.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | |
compare_polygon_datasets_call
¶
compare_polygon_datasets_call(ground_truth_path: Path, scored_path: Path, output_path: Path, id_column: str, spacing_m: float, keep_columns: list[str] | None, input_output: InputOutput, verbose: Verbose) -> None
Entry-point wrapper for dataset comparison with logging context.
Parameters:
-
(ground_truth_path¶Path) –Path to the aggregated ground-truth dataset.
-
(scored_path¶Path) –Path to the scored dataset.
-
(output_path¶Path) –Path where the per-pair metrics table will be written (.csv, .parquet or .json).
-
(id_column¶str) –Column name used for matching IDs.
-
(spacing_m¶float) –Sampling spacing in metres.
-
(keep_columns¶list[str] | None) –Additional columns from the ground-truth dataset to keep in the output.
-
(input_output¶InputOutput) –The handler for input and output file issues.
-
(verbose¶Verbose) –The verbosity level for logging.
Source code in points2prints/validation/metrics.py
compare_polygon_datasets_implementation
¶
compare_polygon_datasets_implementation(ground_truth_path: Path, scored_path: Path, output_path: Path, id_column: str, spacing_m: float, keep_columns: list[str] | None, input_output: InputOutput) -> None
Compute metrics against a prebuilt aggregated ground-truth dataset.
Parameters:
-
(ground_truth_path¶Path) –Path to the aggregated ground-truth polygon dataset.
-
(scored_path¶Path) –Path to the scored polygon dataset.
-
(output_path¶Path) –Path where the per-pair metrics table will be written (.csv, .parquet or .json).
-
(id_column¶str) –Column name of unique IDs in the scored dataset.
-
(spacing_m¶float) –Sampling spacing in metres used for boundary distances.
-
(keep_columns¶list[str] | None) –Additional columns from the ground-truth dataset to keep in the output.
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/validation/metrics.py
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 | |
write_comparison_results
¶
write_comparison_results(results: DataFrame, output_path: Path, input_output: InputOutput) -> None
Write comparison results to CSV, GeoParquet or JSON.
Parameters:
-
(results¶DataFrame) –DataFrame or GeoDataFrame containing results. If a GeoDataFrame is supplied or a
geometrycolumn exists it will be written as GeoParquet when the output extension is.parquet. -
(output_path¶Path) –Destination path. Supported extensions:
.csv,.parquetand.json. -
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/validation/metrics.py
879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 | |
write_polygon_topology_results
¶
write_polygon_topology_results(results: GeoDataFrame, output_path: Path, input_output: InputOutput) -> None
Persist cleaned polygon topology results to disk.
Parameters:
-
(results¶GeoDataFrame) –Cleaned geometries to persist.
-
(output_path¶Path) –Destination path (.parquet or .gpkg supported).
-
(input_output¶InputOutput) –The handler for input and output file issues.
Source code in points2prints/validation/metrics.py
processing
¶
Functions:
-
prepare_validation_dataset_implementation–Persist both the raw validation dataset and the dissolved aggregate dataset.
prepare_validation_dataset_implementation
¶
prepare_validation_dataset_implementation(input_ground_truth_path: Path, id_column: str, individual_output_path: Path, aggregated_output_path: Path, keep_columns: list[str] | None, input_output: InputOutput) -> None
Persist both the raw validation dataset and the dissolved aggregate dataset.