Skip to content

Commit

Permalink
rename index
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Apr 21, 2022
1 parent 1b4137b commit 7c8e602
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/s2-geography/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ namespace s2geography {

// Unlike the ShapeIndexGeography, whose function is to index a single S2Geography
// or index multiple S2Geography objects as if they were a single S2Geography,
// the S2GeographyIndex exists to index a vector of S2Geography objects (like a
// the GeographyIndex exists to index a vector of S2Geography objects (like a
// GEOSSTRTree index), providing (hopefully) rapid access to possibly intersecting
// features.
class S2GeographyIndex {
class GeographyIndex {
public:
S2GeographyIndex(MutableS2ShapeIndex::Options options = MutableS2ShapeIndex::Options())
GeographyIndex(MutableS2ShapeIndex::Options options = MutableS2ShapeIndex::Options())
: index_(options) {}

void Add(const S2Geography& geog, int value) {
Expand All @@ -40,7 +40,7 @@ class S2GeographyIndex {

class Iterator {
public:
Iterator(const S2GeographyIndex* index):
Iterator(const GeographyIndex* index):
index_(index), iterator_(&index_->ShapeIndex()) {}

void Query(const std::vector<S2CellId>& covering, std::unordered_set<int>* indices) {
Expand Down Expand Up @@ -84,7 +84,7 @@ class S2GeographyIndex {
}

private:
const S2GeographyIndex* index_;
const GeographyIndex* index_;
MutableS2ShapeIndex::Iterator iterator_;
};

Expand Down
8 changes: 4 additions & 4 deletions src/s2-matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ using namespace Rcpp;
template<class VectorType, class ScalarType>
class IndexedBinaryGeographyOperator: public UnaryGeographyOperator<VectorType, ScalarType> {
public:
std::unique_ptr<s2geography::S2GeographyIndex> geog2_index;
std::unique_ptr<s2geography::S2GeographyIndex::Iterator> iterator;
std::unique_ptr<s2geography::GeographyIndex> geog2_index;
std::unique_ptr<s2geography::GeographyIndex::Iterator> iterator;

// max_edges_per_cell should be between 10 and 50, with lower numbers
// leading to more memory usage (but potentially faster query times). Benchmarking
Expand All @@ -30,7 +30,7 @@ class IndexedBinaryGeographyOperator: public UnaryGeographyOperator<VectorType,
IndexedBinaryGeographyOperator(int maxEdgesPerCell = 50) {
MutableS2ShapeIndex::Options index_options;
index_options.set_max_edges_per_cell(maxEdgesPerCell);
geog2_index = absl::make_unique<s2geography::S2GeographyIndex>(index_options);
geog2_index = absl::make_unique<s2geography::GeographyIndex>(index_options);
}

virtual void buildIndex(List geog2) {
Expand All @@ -48,7 +48,7 @@ class IndexedBinaryGeographyOperator: public UnaryGeographyOperator<VectorType,
}
}

iterator = absl::make_unique<s2geography::S2GeographyIndex::Iterator>(geog2_index.get());
iterator = absl::make_unique<s2geography::GeographyIndex::Iterator>(geog2_index.get());
}
};

Expand Down

0 comments on commit 7c8e602

Please sign in to comment.