Skip to content

Commit

Permalink
CoverageSimplifier: make input coverage vector const (fixing a TODO) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored Feb 7, 2024
1 parent 7a9d6ca commit 45466da
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/geos/coverage/CoverageRingEdges.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GEOS_DLL CoverageRingEdges {
private:

// Members
std::vector<const Geometry*>& m_coverage;
const std::vector<const Geometry*>& m_coverage;
std::map<const LinearRing*, std::vector<CoverageEdge*>> m_ringEdgesMap;
std::vector<CoverageEdge*> m_edges;
std::vector<std::unique_ptr<CoverageEdge>> m_edgeStore;
Expand All @@ -72,7 +72,7 @@ class GEOS_DLL CoverageRingEdges {

public:

CoverageRingEdges(std::vector<const Geometry*>& coverage)
CoverageRingEdges(const std::vector<const Geometry*>& coverage)
: m_coverage(coverage)
{
build();
Expand Down Expand Up @@ -140,7 +140,7 @@ class GEOS_DLL CoverageRingEdges {
const CoordinateSequence& ring);

Coordinate::UnorderedSet findMultiRingNodes(
std::vector<const Geometry*>& coverage);
const std::vector<const Geometry*>& coverage);

Coordinate::UnorderedSet findBoundaryNodes(
LineSegment::UnorderedSet& lineSegments);
Expand Down
4 changes: 2 additions & 2 deletions include/geos/coverage/CoverageSimplifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class GEOS_DLL CoverageSimplifier {
*
* @param coverage a set of polygonal geometries forming a coverage
*/
CoverageSimplifier(std::vector<const Geometry*>& coverage);
CoverageSimplifier(const std::vector<const Geometry*>& coverage);

/**
* Simplifies the boundaries of a set of polygonal geometries forming a coverage,
Expand Down Expand Up @@ -142,7 +142,7 @@ class GEOS_DLL CoverageSimplifier {
private:

// Members
std::vector<const Geometry*>& m_input; // TODO? make this const
const std::vector<const Geometry*>& m_input;
const GeometryFactory* m_geomFactory;

// Methods
Expand Down
2 changes: 1 addition & 1 deletion include/geos/coverage/VertexRingCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class VertexRingCounter : public CoordinateSequenceFilter
void filter_ro(const CoordinateSequence& seq, std::size_t i) override;

static void count(
std::vector<const Geometry*>& geoms,
const std::vector<const Geometry*>& geoms,
std::map<Coordinate, std::size_t>& counts);

private:
Expand Down
2 changes: 1 addition & 1 deletion src/coverage/CoverageRingEdges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ CoverageRingEdges::next(std::size_t index, const CoordinateSequence& ring)

/* private */
Coordinate::UnorderedSet
CoverageRingEdges::findMultiRingNodes(std::vector<const Geometry*>& coverage)
CoverageRingEdges::findMultiRingNodes(const std::vector<const Geometry*>& coverage)
{
std::map<Coordinate, std::size_t> vertexRingCount;
VertexRingCounter::count(coverage, vertexRingCount);
Expand Down
2 changes: 1 addition & 1 deletion src/coverage/CoverageSimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ CoverageSimplifier::simplifyInner(


/* public */
CoverageSimplifier::CoverageSimplifier(std::vector<const Geometry*>& coverage)
CoverageSimplifier::CoverageSimplifier(const std::vector<const Geometry*>& coverage)
: m_input(coverage)
, m_geomFactory(coverage.empty() ? nullptr : coverage[0]->getFactory())
{
Expand Down
2 changes: 1 addition & 1 deletion src/coverage/VertexRingCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace coverage { // geos.coverage
/* public static */
void
VertexRingCounter::count(
std::vector<const Geometry*>& geoms,
const std::vector<const Geometry*>& geoms,
std::map<Coordinate, std::size_t>& counts)
{
VertexRingCounter vertextCounter(counts);
Expand Down

0 comments on commit 45466da

Please sign in to comment.