Rework GeometryTile* interface

This commit is contained in:
John Firebaugh
2015-03-09 13:22:52 -07:00
parent 2d8bf823fc
commit 50b5c15653
9 changed files with 115 additions and 300 deletions

View File

@@ -1,24 +1,16 @@
#include <mbgl/map/geometry_tile.hpp>
#include <mbgl/style/filter_expression_private.hpp>
#include <iostream>
namespace mbgl {
using namespace mbgl;
std::ostream& mbgl::operator<<(std::ostream& os, const GeometryFeatureType& type) {
switch (type) {
case GeometryFeatureType::Unknown: return os << "Unknown";
case GeometryFeatureType::Point: return os << "Point";
case GeometryFeatureType::LineString: return os << "LineString";
case GeometryFeatureType::Polygon: return os << "Polygon";
default: return os << "Invalid";
mapbox::util::optional<Value> GeometryTileFeatureExtractor::getValue(const std::string& key) const {
if (key == "$type") {
return Value(uint64_t(feature.getType()));
}
return feature.getValue(key);
}
std::ostream& mbgl::operator<<(std::ostream& os, const GeometryTileFeature& feature) {
os << "Feature(" << feature.getID() << "): " << feature.getType() << std::endl;
for (const auto& prop : feature.getProperties()) {
os << " - " << prop.first << ": " << &prop.second << std::endl;
}
return os;
template bool evaluate(const FilterExpression&, const GeometryTileFeatureExtractor&);
}