Changeset View
Changeset View
Standalone View
Standalone View
tools/vectorosm-tilecreator/NodeReducer.h
Show All 24 Lines | 21 | public: | |||
---|---|---|---|---|---|
25 | qint64 remainingNodes() const; | 25 | qint64 remainingNodes() const; | ||
26 | 26 | | |||
27 | private: | 27 | private: | ||
28 | qreal epsilonFor(qreal multiplier) const; | 28 | qreal epsilonFor(qreal multiplier) const; | ||
29 | qreal perpendicularDistance(const GeoDataCoordinates &a, const GeoDataCoordinates &b, const GeoDataCoordinates &c) const; | 29 | qreal perpendicularDistance(const GeoDataCoordinates &a, const GeoDataCoordinates &b, const GeoDataCoordinates &c) const; | ||
30 | bool touchesTileBorder(const GeoDataCoordinates &coordinates) const; | 30 | bool touchesTileBorder(const GeoDataCoordinates &coordinates) const; | ||
31 | void setBorderPoints(OsmPlacemarkData &osmData, const QVector<int> &borderPoints, int length) const; | 31 | void setBorderPoints(OsmPlacemarkData &osmData, const QVector<int> &borderPoints, int length) const; | ||
32 | 32 | | |||
33 | GeoDataLinearRing* reducedRing(const GeoDataLinearRing& prevRing, | ||||
34 | GeoDataPlacemark* placemark, | ||||
35 | const GeoDataPlacemark::GeoDataVisualCategory& visualCategory); | ||||
36 | GeoDataPolygon* reducedPolygon(const GeoDataPolygon& prevPolygon, | ||||
37 | GeoDataPlacemark* placemark, | ||||
38 | const GeoDataPlacemark::GeoDataVisualCategory& visualCategory); | ||||
39 | | ||||
33 | template<class T> | 40 | template<class T> | ||
34 | void reduce(T const & lineString, OsmPlacemarkData& osmData, GeoDataPlacemark::GeoDataVisualCategory visualCategory, T* reducedLine) | 41 | void reduce(T const & lineString, OsmPlacemarkData& osmData, GeoDataPlacemark::GeoDataVisualCategory visualCategory, T* reducedLine) | ||
35 | { | 42 | { | ||
36 | bool const isArea = lineString.isClosed() && VectorClipper::canBeArea(visualCategory); | 43 | bool const isArea = lineString.isClosed() && VectorClipper::canBeArea(visualCategory); | ||
37 | qreal const epsilon = epsilonFor(isArea ? 45.0 : 30.0); | 44 | qreal const epsilon = epsilonFor(isArea ? 45.0 : 30.0); | ||
38 | *reducedLine = douglasPeucker(lineString, osmData, epsilon); | 45 | *reducedLine = douglasPeucker(lineString, osmData, epsilon); | ||
39 | 46 | | |||
40 | qint64 prevSize = lineString.size(); | 47 | qint64 prevSize = lineString.size(); | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |