Files
comaps/generator/collector_boundary_postcode.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

37 lines
1.1 KiB
C++

#pragma once
#include "generator/collector_interface.hpp"
#include "generator/feature_maker.hpp"
#include "generator/osm_element.hpp"
#include <memory>
#include <string>
namespace generator
{
// Saves pairs (postal code, outer geometry) to file for OsmElements that
// have all of the following: relation=boundary, boundary=postal_code, postal_code=*.
class BoundaryPostcodeCollector : public CollectorInterface
{
public:
BoundaryPostcodeCollector(std::string const & filename, IDRInterfacePtr const & cache);
// CollectorInterface overrides:
std::shared_ptr<CollectorInterface> Clone(IDRInterfacePtr const & = {}) const override;
void Collect(OsmElement const & el) override;
IMPLEMENT_COLLECTOR_IFACE(BoundaryPostcodeCollector);
void MergeInto(BoundaryPostcodeCollector & collector) const;
protected:
void Save() override;
private:
std::vector<std::pair<std::string, feature::FeatureBuilder::PointSeq>> m_data;
std::shared_ptr<cache::IntermediateDataReaderInterface> m_cache;
FeatureMakerSimple m_featureMakerSimple;
};
} // namespace generator