fix iterator comparator

This commit is contained in:
Justin R. Miller
2015-03-08 14:13:46 -07:00
committed by John Firebaugh
parent a6b6a8d67e
commit fbb2d17f43
2 changed files with 6 additions and 1 deletions

View File

@@ -97,6 +97,10 @@ GeometryCollection VectorTileFeature::nextGeometry() {
return std::move(result);
}
bool VectorTileFeature::operator==(const VectorTileFeature& other) const {
return (geometry_pbf == other.geometry_pbf);
}
VectorTile::VectorTile(pbf tile_pbf) {
while (tile_pbf.next()) {
if (tile_pbf.tag == 3) { // layer
@@ -234,7 +238,7 @@ void FilteredVectorTileLayer::iterator::operator++() {
}
bool FilteredVectorTileLayer::iterator::operator!=(const iterator& other) const {
return !(feature_pbf.data == other.feature_pbf.data && feature_pbf.end == other.feature_pbf.end && valid == other.valid);
return !(feature == other.feature);
}
const VectorTileFeature& FilteredVectorTileLayer::iterator::operator*() const {

View File

@@ -17,6 +17,7 @@ public:
virtual inline GeometryFeatureType getType() const { return type; }
virtual inline std::map<std::string, Value> getProperties() const { return properties; }
virtual GeometryCollection nextGeometry();
bool operator==(const VectorTileFeature&) const;
private:
uint64_t id = 0;