|
13 | 13 | from geogenalg.application.generalize_clusters_to_centroids import ( |
14 | 14 | GeneralizePointClustersAndPolygonsToCentroids, |
15 | 15 | ) |
| 16 | +from geogenalg.application.generalize_points import GeneralizePoints |
16 | 17 |
|
17 | 18 |
|
18 | 19 | class GeoPackageURI: |
@@ -122,6 +123,30 @@ def clusters_to_centroids( |
122 | 123 | output.to_file(output_geopackage.file, layer=output_geopackage.layer_name) |
123 | 124 |
|
124 | 125 |
|
| 126 | +@app.command() |
| 127 | +def points( |
| 128 | + input_geopackage: GeoPackageArgument, |
| 129 | + output_geopackage: GeoPackageArgument, |
| 130 | + reduce_threshold: Annotated[float, typer.Option()], |
| 131 | + displace_threshold: Annotated[float, typer.Option()], |
| 132 | + displace_points_iterations: Annotated[int, typer.Option()], |
| 133 | + unique_key_column: Annotated[str, typer.Option()], |
| 134 | + cluster_members_column: Annotated[str, typer.Option()], |
| 135 | +) -> None: |
| 136 | + """Execute Generalize points algorithm.""" |
| 137 | + algorithm = GeneralizePoints( |
| 138 | + reduce_threshold=reduce_threshold, |
| 139 | + displace_threshold=displace_threshold, |
| 140 | + displace_points_iterations=displace_points_iterations, |
| 141 | + unique_key_column=unique_key_column, |
| 142 | + cluster_members_column=cluster_members_column, |
| 143 | + ) |
| 144 | + |
| 145 | + in_gdf = read_file(input_geopackage.file, layer=input_geopackage.layer_name) |
| 146 | + output = algorithm.execute(in_gdf, reference_data={}) |
| 147 | + output.to_file(output_geopackage.file, layer=output_geopackage.layer_name) |
| 148 | + |
| 149 | + |
125 | 150 | def main() -> None: |
126 | 151 | """Execute typer application.""" |
127 | 152 | app() |
|
0 commit comments