| 690 | } |
| 691 | |
| 692 | std::string FeatureType::DebugString() |
| 693 | { |
| 694 | ParseGeometryAndTriangles(FeatureType::BEST_GEOMETRY); |
| 695 | |
| 696 | std::string res = DebugPrint(m_id) + " " + DebugPrint(GetGeomType()); |
| 697 | |
| 698 | m2::PointD keyPoint; |
| 699 | switch (GetGeomType()) |
| 700 | { |
| 701 | case GeomType::Point: keyPoint = m_center; break; |
| 702 | |
| 703 | case GeomType::Line: |
| 704 | if (m_points.empty()) |
| 705 | break; |
| 706 | keyPoint = m_points.front(); |
| 707 | break; |
| 708 | |
| 709 | case GeomType::Area: |
| 710 | if (m_triangles.empty()) |
| 711 | break; |
| 712 | ASSERT_GREATER(m_triangles.size(), 2, ()); |
| 713 | keyPoint = (m_triangles[0] + m_triangles[1] + m_triangles[2]) / 3.0; |
| 714 | break; |
| 715 | |
| 716 | case GeomType::Undefined: ASSERT(false, ()); break; |
| 717 | } |
| 718 | // Print coordinates in (lat,lon) for better investigation capabilities. |
| 719 | res += ": " + DebugPrint(keyPoint) + "; " + DebugPrint(mercator::ToLatLon(keyPoint)) + "\n"; |
| 720 | |
| 721 | Classificator const & c = classif(); |
| 722 | |
| 723 | res += "Types"; |
| 724 | uint32_t const count = GetTypesCount(); |
| 725 | for (size_t i = 0; i < count; ++i) |
| 726 | res += (" : " + c.GetReadableObjectName(m_types[i])); |
| 727 | res += "\n"; |
| 728 | |
| 729 | auto const paramsStr = m_params.DebugString(); |
| 730 | if (!paramsStr.empty()) |
| 731 | res += paramsStr + "\n"; |
| 732 | |
| 733 | return res; |
| 734 | } |
| 735 | |
| 736 | m2::RectD FeatureType::GetLimitRect(int scale) |
| 737 | { |