@@ -71,25 +71,12 @@ namespace {
7171 }
7272
7373
74- std::unique_ptr<Georeferencing> getDataGeoreferencing (const QString& path, const Georeferencing& initial_georef)
75- {
76- Map tmp_map;
77- tmp_map.setGeoreferencing (initial_georef);
78- OgrFileImport importer{ path, &tmp_map, nullptr , OgrFileImport::UnitOnGround};
79- importer.setGeoreferencingImportEnabled (true );
80- importer.setLoadSymbolsOnly (true );
81- if (!importer.doImport ())
82- return {}; // failure
83-
84- return std::make_unique<Georeferencing>(tmp_map.getGeoreferencing ()); // success
85- }
86-
87-
8874 bool preserveRefPoints (Georeferencing& data_georef, const Georeferencing& initial_georef)
8975 {
9076 // Keep a configured local reference point from initial_georef?
9177 auto data_crs_spec = data_georef.getProjectedCRSSpec ();
9278 if ((!initial_georef.isValid () || initial_georef.isLocal ())
79+ && initial_georef.getProjectedRefPoint () != QPointF{}
9380 && data_georef.isValid ()
9481 && !data_georef.isLocal ()
9582 && data_georef.getProjectedRefPoint () == QPointF{}
@@ -119,6 +106,20 @@ const std::vector<QByteArray>& OgrTemplate::supportedExtensions()
119106}
120107
121108
109+ std::unique_ptr<Georeferencing> OgrTemplate::getDataGeoreferencing (const QString& path, const Georeferencing& initial_georef)
110+ {
111+ Map tmp_map;
112+ tmp_map.setGeoreferencing (initial_georef);
113+ OgrFileImport importer{ path, &tmp_map, nullptr , OgrFileImport::UnitOnGround};
114+ importer.setGeoreferencingImportEnabled (true );
115+ importer.setLoadSymbolsOnly (true );
116+ if (!importer.doImport ())
117+ return {}; // failure
118+
119+ return std::make_unique<Georeferencing>(tmp_map.getGeoreferencing ()); // success
120+ }
121+
122+
122123OgrTemplate::OgrTemplate (const QString& path, Map* map)
123124: TemplateMap(path, map)
124125{
0 commit comments