Skip to content

Commit

Permalink
Merge branch 'feature/cleanup' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kebekus committed Feb 22, 2025
2 parents b636d8c + 8ad26f6 commit 95693c9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [2.32.11] - 2025-02-22

### Fixed
- Fix problems importing GeoJSON files produced by third-party software. (#496)


## [2.32.10] - 2025-02-21

### Added
Expand Down Expand Up @@ -32,7 +38,7 @@
## [2.32.7] - 2025-01-28

### Fixed
- Fixed problem where Route/Waypoint/Aircraft library pages do not open. (#488, #490)
- Fix problem where Route/Waypoint/Aircraft library pages do not open. (#488, #490)


## [2.32.6] - 2025-01-20
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ option(QTDEPLOY "Generate and run Qt deployment scripts" OFF)
# Project data
#

project(enroute VERSION 2.32.10)
project(enroute VERSION 2.32.11)
set(APP_ID de.akaflieg_freiburg.enroute)
set(DISPLAY_NAME "Enroute")
math(EXPR PROJECT_VERSION_CODE 10000*${PROJECT_VERSION_MAJOR}+100*${PROJECT_VERSION_MINOR}+${PROJECT_VERSION_PATCH})
Expand Down
34 changes: 28 additions & 6 deletions src/geomaps/Waypoint.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2019-2024 by Stefan Kebekus *
* Copyright (C) 2019-2025 by Stefan Kebekus *
* [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -64,12 +64,13 @@ GeoMaps::Waypoint::Waypoint(const QJsonObject &geoJSONObject)
}

// Get properties
if (!geoJSONObject.contains(QStringLiteral("properties"))) {
return;
QJsonObject properties;
if (geoJSONObject.contains(QStringLiteral("properties")))
{
properties = geoJSONObject[QStringLiteral("properties")].toObject();
foreach(auto propertyName, properties.keys())
m_properties.insert(propertyName, properties[propertyName].toVariant());
}
auto properties = geoJSONObject[QStringLiteral("properties")].toObject();
foreach(auto propertyName, properties.keys())
m_properties.insert(propertyName, properties[propertyName].toVariant());

// Get geometry
if (!geoJSONObject.contains(QStringLiteral("geometry"))) {
Expand All @@ -86,10 +87,31 @@ GeoMaps::Waypoint::Waypoint(const QJsonObject &geoJSONObject)
if (coordinateArray.size() != 2) {
return;
}

m_coordinate = QGeoCoordinate(coordinateArray[1].toDouble(), coordinateArray[0].toDouble() );
if (m_properties.contains(QStringLiteral("ELE"))) {
m_coordinate.setAltitude(properties[QStringLiteral("ELE")].toDouble());
}

// If the file was not created by Enroute, then the property array will not
// conform to the specification here:
// https://github.com/Akaflieg-Freiburg/enrouteServer/wiki/GeoJSON-files-used-in-enroute-flight-navigation
// We create a fake entry instead.
if (!m_properties.contains(QStringLiteral("TYP")))
{
m_properties[u"TYP"_s] = "WP";
m_properties[u"CAT"_s] = "WP";
m_properties[u"NAM"_s] = "";

if (m_properties.contains(u"name"_s))
{
m_properties[u"NAM"_s] = m_properties[u"name"_s];
}
if (m_properties[u"NAM"_s] == "")
{
m_properties[u"NAM"_s] = "Waypoint";
}
}
}


Expand Down

0 comments on commit 95693c9

Please sign in to comment.