de-templetize polyline generalizer

This commit is contained in:
Dennis Luxen
2013-11-13 17:33:19 -05:00
parent 1863e85bf5
commit 8f4b0c8078
3 changed files with 10 additions and 11 deletions
+4 -4
View File
@@ -98,18 +98,18 @@ void DescriptionFactory::AppendEncodedPolylineString(
std::string & output
) {
if(return_encoded) {
pc.printEncodedString(pathDescription, output);
polyline_compressor.printEncodedString(pathDescription, output);
} else {
pc.printUnencodedString(pathDescription, output);
polyline_compressor.printUnencodedString(pathDescription, output);
}
}
void DescriptionFactory::AppendEncodedPolylineString(std::string &output) const {
pc.printEncodedString(pathDescription, output);
polyline_compressor.printEncodedString(pathDescription, output);
}
void DescriptionFactory::AppendUnencodedPolylineString(std::string &output) const {
pc.printUnencodedString(pathDescription, output);
polyline_compressor.printUnencodedString(pathDescription, output);
}
// void DescriptionFactory::Run(const SearchEngine &sEngine, const unsigned zoomLevel) {
+3 -3
View File
@@ -45,8 +45,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* and produces the description plus the encoded polyline */
class DescriptionFactory {
DouglasPeucker<SegmentInformation> dp;
PolylineCompressor pc;
DouglasPeucker polyline_generalizer;
PolylineCompressor polyline_compressor;
PhantomNode start_phantom, target_phantom;
double DegreeToRadian(const double degree) const;
@@ -202,7 +202,7 @@ public:
}
//Generalize poly line
dp.Run(pathDescription, zoomLevel);
polyline_generalizer.Run(pathDescription, zoomLevel);
//fix what needs to be fixed else
for(unsigned i = 0; i < pathDescription.size()-1 && pathDescription.size() >= 2; ++i){