Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: removed unused functionality and minor changes preparing next PR #1358

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

barendgehrels
Copy link
Collaborator

This relatively small PR removes things and changes a few minor things.
It prepares the next PR which will change traversal.

@barendgehrels barendgehrels self-assigned this Jan 1, 2025
@barendgehrels barendgehrels force-pushed the refactor/remove-unused branch from 40f3c97 to 44602ef Compare January 1, 2025 22:23
// (For dissolve this is not done, turn_index is often
// the same for two consecutive operations - but the conditions are changed
// and this should be verified again)
next_index = advance(next_index);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This functionality was active - but it is long obsolete and now handled in another way (and will change in next PR)

inline void create_map(Turns const& turns, MappedVector& mapped_vector,
IncludePolicy const& include_policy)
template <typename Turns, typename IncludePolicy>
inline auto create_map(Turns const& turns, IncludePolicy const& include_policy)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just a modernization.
(background: next PR needs including discarded here - to verify traversal)

// For buffer, this was already done before calling enrich_intersection_points.
has_colocations = ! clusters.empty();
}

Copy link
Collaborator Author

@barendgehrels barendgehrels Jan 1, 2025

Choose a reason for hiding this comment

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

This should now be called before, by the caller.
It is more convenient, it was different for buffer.
And next PR will change the gather_cluster_properties anyway and pass a visitor.
Buffer has another visitor.
Therefore it is more convenient to move it out, it doesn't really belong here.

{
detail::overlay::cleanup_clusters(turns, clusters);
detail::overlay::colocate_clusters(clusters, turns);
}
Copy link
Collaborator Author

@barendgehrels barendgehrels Jan 1, 2025

Choose a reason for hiding this comment

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

This is now called before create_map (it is independent of the map itself)

template <typename MultiPolygon, typename Settings>
bool verify(std::string const& caseid, MultiPolygon const& mp, MultiPolygon const& buffer, Settings const& settings)
template <typename Geometry, typename Buffer>
bool verify_buffer(Geometry const& geometry, Buffer const& buffer, std::string& reason, bool check_validity)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a stricter check in the test program, and gives more structured info.
It still happens a lot (around 0.25% of the cases is wrong)

@@ -170,26 +156,6 @@ struct buffer_turn_info
{}
};

struct buffer_less
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was unused

@@ -364,23 +364,6 @@ inline bool handle_colocations(Turns& turns, Clusters& clusters)
return true;
}


struct is_turn_index
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was unused

@@ -43,7 +43,6 @@ struct indexed_turn_operation

std::size_t turn_index;
std::size_t operation_index;
bool skip;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was unused

@barendgehrels barendgehrels force-pushed the refactor/remove-unused branch 2 times, most recently from 07f419e to baf2da2 Compare January 1, 2025 22:38
@@ -87,20 +87,6 @@ g_backtrack_warning_count++;
struct buffer_overlay_visitor
{
public :
void print(char const* /*header*/)
{
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These 3 print functions were long gone and are not called anymore

Copy link
Collaborator

@tinko92 tinko92 left a comment

Choose a reason for hiding this comment

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

LGTM (one note in in-line comment).

@barendgehrels barendgehrels force-pushed the refactor/remove-unused branch 2 times, most recently from b091257 to c0d13f8 Compare January 3, 2025 19:11
@barendgehrels barendgehrels force-pushed the refactor/remove-unused branch from c0d13f8 to 3589d5e Compare January 3, 2025 19:12
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.

2 participants