Skip to content

Conversation

@nmaarnio
Copy link
Collaborator

@nmaarnio nmaarnio commented Oct 15, 2025

Description

Generalize points algorithm was refactored into GeneralizePoints algorithm class that inherits BaseAlgorithm.

Changes in this PR:

  • Refactor generalize points
    • Formulate algorithm into GeneralizePoints algorithm class that inherits BaseAlgorithm
    • Add input geometry type check
  • Add CLI command for GeneralizePoints
  • Increase test coverage
  • Define default parameter values

ID handling will be implemented in a separate PR.

Type of change

  • Bug fix

  • New feature

  • Other

  • Non-breaking change

  • Breaking change

Developer checklist

  • A CHANGELOG entry has been included (only when change is visible to users)

@nmaarnio nmaarnio requested a review from JuhoErvasti October 15, 2025 12:24
Copy link
Collaborator

@JuhoErvasti JuhoErvasti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same comments from #22 apply here, so

  • CLI command
  • @override decorator
  • gpd.GeoDataFrame -> GeoDataFrame etc.
  • reference_data: dict[str, gpd.GeoDataFrame] | None = None, this type annotation

@nmaarnio nmaarnio force-pushed the refactor-generalize-points branch 2 times, most recently from 76dd55f to 39478cf Compare October 20, 2025 12:57
@nmaarnio nmaarnio force-pushed the refactor-generalize-points branch from 39478cf to 1daf0b0 Compare November 3, 2025 07:32
@nmaarnio nmaarnio requested a review from JuhoErvasti November 3, 2025 09:48
@nmaarnio nmaarnio force-pushed the refactor-generalize-points branch 2 times, most recently from 0733f55 to 9906552 Compare November 4, 2025 12:32
Copy link
Collaborator

@JuhoErvasti JuhoErvasti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think we can merge at this point but for future reference I think unique_key_column needs to be dropped as a member and reduce_nearby_points_by_clustering should be refactored to use the gdf's index. Also as far as I can tell the cluster_members_column column will persist in the output data which would be unwanted, but since (I think) it's related to the id handling it can probably be handled later?

@nmaarnio
Copy link
Collaborator Author

nmaarnio commented Nov 7, 2025

Yeah, I think those changes can be implemented later.

Added input geometry type check, changed execute to _execute,
added alg class documentation, changed import style in module
and added default parameter values.
@nmaarnio nmaarnio force-pushed the refactor-generalize-points branch from 9906552 to 9984360 Compare November 7, 2025 13:54
@nmaarnio nmaarnio force-pushed the refactor-generalize-points branch from 9984360 to 66600b9 Compare November 7, 2025 13:56
@nmaarnio nmaarnio merged commit bc57b1b into main Nov 7, 2025
3 checks passed
@nmaarnio nmaarnio deleted the refactor-generalize-points branch November 7, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants