| 46 | namespace CRSTemplates { |
| 47 | |
| 48 | CRSTemplateRegistry::TemplateList defaultList() |
| 49 | { |
| 50 | CRSTemplateRegistry::TemplateList templates; |
| 51 | templates.reserve(5); |
| 52 | |
| 53 | // UTM |
| 54 | auto temp = std::make_unique<CRSTemplate>( |
| 55 | QString::fromLatin1("UTM"), |
| 56 | ::OpenOrienteering::Georeferencing::tr("UTM", "UTM coordinate reference system"), |
| 57 | ::OpenOrienteering::Georeferencing::tr("UTM coordinates"), |
| 58 | QString::fromLatin1("+proj=utm +datum=WGS84 +zone=%1"), |
| 59 | CRSTemplate::ParameterList { |
| 60 | new UTMZoneParameter(QString::fromLatin1("zone"), ::OpenOrienteering::Georeferencing::tr("UTM Zone (number north/south)")) |
| 61 | } ); |
| 62 | templates.push_back(std::move(temp)); |
| 63 | |
| 64 | // Gauss-Krueger |
| 65 | temp = std::make_unique<CRSTemplate>( |
| 66 | QString::fromLatin1("Gauss-Krueger, datum: Potsdam"), |
| 67 | ::OpenOrienteering::Georeferencing::tr("Gauss-Krueger, datum: Potsdam", "Gauss-Krueger coordinate reference system"), |
| 68 | ::OpenOrienteering::Georeferencing::tr("Gauss-Krueger coordinates"), |
| 69 | QString::fromLatin1("+proj=tmerc +lat_0=0 +lon_0=%1 +k=1.000000 +x_0=%2 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"), |
| 70 | CRSTemplate::ParameterList { |
| 71 | new IntRangeParameter(QString::fromLatin1("zone"), ::OpenOrienteering::Georeferencing::tr("Zone number (1 to 119)", "Zone number for Gauss-Krueger coordinates"), |
| 72 | 1, 119, { {3, 0}, {1000000, 500000} }) |
| 73 | } ); |
| 74 | templates.push_back(std::move(temp)); |
| 75 | |
| 76 | // EPSG |
| 77 | temp = std::make_unique<CRSTemplate>( |
| 78 | QString::fromLatin1("EPSG"), |
| 79 | ::OpenOrienteering::Georeferencing::tr("by EPSG code", "as in: The CRS is specified by EPSG code"), |
| 80 | //: Don't translate @code@. It is placeholder. |
| 81 | ::OpenOrienteering::Georeferencing::tr("EPSG @code@ coordinates"), |
| 82 | QString::fromLatin1("+init=epsg:%1"), |
| 83 | CRSTemplate::ParameterList { |
| 84 | new IntRangeParameter(QString::fromLatin1("code"), ::OpenOrienteering::Georeferencing::tr("EPSG code"), 1000, 99999) |
| 85 | } ); |
| 86 | templates.push_back(std::move(temp)); |
| 87 | |
| 88 | // Custom |
| 89 | temp = std::make_unique<CRSTemplate>( |
| 90 | QString::fromLatin1("PROJ.4"), // Don't change this ID. |
| 91 | ::OpenOrienteering::Georeferencing::tr("Custom PROJ.4", "PROJ.4 specification"), |
| 92 | ::OpenOrienteering::Georeferencing::tr("Local coordinates"), |
| 93 | QString::fromLatin1("%1"), |
| 94 | CRSTemplate::ParameterList { |
| 95 | new FullSpecParameter(QString::fromLatin1("spec"), ::OpenOrienteering::Georeferencing::tr("Specification", "PROJ.4 specification")) |
| 96 | } ); |
| 97 | templates.push_back(std::move(temp)); |
| 98 | |
| 99 | return templates; |
| 100 | } |
| 101 | |
| 102 | |
| 103 | |