@@ -541,7 +541,6 @@ OgrFileImport::OgrFileImport(const QString& path, Map* map, MapView* view, UnitT
541541 : Importer(path, map, view)
542542 , manager{ OGR_SM_Create (nullptr ) }
543543 , unit_type{ unit_type }
544- , georeferencing_import_enabled{ true }
545544{
546545 GdalManager ().configure ();
547546
@@ -829,7 +828,8 @@ ogr::unique_srs OgrFileImport::importGeoreferencing(OGRDataSourceH data_source)
829828 CPLFree (projected_srs_spec);
830829 return suitable_srs;
831830 }
832- else if (suitable_srs)
831+
832+ if (suitable_srs)
833833 {
834834 // Found a suitable SRS but it is not projected.
835835 // Setting up a local orthographic projection.
@@ -847,18 +847,17 @@ ogr::unique_srs OgrFileImport::importGeoreferencing(OGRDataSourceH data_source)
847847 map->setGeoreferencing (ortho_georef);
848848 return srsFromMap ();
849849 }
850- else if (local_srs || no_srs)
850+
851+ if (local_srs || no_srs)
851852 {
852853 auto georef = Georeferencing ();
853854 georef.setScaleDenominator (int (map->getScaleDenominator ()));
854855 georef.setDeclination (map->getGeoreferencing ().getDeclination ());
855856 map->setGeoreferencing (georef);
856857 return local_srs ? std::move (local_srs) : srsFromMap ();
857858 }
858- else
859- {
860- throw FileFormatException (tr (" The geospatial data has no suitable spatial reference." ));
861- }
859+
860+ throw FileFormatException (tr (" The geospatial data has no suitable spatial reference." ));
862861}
863862
864863
@@ -1000,7 +999,8 @@ Object* OgrFileImport::importPointGeometry(OGRFeatureH feature, OGRGeometryH geo
1000999 object->setPosition (toMapCoord (OGR_G_GetX (geometry, 0 ), OGR_G_GetY (geometry, 0 )));
10011000 return object;
10021001 }
1003- else if (symbol->getType () == Symbol::Text)
1002+
1003+ if (symbol->getType () == Symbol::Text)
10041004 {
10051005 const auto & description = symbol->getDescription ();
10061006 auto length = description.length ();
@@ -1035,7 +1035,7 @@ Object* OgrFileImport::importPointGeometry(OGRFeatureH feature, OGRGeometryH geo
10351035 applyLabelAnchor (anchor, object);
10361036 }
10371037
1038- auto angle = QStringRef (&description, 3 , split-3 ).toFloat (&ok);
1038+ auto angle = QStringRef (&description, 3 , split-3 ).toDouble (&ok);
10391039 if (ok)
10401040 {
10411041 object->setRotation (qDegreesToRadians (angle));
@@ -1121,7 +1121,7 @@ PathObject* OgrFileImport::importPolygonGeometry(OGRFeatureH feature, OGRGeometr
11211121
11221122Symbol* OgrFileImport::getSymbol (Symbol::Type type, const char * raw_style_string)
11231123{
1124- auto style_string = QByteArray::fromRawData (raw_style_string, qstrlen (raw_style_string));
1124+ auto style_string = QByteArray::fromRawData (raw_style_string, int ( qstrlen (raw_style_string) ));
11251125 Symbol* symbol = nullptr ;
11261126 switch (type)
11271127 {
@@ -1164,7 +1164,7 @@ Symbol* OgrFileImport::getSymbol(Symbol::Type type, const char* raw_style_string
11641164
11651165MapColor* OgrFileImport::makeColor (OGRStyleToolH tool, const char * color_string)
11661166{
1167- auto key = QByteArray::fromRawData (color_string, qstrlen (color_string));
1167+ auto key = QByteArray::fromRawData (color_string, int ( qstrlen (color_string) ));
11681168 auto color = colors.value (key);
11691169 if (!color)
11701170 {
@@ -1369,7 +1369,7 @@ PointSymbol* OgrFileImport::getSymbolForOgrSymbol(OGRStyleToolH tool, const QByt
13691369 break ;
13701370 default :
13711371 return nullptr ;
1372- };
1372+ }
13731373
13741374 int is_null;
13751375 auto color_string = OGR_ST_GetParamStr (tool, color_key, &is_null);
@@ -1412,7 +1412,7 @@ TextSymbol* OgrFileImport::getSymbolForLabel(OGRStyleToolH tool, const QByteArra
14121412
14131413 // Don't use the style string as a key: The style contains the label.
14141414 QByteArray key;
1415- key.reserve (qstrlen (color_string) + qstrlen (font_size_string) + 1 );
1415+ key.reserve (int ( qstrlen (color_string) + qstrlen (font_size_string) + 1 ) );
14161416 key.append (color_string);
14171417 key.append (font_size_string);
14181418 auto text_symbol = static_cast <TextSymbol*>(text_symbols.value (key));
@@ -1446,7 +1446,7 @@ TextSymbol* OgrFileImport::getSymbolForLabel(OGRStyleToolH tool, const QByteArra
14461446 angle = 0.0 ;
14471447
14481448 QString description;
1449- description.reserve (qstrlen (label_string) + 100 );
1449+ description.reserve (int ( qstrlen (label_string) + 100 ) );
14501450 description.append (QString::number (100 + anchor));
14511451 description.append (QString::number (angle, ' g' , 1 ));
14521452 description.append (QLatin1Char (' ' ));
@@ -1461,7 +1461,7 @@ LineSymbol* OgrFileImport::getSymbolForPen(OGRStyleToolH tool, const QByteArray&
14611461 Q_ASSERT (OGR_ST_GetType (tool) == OGRSTCPen);
14621462
14631463 auto raw_tool_key = OGR_ST_GetStyleString (tool);
1464- auto tool_key = QByteArray::fromRawData (raw_tool_key, qstrlen (raw_tool_key));
1464+ auto tool_key = QByteArray::fromRawData (raw_tool_key, int ( qstrlen (raw_tool_key) ));
14651465 auto symbol = line_symbols.value (tool_key);
14661466 if (symbol && symbol->getType () == Symbol::Line)
14671467 return static_cast <LineSymbol*>(symbol);
@@ -1493,7 +1493,7 @@ AreaSymbol* OgrFileImport::getSymbolForBrush(OGRStyleToolH tool, const QByteArra
14931493 Q_ASSERT (OGR_ST_GetType (tool) == OGRSTCBrush);
14941494
14951495 auto raw_tool_key = OGR_ST_GetStyleString (tool);
1496- auto tool_key = QByteArray::fromRawData (raw_tool_key, qstrlen (raw_tool_key));
1496+ auto tool_key = QByteArray::fromRawData (raw_tool_key, int ( qstrlen (raw_tool_key) ));
14971497 auto symbol = area_symbols.value (tool_key);
14981498 if (symbol && symbol->getType () == Symbol::Area)
14991499 return static_cast <AreaSymbol*>(symbol);
@@ -2009,7 +2009,7 @@ void OgrFileExport::addTextToLayer(OGRLayerH layer, const std::function<bool (co
20092009 {
20102010 // There is no label field, or the text is too long.
20112011 // Put the text directly in the label.
2012- text.replace (QRegularExpression (QLatin1String (" ([ \ "\\\\ ] )" ), QRegularExpression::MultilineOption), QLatin1String (" \\\\ 1" ));
2012+ text.replace (QRegularExpression (QLatin1String (R"( ([ "\\]) )" ), QRegularExpression::MultilineOption), QLatin1String (" \\\\ 1" ));
20132013 style.replace (" {Name}" , text.toUtf8 ());
20142014 }
20152015 OGR_F_SetStyleString (po_feature.get (), style);
@@ -2028,7 +2028,7 @@ void OgrFileExport::addLinesToLayer(OGRLayerH layer, const std::function<bool (c
20282028 auto add_feature = [&](const Object* object) {
20292029 const auto * symbol = object->getSymbol ();
20302030 const auto * path = object->asPath ();
2031- if (path->parts ().size () < 1 )
2031+ if (path->parts ().empty () )
20322032 return ;
20332033
20342034 QString sym_name = symbol->getPlainTextName ();
@@ -2069,7 +2069,7 @@ void OgrFileExport::addAreasToLayer(OGRLayerH layer, const std::function<bool (c
20692069 auto add_feature = [&](const Object* object) {
20702070 const auto * symbol = object->getSymbol ();
20712071 const auto * path = object->asPath ();
2072- if (path->parts ().size () < 1 )
2072+ if (path->parts ().empty () )
20732073 return ;
20742074
20752075 auto po_feature = ogr::unique_feature (OGR_F_Create (OGR_L_GetLayerDefn (layer)));
0 commit comments