[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -3,7 +3,7 @@
<service name="tar_git">
<param name="url">https://github.com/Karry/osmscout-sailfish.git</param>
<param name="branch">master</param>
- <param name="revision">v2.28</param>
+ <param name="revision">v2.29</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.28.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/Projection.h
^
|
@@ -1,606 +0,0 @@
-#ifndef OSMSCOUT_UTIL_PROJECTION_H
-#define OSMSCOUT_UTIL_PROJECTION_H
-
-/*
- This source is part of the libosmscout library
- Copyright (C) 2010 Tim Teulings
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <osmscout/CoreImportExport.h>
-
-#include <osmscout/GeoCoord.h>
-#include <osmscout/Point.h>
-
-#include <osmscout/util/GeoBox.h>
-#include <osmscout/util/Magnification.h>
-#include <osmscout/util/Tiling.h>
-
-#include <osmscout/system/SSEMathPublic.h>
-
-namespace osmscout {
-
- /**
- * \ingroup Geometry
- *
- * The Projection class is an abstract base class for multiple projection implementations.
- *
- * The Projection class allows transformation of geo coordinates to screen/image coordinates and
- * screen/image coordinates back to geo coordinates.
- */
- class OSMSCOUT_API Projection
- {
- protected:
- double lon=0.0; //!< Longitude coordinate of the center of the image
- double lat=0.0; //!< Latitude coordinate of the center of the image
- double angle=0.0; //!< Display rotation angle in radians, canvas clockwise
- Magnification magnification; //!< Current magnification
- double dpi=0.0; //!< Screen DPI
- size_t width=0; //!< Width of image
- size_t height=0; //!< Height of image
-
- double lonMin=0.0; //!< Longitude of the upper left corner of the image
- double latMin=0.0; //!< Latitude of the upper left corner of the image
- double lonMax=0.0; //!< Longitude of the lower right corner of the image
- double latMax=0.0; //!< Latitude of the lower right corner of the image
-
- double pixelSize=0.0; //!< Size of a pixel in meter
- double meterInPixel=0.0; //!< Number of on screen pixel for one meter on the ground
- double meterInMM=0.0; //!< Number of on screen millimeters for one meter on the ground
-
- public:
-
- /**
- * This class is used to hide internal complexity concerned with batching GeoToPixel calls
- */
- class BatchTransformer
- {
- public:
- // this should be private, but that would exclude future projection
- // implementors. I don't know a nice way to handle this
- const Projection& projection;
-#ifdef OSMSCOUT_HAVE_SSE2
- int count;
- ALIGN16_BEG double lon[2] ALIGN16_END;
- ALIGN16_BEG double lat[2] ALIGN16_END;
- double* xPointer[2];
- double* yPointer[2];
-#endif
-
- public:
- explicit BatchTransformer(const Projection& projection)
- : projection(projection)
-#ifdef OSMSCOUT_HAVE_SSE2
- ,count(0)
-#endif
- {
- }
-
- ~BatchTransformer()
- {
- Flush();
- }
-
- BatchTransformer(const BatchTransformer& other) = delete;
-
- void GeoToPixel(const GeoCoord& coord,
- double& x,
- double& y)
- {
-#ifdef OSMSCOUT_HAVE_SSE2
- if (projection.CanBatch()) {
- this->lon[count]=coord.GetLon();
- this->lat[count]=coord.GetLat();
- xPointer[count]=&x;
- yPointer[count]=&y;
- count++;
-
- if (count==2) {
- count=0;
- projection.GeoToPixel(*this);
- }
- }
- else {
- projection.GeoToPixel(coord,
- x,y);
- }
-#else
- projection.GeoToPixel(coord,
- x,y);
-#endif
- }
-
- void GeoToPixel(const Point& coord,
- double& x,
- double& y)
- {
-#ifdef OSMSCOUT_HAVE_SSE2
- if (projection.CanBatch()) {
- this->lon[count]=coord.GetCoord().GetLon();
- this->lat[count]=coord.GetCoord().GetLat();
- xPointer[count]=&x;
- yPointer[count]=&y;
- count++;
-
- if (count==2) {
- count=0;
- projection.GeoToPixel(*this);
- }
- }
- else {
- projection.GeoToPixel(coord.GetCoord(),
- x,y);
- }
-#else
- projection.GeoToPixel(coord.GetCoord(),
- x,y);
-#endif
- }
-
- void Flush()
- {
-#ifdef OSMSCOUT_HAVE_SSE2
- if (count!=0) {
- count=0;
- projection.GeoToPixel(GeoCoord(lat[0],
- lon[0]),
- *xPointer[0],
- *yPointer[0]);
- }
-#endif
- }
- };
-
- Projection() = default;
- Projection(const Projection&) = default;
- Projection(Projection&&) = default;
- Projection& operator=(const Projection&) = default;
- Projection& operator=(Projection&&) = default;
- virtual ~Projection() = default;
-
- virtual bool CanBatch() const = 0;
- virtual bool IsValid() const = 0;
-
- /**
- * Return true if given coordinate is valid for this projection
- */
- virtual bool IsValidFor(const GeoCoord& coord) const = 0;
-
- GeoCoord GetCenter() const
- {
- return GeoCoord(lat,lon);
- }
-
- /**
- * Returns the angle in radians ([0..2*PI[) of the display in relation to the north. A degree of 0 means
- * north is to the top, a degree of PI, renders with the south to the top of the display).
- */
- double GetAngle() const
- {
- return angle;
- }
-
- /**
- * Returns the width of the screen
- */
- size_t GetWidth() const
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.28.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/Projection.cpp
^
|
@@ -1,496 +0,0 @@
-/*
- This source is part of the libosmscout library
- Copyright (C) 2010 Tim Teulings
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <osmscout/util/Projection.h>
-
-#include <algorithm>
-
-#include <osmscout/system/Assert.h>
-#include <osmscout/system/Math.h>
-
-#ifdef OSMSCOUT_HAVE_SSE2
-#include <osmscout/system/SSEMath.h>
-#endif
-
-#include <osmscout/util/Tiling.h>
-
-namespace osmscout {
-
- /*
- * For the calculations here see:
- * http://en.wikipedia.org/wiki/Mercator_projection
- * http://en.wikipedia.org/wiki/Web_Mercator
- * http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
- */
-
- //< Radius of the earth in meter
- static const double earthRadiusMeter=6378137.0;
- //< Extent of the earth in meter
- static const double earthExtentMeter=2*M_PI*earthRadiusMeter;
- //< Width of a tile at the equator for zoom level 0 in meter (equal to extent of the earth at the equator
- static const double tileWidthZoom0Aquator=earthExtentMeter;
- //< DPI of a classical OSM tile
- static const double tileDPI=96.0;
-
- const double MercatorProjection::MaxLat = +85.0511;
- const double MercatorProjection::MinLat = -85.0511;
- const double MercatorProjection::MaxLon = +180.0;
- const double MercatorProjection::MinLon = -180.0;
-
-#ifdef OSMSCOUT_HAVE_SSE2
- static const ALIGN16_BEG double sseGradtorad[] ALIGN16_END = {2*M_PI/360, 2*M_PI/360};
-#endif
-
- static const double gradtorad=2*M_PI/360;
-
- bool Projection::BoundingBoxToPixel(const GeoBox& boundingBox,
- double& xMin,
- double& yMin,
- double& xMax,
- double& yMax) const
- {
- assert(boundingBox.IsValid());
-
- double x;
- double y;
-
- if (!GeoToPixel(boundingBox.GetMinCoord(),
- x,
- y)) {
- return false;
- }
-
- xMin=x;
- xMax=x;
- yMin=y;
- yMax=y;
-
- if (!GeoToPixel(boundingBox.GetMaxCoord(),
- x,
- y)) {
- return false;
- }
-
- xMin=std::min(xMin,
- x);
- xMax=std::max(xMax,
- x);
- yMin=std::min(yMin,
- y);
- yMax=std::max(yMax,
- y);
-
- if (!GeoToPixel(GeoCoord(boundingBox.GetMinLat(),
- boundingBox.GetMaxLon()),
- x,
- y)) {
- return false;
- }
-
- xMin=std::min(xMin,
- x);
- xMax=std::max(xMax,
- x);
- yMin=std::min(yMin,
- y);
- yMax=std::max(yMax,
- y);
-
- if (!GeoToPixel(GeoCoord(boundingBox.GetMaxLat(),
- boundingBox.GetMinLon()),
- x,
- y)) {
- return false;
- }
-
- xMin=std::min(xMin,
- x);
- xMax=std::max(xMax,
- x);
- yMin=std::min(yMin,
- y);
- yMax=std::max(yMax,
- y);
-
- return true;
- }
-
- bool MercatorProjection::Set(const GeoCoord& coord,
- double angle,
- const Magnification& magnification,
- double dpi,
- size_t width, size_t height)
- {
- if (valid &&
- this->lon==coord.GetLon() &&
- this->lat==coord.GetLat() &&
- this->angle==angle &&
- this->magnification==magnification &&
- this->dpi==dpi &&
- this->width==width &&
- this->height==height) {
- return true;
- }
- if (!IsValidFor(coord)){
- return false;
- }
-
- valid=true;
-
- // Make a copy of the context information
- this->lon=coord.GetLon();
- this->lat=coord.GetLat();
- this->angle=angle;
- this->magnification=magnification;
- this->dpi=dpi;
- this->width=width;
- this->height=height;
-
- if (angle!=0.0) {
- angleSin=sin(angle);
- angleCos=cos(angle);
- angleNegSin=-angleSin;
- angleNegCos=angleCos;
- }
- else {
- angleSin=0;
- angleNegSin=0;
- angleCos=1;
- angleNegCos=1;
- }
-
- // Width in meter of a tile of the given magnification at the equator
- double equatorTileWidth=tileWidthZoom0Aquator/magnification.GetMagnification();
-
- // Resolution (meter/pixel) of a pixel in a classical 256 pixel tile for the given zoom level at the equator
- double equatorTileResolution=equatorTileWidth/256.0;
-
- // Modified resolution (meter/pixel) at the equator based on our actual DPI instead of the standard tile DPI
- double equatorCorrectedEquatorTileResolution=equatorTileResolution*tileDPI/dpi;
-
- // Width of the visible area at the equator
- double groundWidthEquatorMeter=width*equatorCorrectedEquatorTileResolution;
-
- // Width of the visible area in meter
- double groundWidthVisibleMeter=groundWidthEquatorMeter*cos(lat*gradtorad);
-
- // Resulting projection scale factor
- scale=width/(2*M_PI*groundWidthEquatorMeter/earthExtentMeter);
- scaleGradtorad=scale*gradtorad;
-
- // Size of one pixel in meter
- pixelSize=groundWidthVisibleMeter/width;
-
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.28.tar.bz2/src/Migration.cpp
^
|
@@ -1,131 +0,0 @@
-/*
- OSMScout for SFOS
- Copyright (C) 2021 Lukáš Karas
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "Migration.h"
-
-#include <QDebug>
-#include <QDir>
-#include <QCoreApplication>
-#include <QStandardPaths>
-
-#include <cassert>
-
-Migration::Migration(const QString &home,
- const QString &oldOrganization,
- const QString &oldAppName,
- const QString &newOrganization,
- const QString &newAppName):
- home(home),
- oldOrganization(oldOrganization),
- oldAppName(oldAppName),
- newOrganization(newOrganization),
- newAppName(newAppName)
-{}
-
-Migration::Migration(const QString &oldOrganization,
- const QString &oldAppName):
- Migration(QStandardPaths::writableLocation(QStandardPaths::HomeLocation),
- oldOrganization,
- oldAppName,
- QCoreApplication::organizationName(),
- QCoreApplication::applicationName())
-{}
-
-QString Migration::cacheDir(const QString &organization, const QString &appName) const
-{
- return home.absolutePath() + QDir::separator() +
- ".cache" + QDir::separator() +
- (organization.isEmpty() ? appName : organization) + QDir::separator() +
- appName;
-}
-
-QString Migration::configFile(const QString &organization, const QString &appName, bool defaultQtConfig) const
-{
- return home.absolutePath() + QDir::separator() +
- ".config" + QDir::separator() +
- (organization.isEmpty() ? appName : organization) + QDir::separator() +
- (defaultQtConfig ? "" : appName + QDir::separator()) +
- appName + ".conf";
-}
-
-QString Migration::localDir(const QString &organization, const QString &appName) const
-{
- return home.absolutePath() + QDir::separator() +
- ".local" + QDir::separator() +
- "share" + QDir::separator() +
- (organization.isEmpty() ? appName : organization) + QDir::separator() +
- appName;
-}
-
-bool Migration::migrate(const QString &oldLocation, const QString &newLocation) const
-{
- qDebug() << "Considering migration" << oldLocation << "to" << newLocation;
- QFileInfo oldInfo(oldLocation);
- QFileInfo newInfo(newLocation);
- if (oldInfo.exists() && !newInfo.exists()){
- QDir parent = newInfo.dir();
- if (!parent.mkpath(parent.absolutePath())){
- qWarning() << "Failed to create path" << parent.absolutePath();
- return false;
- }
- if (!QFile::rename(oldLocation, newLocation)){
- qWarning() << "Failed to move" << oldLocation << "to" << newLocation;
- return false;
- }
- qDebug() << "Migrate" << oldLocation << "to" << newLocation;
- return true;
- }
- return false;
-}
-
-bool Migration::migrateConfig() const
-{
- // try ~/.config/harbour-osmscout/harbour-osmscout.conf -> ~/.config/cz.karry.osmscout/OSMScout/OSMScout.conf
- if (migrate(configFile(oldOrganization, oldAppName, true),
- configFile(newOrganization, newAppName, false))) {
- return true;
- }
- // try ~/.config/cz.karry.osmscout/OSMScout.conf -> ~/.config/cz.karry.osmscout/OSMScout/OSMScout.conf
- if (migrate(configFile(newOrganization, newAppName, true),
- configFile(newOrganization, newAppName, false))) {
- return true;
- }
- return false;
-}
-
-bool Migration::migrateLocal() const
-{
- return migrate(localDir(oldOrganization, oldAppName),
- localDir(newOrganization, newAppName));
-}
-
-bool Migration::wipeOldCache() const
-{
- QString cache = cacheDir(oldOrganization, oldAppName);
- qDebug() << "Considering cache wipe" << cache;
- assert(!cache.isEmpty());
- assert(cache != "/");
- assert(cache != ".");
- assert(cache != home.absolutePath());
- if (QFileInfo(cache).exists()) {
- qDebug() << "Wiping old application cache" << cache;
- return QDir(cache).removeRecursively();
- }
- return false;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.28.tar.bz2/src/Migration.h
^
|
@@ -1,64 +0,0 @@
-/*
- OSMScout for SFOS
- Copyright (C) 2021 Lukáš Karas
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#pragma once
-
-#include <QString>
-#include <QDir>
-
-/**
- * Linux specific utility for migrating Qt directories after change application name or organization.
- */
-class Migration {
-private:
- QDir home;
- QString oldOrganization;
- QString oldAppName;
- QString newOrganization;
- QString newAppName;
-
-public:
- Migration(const QString &home,
- const QString &oldOrganization,
- const QString &oldAppName,
- const QString &newOrganization,
- const QString &newAppName);
-
- Migration(const QString &oldOrganization,
- const QString &oldAppName);
-
- virtual ~Migration() = default;
-
- QString cacheDir(const QString &organization, const QString &appName) const;
-
- /**
- * config file used by QSettings
- * @param organization
- * @param appName
- * @return
- */
- QString configFile(const QString &organization, const QString &appName, bool defaultQtConfig) const;
-
- QString localDir(const QString &organization, const QString &appName) const;
-
- bool migrate(const QString &oldLocation, const QString &newLocation) const;
- bool migrateConfig() const;
- bool migrateLocal() const;
- bool wipeOldCache() const;
-};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/.tx/config
^
|
@@ -1,9 +1,9 @@
[main]
host = https://www.transifex.com
-[osm-scout.ents]
+[o:osm-scout:p:osm-scout:r:ents]
file_filter = translations/<lang>.ts
source_file = translations/en.ts
source_lang = en
-type = QT
+type = QT
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/CMakeLists.txt
^
|
@@ -6,7 +6,7 @@
# Redistribution and use is allowed according to the terms of the BSD license.
cmake_policy(SET CMP0048 NEW)
-project(osmscout-sailfish VERSION 2.28.0 LANGUAGES C CXX)
+project(osmscout-sailfish VERSION 2.29.0 LANGUAGES C CXX)
# ==================================================================================================
# Information to update before to release this package.
@@ -315,7 +315,6 @@
src/IconProvider.h
src/LocFile.h
src/MemoryManager.h
- src/Migration.h
src/NearWaypointModel.h
src/Tracker.h
src/SearchHistoryModel.h
@@ -335,6 +334,7 @@
qml/custom/MapDialog.qml
qml/custom/ScrollIndicator.qml
qml/custom/MapRenderingIndicator.qml
+ qml/custom/OpeningHoursRow.qml
qml/custom/Link.qml
qml/custom/OSMCopyright.qml
qml/custom/POIIcon.qml
@@ -388,6 +388,7 @@
qml/pages/CollectionOrdering.qml
qml/pages/CollectionListOrdering.qml
qml/pages/NewWaypoint.qml
+ qml/pages/OpeningHours.qml
qml/pages/CollectionExport.qml
qml/pages/Settings.qml
qml/pages/TrackColor.qml
@@ -403,7 +404,6 @@
src/AppSettings.cpp
src/LocFile.cpp
src/MemoryManager.cpp
- src/Migration.cpp
src/OSMScout.cpp
src/Storage.cpp
src/CollectionModel.cpp
@@ -446,6 +446,7 @@
${SOURCE_FILES}
${QML_FILES}
dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/RouteDescriptionBuilder.cpp
+ dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OpeningHoursModel.cpp
)
# See http://doc.qt.io/qt-5/cmake-manual.html
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.clang-tidy
^
|
@@ -1,28 +1,27 @@
----
-Checks: '-*,bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines,misc-*,modernize-*,performance-*,readability-*,clang-diagnostic-*,-modernize-use-nodiscard,-modernize-use-trailing-return-type,-readability-redundant-access-specifiers,-readability-uppercase-literal-suffix,-readability-magic-numbers,-readability-isolate-declaration,-modernize-use-auto,-misc-non-private-member-variables-in-classes,-cert-dcl21-cpp,-modernize-pass-by-value,-readability-convert-member-functions-to-static,-readability-identifier-length,-bugprone-too-small-loop-variable'
+Checks: '-*,bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,misc-*,modernize-*,performance-*,readability-*,clang-diagnostic-*,-modernize-use-nodiscard,-modernize-use-trailing-return-type,-readability-redundant-access-specifiers,-readability-uppercase-literal-suffix,-readability-magic-numbers,-readability-isolate-declaration,-modernize-use-auto,-misc-non-private-member-variables-in-classes,-cert-dcl21-cpp,-modernize-pass-by-value,-readability-convert-member-functions-to-static,-readability-identifier-length,-bugprone-too-small-loop-variable,-misc-const-correctness,-readability-static-definition-in-anonymous-namespace'
WarningsAsErrors: ''
HeaderFilterRegex: '.*/libosmscout.*/.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- - key: cert-dcl16-c.NewSuffixes
- value: 'L;LL;LU;LLU'
- - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
- value: '0'
- - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
- value: '1'
- - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
- value: '1'
- - key: modernize-loop-convert.MaxCopySize
- value: '16'
- - key: modernize-loop-convert.MinConfidence
- value: reasonable
- - key: modernize-loop-convert.NamingStyle
- value: CamelCase
- - key: modernize-pass-by-value.IncludeStyle
- value: llvm
- - key: modernize-replace-auto-ptr.IncludeStyle
- value: llvm
- - key: modernize-use-nullptr.NullMacros
- value: 'NULL'
-...
+- key: cert-dcl16-c.NewSuffixes
+ value: 'L;LL;LU;LLU'
+- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
+ value: '0'
+- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
+ value: '1'
+- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
+ value: '1'
+- key: modernize-loop-convert.MaxCopySize
+ value: '16'
+- key: modernize-loop-convert.MinConfidence
+ value: reasonable
+- key: modernize-loop-convert.NamingStyle
+ value: CamelCase
+- key: modernize-pass-by-value.IncludeStyle
+ value: llvm
+- key: modernize-replace-auto-ptr.IncludeStyle
+ value: llvm
+- key: modernize-use-nullptr.NullMacros
+ value: 'NULL'
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_ios.yml
^
|
@@ -7,6 +7,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
build_cmake:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_msys.yml
^
|
@@ -7,6 +7,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
build_gcc_cmake:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_osx.yml
^
|
@@ -7,6 +7,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
build_meson:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_ubuntu_20_04.yml
^
|
@@ -7,6 +7,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
build_gcc_meson:
@@ -17,8 +19,10 @@
uses: actions/checkout@v3
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- - name: Install gcc compiler, meson and ninja
- run: sudo apt-get -y install gcc-10 g++-10 libtbb-dev ccache libtool pkg-config meson ninja-build
+ - name: Install gcc compiler and Co
+ run: sudo apt-get -y install gcc-10 g++-10 libtbb-dev ccache libtool pkg-config
+ - name: Install meson and ninja via pip
+ run: "pip install meson ninja"
- name: Install libosmscout dependencies
run: "sudo apt-get update && sudo apt-get install -y
libxml2-dev
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_ubuntu_22_04.yml
^
|
@@ -7,6 +7,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
build_clang_meson:
@@ -19,8 +21,10 @@
run: sudo apt-get update
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- - name: Install clang compiler, meson and ninja
- run: sudo apt-get -y install clang libc++-dev ccache libtool pkg-config meson ninja-build
+ - name: Install clang compiler and Co
+ run: sudo apt-get -y install clang libc++-dev ccache libtool pkg-config
+ - name: Install meson and ninja via pip
+ run: "pip install meson ninja"
- name: Install libosmscout dependencies
run: "sudo apt-get install -y
libxml2-dev
@@ -49,8 +53,10 @@
uses: actions/checkout@v3
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- - name: Install gcc compiler, meson and ninja
- run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config meson ninja-build
+ - name: Install gcc compiler and Co
+ run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config
+ - name: Install meson and ninja via pip
+ run: "pip install meson ninja"
- name: Install libosmscout dependencies
run: "sudo apt-get update && sudo apt-get install -y
libxml2-dev
@@ -115,8 +121,10 @@
uses: actions/checkout@v3
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- - name: Install gcc compiler, meson and ninja
- run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config meson ninja-build
+ - name: Install gcc compiler and Co
+ run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config
+ - name: Install meson and ninja via pip
+ run: "pip install meson ninja"
- name: Install libosmscout dependencies
run: "sudo apt-get update && sudo apt-get install -y
libfreetype6-dev libcairo2-dev libpangocairo-1.0-0 libpango1.0-dev
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_vs2019.yml
^
|
@@ -7,6 +7,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
build_cmake:
@@ -18,15 +20,15 @@
- name: Copy vcpkg.json
run: copy vcpkg_medium.json vcpkg.json
- name: Add msbuild to PATH
- uses: microsoft/setup-msbuild@v1.1.3
+ uses: microsoft/setup-msbuild@v1.3.1
# Restore from cache the previously built ports. If cache-miss, download and build vcpkg (aka "bootstrap vcpkg").
- name: Restore from cache and install vcpkg
# Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
- uses: lukka/run-vcpkg@v10.7 # https://github.com/lukka/run-vcpkg/releases/tag/v10.4
+ uses: lukka/run-vcpkg@v11.1 # https://github.com/lukka/run-vcpkg/releases/tag/v10.7
with:
- runVcpkgInstall: false
+ runVcpkgInstall: false lukka/run-vcpkg
vcpkgJsonGlob: '**/vcpkg.json'
- vcpkgGitCommitId: acc3bcf76b84ae5041c86ab55fe138ae7b8255c7 # https://github.com/microsoft/vcpkg/releases/tag/2022.08.15
+ vcpkgGitCommitId: 93e173a0d724c193e5546d48efb3e4ef47c1e1f2 # current, before: https://github.com/microsoft/vcpkg/releases/tag/2023.02.24
- name: Create build directory
run: mkdir build
- name: Configure build project
@@ -64,7 +66,7 @@
run: copy /Y build\Demos\Debug\*.exe dist
shell: cmd
- name: Upload distribution archive
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v3
with:
name: Libosmscout_Windows.zip
path: dist
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/build_on_ubuntu_18_04_qt_android.yml
^
|
@@ -1,4 +1,4 @@
-name: Ubuntu 18.04 for Qt on Android
+name: Ubuntu 22.04 for Qt on Android
# See https://doc.qt.io/qt-5/android-getting-started.html
# See https://github.com/jurplel/install-qt-action
@@ -11,19 +11,21 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
build:
name: Ubuntu+android - Build
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- - name: set up JDK 1.8
+ - name: set up JDK 11
uses: actions/setup-java@v3
with:
distribution: zulu
- java-version: 8
+ java-version: 11
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Run sdkmanager update
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/release.yml
^
|
@@ -0,0 +1,64 @@
+name: Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Release version'
+ required: true
+
+env:
+ JAVA_VERSION: '17'
+ JAVA_DISTRO: 'zulu'
+
+jobs:
+ create_release:
+ name: Create release
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ ref: master
+ fetch-depth: 0
+
+ - name: Install gcc compiler and Co
+ run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config
+
+ - name: Install meson and ninja via pip
+ run: "pip install meson ninja"
+
+ - name: Set version
+ run: |
+ VERSION=${{ github.event.inputs.version }}
+ sed -i "s/^ *version: *'[0-9a-z.-]*', *$/ version: '${VERSION}',/g" meson.build
+
+ - name: Initialize meson project
+ run: meson setup dist --wrap-mode nofallback
+ env:
+ CXX: g++-12
+ CC: gcc-12
+
+ - name: Create distribution archive
+ run: meson dist -C dist --formats "xztar,zip" --no-tests --allow-dirty
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: ${{ env.JAVA_VERSION }}
+ distribution: ${{ env.JAVA_DISTRO }}
+
+ - name: JReleaser full-release
+ uses: jreleaser/release-action@v2
+ env:
+ JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
+ JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: JReleaser upload output
+ uses: actions/upload-artifact@v3
+ if: ${{ always() }}
+ with:
+ name: jreleaser-release
+ path: |
+ out/jreleaser/trace.log
+ out/jreleaser/output.properties
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/release_latest.yml
^
|
@@ -4,43 +4,66 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
+ workflow_dispatch:
+
+env:
+ JAVA_VERSION: '17'
+ JAVA_DISTRO: 'zulu'
jobs:
create_latest_release:
name: Create latest release
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
+ if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3
- - name: Install jq, python3-pip, g++-10, ninja
- run: sudo apt-get install -y jq python3-pip g++-10 ninja-build
- - name: Install meson
- run: sudo pip3 install meson
+ with:
+ fetch-depth: 0
+
+ - name: Install gcc compiler and Co
+ run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config
+
+ - name: Install meson and ninja via pip
+ run: "pip install meson ninja"
+
+ - name: "Define version based on current year"
+ run: |
+ echo "VERSION=$(date +%Y.%m.%d).1-latest" >> $GITHUB_OUTPUT
+ id: version
+
+ - name: Set version locally to 'latest'
+ run: |
+ sed -i "s/^ *version: *'[0-9a-z.-]*', *$/ version: '$(date +%Y.%m.%d).1-latest',/g" meson.build
+
- name: Initialize meson project
run: meson setup dist --wrap-mode nofallback
env:
- CXX: g++-10
- CC: gcc-10
+ CXX: g++-12
+ CC: gcc-12
+
- name: Create distribution archive
- run: meson dist -C dist --formats "xztar,zip" --no-tests
- - name: Prepare archives
- run: |
- cp dist/meson-dist/libosmscout-$(cd dist && meson introspect --projectinfo | jq -r .version).tar.xz libosmscout-latest.tar.xz
- cp dist/meson-dist/libosmscout-$(cd dist && meson introspect --projectinfo | jq -r .version).zip libosmscout-latest.zip
- - name: Create checksums
- run: |
- sha256sum libosmscout-latest.tar.xz >libosmscout-latest.tar.xz.sha256sum
- sha256sum libosmscout-latest.zip >libosmscout-latest.zip.sha256sum
- - name: Release
- uses: ncipollo/release-action@v1
+ run: meson dist -C dist --formats "xztar,zip" --no-tests --allow-dirty
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: ${{ env.JAVA_VERSION }}
+ distribution: ${{ env.JAVA_DISTRO }}
+
+ - name: JReleaser full-release
+ uses: jreleaser/release-action@v2
+ env:
+ JRELEASER_PROJECT_VERSION: ${{ steps.version.outputs.VERSION }}
+ JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: JReleaser upload output
+ uses: actions/upload-artifact@v3
+ if: ${{ always() }}
with:
- allowUpdates: true
- body: "Release of the latest code in master"
- draft: false
- prerelease: true
- generateReleaseNotes: true
- name: latest
- removeArtifacts: true
- replacesArtifacts: true
- tag: latest
- artifacts: "libosmscout-latest.tar.xz,libosmscout-latest.tar.xz.sha256sum,libosmscout-latest.zip,libosmscout-latest.zip.sha256sum"
+ name: jreleaser-release
+ path: |
+ out/jreleaser/trace.log
+ out/jreleaser/output.properties
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/sanitize_on_ubuntu_22_04.yml
^
|
@@ -7,6 +7,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
sanitize_clang:
@@ -19,7 +21,7 @@
run: sudo apt-get update
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- - name: Install clang compiler, meson and ninja
+ - name: Install clang compiler, cmake and ninja
run: sudo apt-get -y install clang libc++-dev ccache libtool pkg-config cmake ninja-build
- name: Install libosmscout dependencies
run: "sudo apt-get install -y
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/sonar.yml
^
|
@@ -7,13 +7,15 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
workflow_dispatch:
jobs:
sonar_gcc_meson:
name: sonar, gcc and meson
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
environment: SONAR
steps:
- name: Checkout
@@ -25,32 +27,32 @@
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- name: Install gcc compiler, meson and ninja
- run: sudo apt-get -y install gcc-10 g++-10 libtbb-dev ccache libtool pkg-config meson ninja-build
- - name: Install test coverage
- run: sudo apt-get -y install gcovr lcov
+ run: sudo apt-get -y install gcc-11 g++-11 libtbb-dev ccache libtool pkg-config
+ - name: Install meson, ninja, lcov and gcovr via pip
+ run: pip install meson ninja lcov gcovr
- name: Install libosmscout dependencies
- run: "sudo apt-get install -y
- libxml2-dev
- libprotobuf-dev protobuf-compiler
- libagg-dev
- libfreetype6-dev libcairo2-dev libpangocairo-1.0-0 libpango1.0-dev
- qt5-default qtdeclarative5-dev libqt5svg5-dev qtlocation5-dev qtpositioning5-dev qttools5-dev-tools
- qttools5-dev qtmultimedia5-dev
- libglm-dev libglew-dev freeglut3 freeglut3-dev
- libmarisa-dev"
+ run: "sudo apt-get install -y
+ libxml2-dev
+ libprotobuf-dev protobuf-compiler
+ libagg-dev
+ libfreetype6-dev libcairo2-dev libpangocairo-1.0-0 libpango1.0-dev
+ qtdeclarative5-dev libqt5svg5-dev qtlocation5-dev qtpositioning5-dev qttools5-dev-tools
+ qttools5-dev qtmultimedia5-dev
+ libglm-dev libglew-dev freeglut3 freeglut3-dev
+ libmarisa-dev"
- name: Prepare Sonar scanner
run: |
- wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.1.2450-linux.zip
- unzip -q sonar-scanner-cli-4.6.1.2450-linux.zip
- echo "${PWD}/sonar-scanner-4.6.1.2450-linux/bin/" >> $GITHUB_PATH
+ wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip
+ unzip -q sonar-scanner-cli-4.8.0.2856-linux.zip
+ echo "${PWD}/sonar-scanner-4.8.0.2856-linux/bin/" >> $GITHUB_PATH
wget -nv https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip -q build-wrapper-linux-x86.zip
echo "${PWD}/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Configure build project
- run: meson setup --buildtype debugoptimized --unity on -Db_coverage=true debug
+ run: meson setup --buildtype debugoptimized -Db_coverage=true --unity on debug
env:
- CXX: g++-10
- CC: gcc-10
+ CXX: g++-11
+ CC: gcc-11
- name: Build project
run: build-wrapper-linux-x86-64 --out-dir sonar-build-output ninja -C debug all test coverage
- name: Create gcov files
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/.github/workflows/webpage.yml
^
|
@@ -4,6 +4,8 @@
push:
branches:
- master
+ paths-ignore:
+ - '.github/workflows/**'
jobs:
webpage:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Android/OsmScoutLib/jni/src/jniMercatorProjection.cpp
^
|
@@ -21,7 +21,7 @@
#include <string.h>
#include <android/log.h>
-#include <osmscout/util/Projection.h>
+#include <osmscout/projection/Projection.h>
#include <jniObjectArray.h>
@@ -109,15 +109,15 @@
}
double lon, lat;
-
+
if (!nativeProjection->PixelToGeo(x, y, lon, lat))
return NULL;
jclass javaClass = env->FindClass("osm/scout/GeoPos");
jmethodID methodId = env->GetMethodID(javaClass,"<init>","(DD)V");
jobject geoPos=env->NewObject(javaClass, methodId, lon, lat);
-
- return geoPos;
+
+ return geoPos;
}
jobject Java_osm_scout_MercatorProjection_jniGeoToPixel(JNIEnv *env,
@@ -133,15 +133,15 @@
}
double x, y;
-
+
if (!nativeProjection->GeoToPixel(lon, lat, x, y))
return NULL;
-
+
jclass javaClass = env->FindClass("android/graphics/PointF");
jmethodID methodId = env->GetMethodID(javaClass,"<init>","(FF)V");
jobject point=env->NewObject(javaClass, methodId, (float)x, (float)y);
-
- return point;
+
+ return point;
}
#ifdef __cplusplus
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Android/OsmScoutLib/jni/src/jniOnLoad.cpp
^
|
@@ -22,7 +22,7 @@
#include <android/log.h>
#include <osmscout/Database.h>
-#include <osmscout/util/Projection.h>
+#include <osmscout/projection/Projection.h>
#include <osmscout/StyleConfig.h>
#include <jniMapPainterCanvas.h>
@@ -51,7 +51,7 @@
gObjectTypeSetsArray=new JniObjectArray<ObjectTypeSets>();
gStyleConfigArray=new JniObjectArray<StyleConfig>();
gTypeConfigArray=new JniObjectArray<TypeConfig>();
-
+
return JNI_VERSION_1_6;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/BasemapImport/src/BasemapImport.cpp
^
|
@@ -27,6 +27,8 @@
#include <vector>
#include <algorithm>
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscout/util/CmdLineParsing.h>
#include <osmscout/util/File.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/CMakeLists.txt
^
|
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)
project(libosmscout VERSION 1.1.1 LANGUAGES C CXX)
+set(OSMSCOUT_LIBRARY_VERSION 1.1.1)
# If we are called from conan, include and activate it cmake additions
if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
@@ -25,7 +26,6 @@
endif()
set(OSMSCOUT_BASE_DIR_SOURCE ${CMAKE_CURRENT_SOURCE_DIR})
set(OSMSCOUT_BASE_DIR_BUILD ${CMAKE_CURRENT_BINARY_DIR})
-set(OSMSCOUT_LIBRARY_VERSION ${PROJECT_VERSION})
include_directories(${OSMSCOUT_BASE_DIR_BUILD}/include)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(IOS)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Demos/include/DrawMap.h
^
|
@@ -21,11 +21,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscout/Database.h>
+#include <osmscout/BasemapDatabase.h>
+
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscout/util/CmdLineParsing.h>
-#include <osmscout/Database.h>
#include <osmscoutmap/MapService.h>
-#include <osmscout/BasemapDatabase.h>
#include <iostream>
@@ -362,8 +365,7 @@
return true;
}
- osmscout::GeoBox boundingBox;
- projection.GetDimensions(boundingBox);
+ osmscout::GeoBox boundingBox(projection.GetDimensions());
if (!waterIndex->GetRegions(boundingBox,
projection.GetMagnification(),
tiles)) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Demos/meson.build
^
|
@@ -1,19 +1,23 @@
subdir('src')
demoIncDir = include_directories('include')
+demoInstallDir = 'share/osmscout/demos'
+
Coverage = executable('Coverage',
'src/Coverage.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
DumpOSS = executable('DumpOSS',
'src/DumpOSS.cpp',
include_directories: [osmscoutIncDir, osmscoutmapIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout, osmscoutmap],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
if marisaDep.found()
LookupText = executable('LookupText',
@@ -21,7 +25,8 @@
include_directories: [osmscoutIncDir, osmscoutmapIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout, osmscoutmap],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
endif
LocationLookup = executable('LocationLookup',
@@ -29,56 +34,64 @@
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
LocationLookupForm = executable('LocationLookupForm',
'src/LocationLookupForm.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
Navigation = executable('Navigation',
'src/Navigation.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
NavigationSimulator = executable('NavigationSimulator',
'src/NavigationSimulator.cpp',
include_directories: [osmscoutIncDir, osmscoutmapIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout, osmscoutmap],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
POILookupForm = executable('POILookupForm',
'src/POILookupForm.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
LocationDescription = executable('LocationDescription',
'src/LocationDescription.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
ReverseLocationLookup = executable('ReverseLocationLookup',
'src/ReverseLocationLookup.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
ResourceConsumption = executable('ResourceConsumption',
'src/ResourceConsumption.cpp',
include_directories: [osmscoutmapIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout, osmscoutmap],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
if buildMapQt
if get_option('qtVersion') == 5
@@ -88,7 +101,8 @@
include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir],
dependencies: [mathDep, openmpDep, qt5GuiDep, qt5WidgetsDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
elif get_option('qtVersion') == 6
ResourceConsumptionQt = executable('ResourceConsumptionQt',
'src/ResourceConsumptionQt.cpp',
@@ -96,7 +110,8 @@
include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir],
dependencies: [mathDep, openmpDep, qt6GuiDep, qt6WidgetsDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
endif
endif
@@ -108,7 +123,8 @@
include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir],
dependencies: [mathDep, openmpDep, qt5GuiDep, qt5WidgetsDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
elif get_option('qtVersion') == 6
RoutingAnimation = executable('RoutingAnimation',
'src/RoutingAnimation.cpp',
@@ -116,7 +132,8 @@
include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir],
dependencies: [mathDep, openmpDep, qt6GuiDep, qt6WidgetsDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt],
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
endif
endif
@@ -136,7 +153,8 @@
dependencies: [mathDep, openmpDep, qt5GuiDep, qt5WidgetsDep, qt5QmlDep, qt5QuickDep, qt5SvgDep, qt5NetworkDep, qt5LocationDep, qt5MultimediaDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
elif get_option('qtVersion') == 6
demoMocs = qt6.preprocess('qt-demo',
moc_headers : ['include/QtDemoApp.h'],
@@ -151,7 +169,8 @@
dependencies: [mathDep, openmpDep, qt6GuiDep, qt6WidgetsDep, qt6QmlDep, qt6QuickDep, qt6SvgDep, qt6NetworkDep, qt6LocationDep, qt6MultimediaDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
endif
if buildGpx
@@ -172,7 +191,8 @@
dependencies: [mathDep, openmpDep, qt5GuiDep, qt5WidgetsDep, qt5QmlDep, qt5QuickDep, qt5SvgDep, qt5NetworkDep, qt5LocationDep, qt5MultimediaDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt, osmscoutgpx],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
elif get_option('qtVersion') == 6
navDemoMocs = qt6.preprocess(moc_headers : [
'include/PositionSimulator.h',
@@ -190,7 +210,8 @@
dependencies: [mathDep, openmpDep, qt6GuiDep, qt6WidgetsDep, qt6QmlDep, qt6QuickDep, qt6SvgDep, qt6NetworkDep, qt6LocationDep, qt6MultimediaDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt, osmscoutgpx],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
endif
endif
@@ -210,7 +231,8 @@
dependencies: [mathDep, openmpDep, qt5GuiDep, qt5WidgetsDep, qt5QmlDep, qt5QuickDep, qt5SvgDep, qt5NetworkDep, qt5LocationDep, qt5MultimediaDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
- install: true)
+ install: true,
+ install_dir: demoInstallDir)
elif get_option('qtVersion') == 6
routingParamsDemoMocs = qt6.preprocess(moc_headers : [
'../OSMScout2/src/Theme.h'
@@ -226,7 +248,8 @@
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Demos/src/PositionSimulator.cpp
^
|
@@ -99,8 +99,8 @@
segmentStart=points[0];
segmentEnd=points[points.size()-1];
- if (segmentStart.time){
- simulationTime=*segmentStart.time;
+ if (segmentStart.timestamp){
+ simulationTime=*segmentStart.timestamp;
}else{
simulationTime=Now();
}
@@ -147,14 +147,14 @@
while (true){
if (currentPoint<points.size()) {
auto &point=points[currentPoint];
- if (point.time && *point.time > simulationTime){
+ if (point.timestamp && *point.timestamp > simulationTime){
return;
}
- osmscout::log.Debug() << "Simulator point: " << osmscout::TimestampToISO8601TimeString(point.time.value_or(simulationTime)) << " @ " << point.coord.GetDisplayText();
+ osmscout::log.Debug() << "Simulator point: " << osmscout::TimestampToISO8601TimeString(point.timestamp.value_or(simulationTime)) << " @ " << point.coord.GetDisplayText();
currentPosition=point.coord;
emit positionChanged(currentPosition.GetLat(), currentPosition.GetLon(), point.hdop.has_value(), point.hdop.value_or(0));
currentPoint++;
- if (!point.time){
+ if (!point.timestamp){
return;
}
}else{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Demos/src/ResourceConsumption.cpp
^
|
@@ -22,13 +22,14 @@
#include <osmscout/Database.h>
-#include <osmscoutmap/MapService.h>
-#include <osmscoutmap/MapPainter.h>
+#include <osmscout/projection/MercatorProjection.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/util/StopClock.h>
+#include <osmscoutmap/MapService.h>
+#include <osmscoutmap/MapPainter.h>
+
/*
Example for the germany.osm, show germany overview, then zooms into Bonn city
and then zoom into Dortmund city and then zomm into München overview.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Demos/src/ResourceConsumptionQt.cpp
^
|
@@ -24,11 +24,15 @@
#include <QApplication>
#include <osmscout/Database.h>
+
+#include <osmscout/projection/MercatorProjection.h>
+
+#include <osmscout/util/StopClock.h>
+
#include <osmscoutmap/MapService.h>
#include <osmscoutmapqt/MapPainterQt.h>
-#include <osmscout/util/StopClock.h>
/*
Example for the germany.osm, show germany overview, then zooms into Bonn city
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Demos/src/RoutingAnimation.cpp
^
|
@@ -28,18 +28,19 @@
#include <list>
#include <osmscout/Database.h>
-#include <osmscoutmap/MapService.h>
-#include <osmscout/util/Projection.h>
-#include <osmscout/util/Geometry.h>
-#include <osmscout/util/CmdLineParsing.h>
-
-#include <osmscoutmapqt/MapPainterQt.h>
+#include <osmscout/projection/MercatorProjection.h>
#include <osmscout/routing/SimpleRoutingService.h>
#include <osmscout/routing/RoutePostprocessor.h>
#include <osmscout/routing/RoutingService.h>
+#include <osmscout/util/Geometry.h>
+#include <osmscout/util/CmdLineParsing.h>
+
+#include <osmscoutmap/MapService.h>
+
+#include <osmscoutmapqt/MapPainterQt.h>
//#define ROUTE_DEBUG
//#define NODE_DEBUG
@@ -107,10 +108,11 @@
const osmscout::MercatorProjection &projection,
const osmscout::GeoCoord &coord){
- double x,y;
- projection.GeoToPixel(coord,x,y);
+ osmscout::Vertex2D pos;
+ projection.GeoToPixel(coord,
+ pos);
painter.setPen(Qt::NoPen);
- painter.drawEllipse(x,y,10,10);
+ painter.drawEllipse(pos.GetX(),pos.GetY(),10,10);
}
class RoutingServiceAnimation: public osmscout::SimpleRoutingService{
@@ -148,17 +150,14 @@
{
}
- virtual ~RoutingServiceAnimation()
- {
- }
+ ~RoutingServiceAnimation() override = default;
- virtual bool WalkToOtherDatabases(const osmscout::RoutingProfile& /*state*/,
- osmscout::RoutingService::RNodeRef ¤t,
- osmscout::RouteNodeRef &/*currentRouteNode*/,
- osmscout::RoutingService::OpenList &openList,
- osmscout::RoutingService::OpenMap &/*openMap*/,
- const osmscout::RoutingService::ClosedSet &closedSet,
- const ClosedSet &closedRestrictedSet)
+ bool WalkToOtherDatabases(const osmscout::RoutingProfile& /*state*/,
+ osmscout::RoutingService::RNodeRef ¤t,
+ osmscout::RouteNodeRef &/*currentRouteNode*/,
+ osmscout::RoutingService::OpenList &openList,
+ osmscout::RoutingService::OpenMap &/*openMap*/,
+ const osmscout::RoutingService::ClosedSet &closedSet) override
{
if (stepCounter<startStep || (endStep>0 && (int64_t)stepCounter>endStep)){
stepCounter++;
@@ -170,8 +169,6 @@
}
stepCounter++;
- double x1,y1;
- double x2,y2;
osmscout::RouteNodeRef n1;
osmscout::RouteNodeRef n2;
@@ -193,9 +190,6 @@
pen.setWidth(5);
// draw ways in closedSet
- painter.setBrush(QBrush(red));
- pen.setColor(red);
-
for (const auto &closedNode:closedSet){
if (!closedNode.currentNode.IsValid() ||
!closedNode.previousNode.IsValid()){
@@ -206,30 +200,24 @@
return false;
}
- projection.GeoToPixel(n1->GetCoord(),x1,y1);
- projection.GeoToPixel(n2->GetCoord(),x2,y2);
- painter.setPen(pen);
- painter.drawLine(x1,y1,x2,y2);
- }
-
- // closed, restricted
- painter.setBrush(QBrush(grey));
- pen.setColor(grey);
-
- for (const auto &closedNode:closedRestrictedSet){
- if (!closedNode.currentNode.IsValid() ||
- !closedNode.previousNode.IsValid()){
- continue;
- }
- if (!GetRouteNode(closedNode.currentNode,n1) ||
- !GetRouteNode(closedNode.previousNode,n2)){
- return false;
+ if (closedNode.currentRestricted){
+ painter.setBrush(QBrush(grey));
+ pen.setColor(grey);
+ } else {
+ painter.setBrush(QBrush(red));
+ pen.setColor(red);
}
- projection.GeoToPixel(n1->GetCoord(),x1,y1);
- projection.GeoToPixel(n2->GetCoord(),x2,y2);
+ osmscout::Vertex2D pos1;
+ osmscout::Vertex2D pos2;
+
+ projection.GeoToPixel(n1->GetCoord(),
+ pos1);
+ projection.GeoToPixel(n2->GetCoord(),
+ pos2);
painter.setPen(pen);
- painter.drawLine(x1,y1,x2,y2);
+ painter.drawLine(pos1.GetX(),pos1.GetY(),
+ pos2.GetX(),pos2.GetY());
}
// draw nodes in open list
@@ -242,10 +230,16 @@
if (!GetRouteNode(open->prev,n1)){
return false;
}
- projection.GeoToPixel(n1->GetCoord(),x1,y1);
- projection.GeoToPixel(open->node->GetCoord(),x2,y2);
+ osmscout::Vertex2D pos1;
+ osmscout::Vertex2D pos2;
+
+ projection.GeoToPixel(n1->GetCoord(),
+ pos1);
+ projection.GeoToPixel(open->node->GetCoord(),
+ pos2);
painter.setPen(pen);
- painter.drawLine(x1,y1,x2,y2);
+ painter.drawLine(pos1.GetX(),pos1.GetY(),
+ pos2.GetX(),pos2.GetY());
}
}
@@ -257,10 +251,17 @@
if (!GetRouteNode(current->prev,n1)){
return false;
}
- projection.GeoToPixel(n1->GetCoord(),x1,y1);
- projection.GeoToPixel(current->node->GetCoord(),x2,y2);
+
+ osmscout::Vertex2D pos1;
+ osmscout::Vertex2D pos2;
+
+ projection.GeoToPixel(n1->GetCoord(),
+ pos1);
+ projection.GeoToPixel(current->node->GetCoord(),
+ pos2);
painter.setPen(pen);
- painter.drawLine(x1,y1,x2,y2);
+ painter.drawLine(pos1.GetX(),pos1.GetY(),
+ pos2.GetX(),pos2.GetY());
}
painter.end();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Demos/src/Tiler.cpp
^
|
@@ -23,6 +23,8 @@
#include <osmscout/Database.h>
+#include <osmscout/projection/TileProjection.h>
+
#include <osmscout/util/StopClock.h>
#include <osmscout/util/Tiling.h>
#include <osmscout/util/CmdLineParsing.h>
@@ -359,7 +361,6 @@
for (uint32_t x=xTileStart; x<=xTileEnd; x++) {
agg::pixfmt_rgb24 pf(rbuf);
osmscout::StopClock timer;
- osmscout::GeoBox boundingBox;
osmscout::MapData data;
projection.Set(osmscout::OSMTileId(x,y),
@@ -368,7 +369,7 @@
tileWidth,
tileHeight);
- projection.GetDimensions(boundingBox);
+ osmscout::GeoBox boundingBox(projection.GetDimensions());
std::cout << "Drawing tile " << level << "." << y << "." << x << " " << boundingBox.GetDisplayText() << std::endl;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/DumpData/src/DumpData.cpp
^
|
@@ -526,12 +526,22 @@
if (!lanesValue.GetTurnForward().empty()) {
DumpIndent(indent+2);
- std::cout << "TurnForward: " << lanesValue.GetTurnForward() << std::endl;
+ std::cout << "TurnForward: ";
+ for (auto turn: lanesValue.GetTurnForward()) {
+ std::cout << LaneTurnString(turn);
+ std::cout << " ";
+ }
+ std::cout << std::endl;
}
if (!lanesValue.GetTurnBackward().empty()) {
DumpIndent(indent+2);
- std::cout << "TurnBackward: " << lanesValue.GetTurnBackward() << std::endl;
+ std::cout << "TurnBackward: ";
+ for (auto turn: lanesValue.GetTurnForward()) {
+ std::cout << LaneTurnString(turn);
+ std::cout << " ";
+ }
+ std::cout << std::endl;
}
if (!lanesValue.GetDestinationForward().empty()) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/OSMScoutOpenGL/src/OSMScoutOpenGL.cpp
^
|
@@ -173,8 +173,7 @@
loadData = 1;
lastEvent = std::chrono::steady_clock::now();
- osmscout::GeoBox boundingBox;
- renderer->GetProjection().GetDimensions(boundingBox);
+ osmscout::GeoBox boundingBox(renderer->GetProjection().GetDimensions());
osmscout::log.Info() << "BoundingBox: [" << boundingBox.GetMinLon() << " " << boundingBox.GetMinLat() << " "
<< boundingBox.GetMaxLon() << " " << boundingBox.GetMaxLat() << "]";
osmscout::log.Info() << "Center: [" << renderer->GetCenter().GetLon() << " " << renderer->GetCenter().GetLat() << "]";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/README.md
^
|
@@ -26,6 +26,11 @@
and ask your questions. English is the preferred language but other languages might be supported,
too.
+You can also get support in the matrix room `#libosmscout.matrix.org`. While
+it is a interactive chat room, an answer still may take some
+time, though.
+
+
# Installation
You can find detailed instruction how to get libraries and applications
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/CMakeLists.txt
^
|
@@ -37,6 +37,9 @@
#---- NumberSetPerformance
osmscout_test_project(NAME NumberSetPerformance SOURCES src/NumberSetPerformance.cpp)
+#---- OpeningHours
+osmscout_test_project(NAME OpeningHours SOURCES src/OpeningHours.cpp)
+
#---- ReaderScannerPerformance
osmscout_test_project(NAME ReaderScannerPerformance SOURCES src/ReaderScannerPerformance.cpp COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/data/testregion")
@@ -284,8 +287,15 @@
message("Skip QtFileDownloader test, libosmscout-client-qt is missing.")
endif()
+#---- ScreenBox
+osmscout_test_project(NAME ScreenBox SOURCES src/ScreenBox.cpp)
+
#---- SunriseSunsetTest
osmscout_test_project(NAME SunriseSunsetTest SOURCES src/SunriseSunsetTest.cpp)
#---- PolygonCenterTest
osmscout_test_project(NAME PolygonCenterTest SOURCES src/PolygonCenter.cpp)
+
+#---- MercatorProjection
+osmscout_test_project(NAME MercatorProjectionTest SOURCES src/MercatorProjection.cpp)
+
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/areaarea.idx
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/areanode.idx
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/areas.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/areaway.idx
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/bounding.dat
^
|
@@ -1 +1 @@
-.=RF¨\>bSF
\ No newline at end of file
+Ê<yRF¨\>bSF
\ No newline at end of file
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/coverage.idx
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/intersections.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/intersections.idx
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/location.idx
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/nodes.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/route.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/router.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/router2.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/textloc.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/textother.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/textpoi.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/textregion.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/types.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/water.idx
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/ways.dat
^
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/data/testregion/waysopt.dat
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/include/catch.hpp
^
|
@@ -1,9 +1,9 @@
/*
- * Catch v2.13.7
- * Generated: 2021-07-28 20:29:27.753164
+ * Catch v2.13.10
+ * Generated: 2022-10-16 11:01:23.452308
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
- * Copyright (c) 2021 Two Blue Cubes Ltd. All rights reserved.
+ * Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,7 +15,7 @@
#define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 13
-#define CATCH_VERSION_PATCH 7
+#define CATCH_VERSION_PATCH 10
#ifdef __clang__
# pragma clang system_header
@@ -240,9 +240,6 @@
// Visual C++
#if defined(_MSC_VER)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
-
// Universal Windows platform does not support SEH
// Or console colours (or console at all...)
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
@@ -251,13 +248,18 @@
# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
# endif
+# if !defined(__clang__) // Handle Clang masquerading for msvc
+
// MSVC traditional preprocessor needs some workaround for __VA_ARGS__
// _MSVC_TRADITIONAL == 0 means new conformant preprocessor
// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
-# if !defined(__clang__) // Handle Clang masquerading for msvc
# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
# endif // MSVC_TRADITIONAL
+
+// Only do this if we're not using clang on Windows, which uses `diagnostic push` & `diagnostic pop`
+# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
+# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
# endif // __clang__
#endif // _MSC_VER
@@ -1010,34 +1012,34 @@
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, typename TestType, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
#endif
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, Signature, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, Signature, __VA_ARGS__ ) )
#endif
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
#endif
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
#endif
#endif
@@ -1050,7 +1052,7 @@
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
static void TestName()
#define INTERNAL_CATCH_TESTCASE( ... ) \
- INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
+ INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_S_T_ ), __VA_ARGS__ )
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
@@ -1072,7 +1074,7 @@
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
void TestName::test()
#define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
- INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ )
+ INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_S_T_ ), ClassName, __VA_ARGS__ )
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
@@ -1113,18 +1115,18 @@
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, typename TestType, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
#endif
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, Signature, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, Signature, __VA_ARGS__ ) )
#endif
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \
@@ -1162,18 +1164,18 @@
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T,__VA_ARGS__)
+ INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, typename T,__VA_ARGS__)
#else
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, typename T, __VA_ARGS__ ) )
#endif
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__)
+ INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, Signature, __VA_ARGS__)
#else
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, Signature, __VA_ARGS__ ) )
#endif
#define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\
@@ -1204,7 +1206,7 @@
static void TestFunc()
#define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList) \
- INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, TmplList )
+ INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, TmplList )
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
@@ -1237,18 +1239,18 @@
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
#endif
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_C_L_A_S_S_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
#endif
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\
@@ -1289,18 +1291,18 @@
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T, __VA_ARGS__ )
+ INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), ClassName, Name, Tags, typename T, __VA_ARGS__ )
#else
#define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) )
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/meson.build
^
|
@@ -1,80 +1,93 @@
testIncDir = include_directories('include')
+testInstallDir = 'share/osmscout/tests'
+
AccessParse = executable('AccessParse',
'src/AccessParse.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
AsyncProcessing = executable('AsyncProcessing',
'src/AsyncProcessing.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, threadDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
TimeParse = executable('TimeParse',
'src/TimeParse.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
Bearing = executable('Bearing',
'src/Bearing.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
BitsAndBytesNeeded = executable('BitsAndBytesNeeded',
'src/BitsAndBytesNeeded.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
ByteTest = executable('ByteTest',
'src/ByteTest.cpp',
include_directories: [testIncDir],
dependencies: [mathDep],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
CachePerformance = executable('CachePerformance',
'src/CachePerformance.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
CalculateResolution = executable('CalculateResolution',
'src/CalculateResolution.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
CmdLineParsing = executable('CmdLineParsing',
'src/CmdLineParsing.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
ColorParse = executable('ColorParse',
'src/ColorParse.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
CoordinateEncoding = executable('CoordinateEncoding',
'src/CoordinateEncoding.cpp',
include_directories: [osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
if buildMapQt
if get_option('qtVersion') == 5
@@ -86,7 +99,8 @@
include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep, qt5GuiDep, qt5WidgetsDep],
link_with: [osmscoutmapqt, osmscoutmap, osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
elif get_option('qtVersion') == 6
drawtextMocs = qt6.preprocess(moc_headers : ['include/DrawWindow.h'])
@@ -96,7 +110,8 @@
include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep, qt6GuiDep, qt6WidgetsDep],
link_with: [osmscoutmapqt, osmscoutmap, osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
endif
endif
@@ -105,49 +120,56 @@
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
FeatureLabelTest = executable('FeatureLabelTest',
'src/FeatureLabelTest.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
File = executable('File',
'src/File.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
FileScannerWriter = executable('FileScannerWriter',
'src/FileScannerWriter.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
GeoBox = executable('GeoBox',
'src/GeoBox.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
GeoCoordParse = executable('GeoCoordParse',
'src/GeoCoordParse.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
Geometry = executable('Geometry',
'src/Geometry.cpp',
include_directories: [testIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
if buildImport
LocationServiceTest = executable('LocationServiceTest',
@@ -160,7 +182,8 @@
include_directories: [testIncDir, osmscouttestIncDir, osmscoutimportIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep],
link_with: [osmscouttest, osmscoutimport, osmscout],
- install: false)
+ install: true,
+ install_dir: testInstallDir)
endif
MapRotate = executable('MapRotate',
@@ -168,36 +191,56 @@
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/CoordBufferTest.cpp
^
|
@@ -10,10 +10,10 @@
CoordBuffer buffer;
CoordBufferRange range;
- buffer.PushCoord(0,0);
- buffer.PushCoord(10,0);
- buffer.PushCoord(5,1);
- buffer.PushCoord(0,0);
+ buffer.PushCoord(osmscout::Vertex2D(0.0,0.0));
+ buffer.PushCoord(osmscout::Vertex2D(10.0,0.0));
+ buffer.PushCoord(osmscout::Vertex2D(5.0,1.0));
+ buffer.PushCoord(osmscout::Vertex2D(0.0,0.0));
range=buffer.GenerateParallelWay(CoordBufferRange(buffer,0,3), /*offset*/-1);
REQUIRE(range.GetEnd() - range.GetStart() >= 3);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/DrawTextQt.cpp
^
|
@@ -228,7 +228,7 @@
for (int x=startOffset;(x+startOffset)<width();x++){
//int y=std::cos(((double)(x+sinStart)/(double)width()) *3*M_PI) * (height()/2-44) + height()/2;
int y=std::sin(((double)(x+sinStart+moveOffset)/(double)width()) *2*M_PI) * (height()/2-44) + height()/2;
- p.AddPoint(x,y);
+ p.AddPoint(osmscout::Vertex2D(x,y));
}
sinStart+=30;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/GeoCoordParse.cpp
^
|
@@ -100,4 +100,13 @@
REQUIRE(CheckParseSuccess("40,123 -7,123", osmscout::GeoCoord(40.123, -7.123)));
REQUIRE(CheckParseSuccess("50°5'8.860\"N 14°24'37.592\"E", osmscout::GeoCoord(50.0857944, 14.4104422)));
REQUIRE(CheckParseSuccess("N 50°5.14767' E 14°24.62653'", osmscout::GeoCoord(50.0857944, 14.4104422)));
+
+ // booking.com format
+ REQUIRE(CheckParseSuccess("N 050° 5.14767, E 14° 24.62653", osmscout::GeoCoord(50.0857944, 14.4104422)));
+
+ // values outside lat/lon range
+ REQUIRE(CheckParseFail("99 7"));
+ REQUIRE(CheckParseFail("-99 7"));
+ REQUIRE(CheckParseFail("40 190"));
+ REQUIRE(CheckParseFail("40 -190"));
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/LabelPathTest.cpp
^
|
@@ -9,9 +9,9 @@
TEST_CASE("Angle variance with low angle")
{
LabelPath path;
- path.AddPoint(0, 0);
- path.AddPoint(10, 0);
- path.AddPoint(20, 4);
+ path.AddPoint(osmscout::Vertex2D(0.0, 0.0));
+ path.AddPoint(osmscout::Vertex2D(10.0, 0.0));
+ path.AddPoint(osmscout::Vertex2D(20.0, 4.0));
REQUIRE(path.TestAngleVariance(0, 20, DegToRad(45)));
REQUIRE_FALSE(path.TestAngleVariance(0, 20, DegToRad(10)));
@@ -20,9 +20,9 @@
TEST_CASE("Angle variance with low angle 2")
{
LabelPath path;
- path.AddPoint(10, 0);
- path.AddPoint(0, 0);
- path.AddPoint(-10, 4);
+ path.AddPoint(osmscout::Vertex2D(10.0, 0.0));
+ path.AddPoint(osmscout::Vertex2D(0.0, 0.0));
+ path.AddPoint(osmscout::Vertex2D(-10.0, 4.0));
REQUIRE(path.TestAngleVariance(0, 20, DegToRad(25)));
REQUIRE_FALSE(path.TestAngleVariance(0, 20, DegToRad(10)));
@@ -31,9 +31,9 @@
TEST_CASE("Angle variance with low angle 3")
{
LabelPath path;
- path.AddPoint(-10, 0);
- path.AddPoint(0, 0);
- path.AddPoint(10, 4);
+ path.AddPoint(osmscout::Vertex2D(-10.0, 0.0));
+ path.AddPoint(osmscout::Vertex2D(0.0, 0.0));
+ path.AddPoint(osmscout::Vertex2D(10.0, 4.0));
REQUIRE(path.TestAngleVariance(0, 20, DegToRad(25)));
REQUIRE_FALSE(path.TestAngleVariance(0, 20, DegToRad(10)));
@@ -42,8 +42,8 @@
TEST_CASE("Angle variance with high angle")
{
LabelPath path;
- path.AddPoint(10,0);
- path.AddPoint(0,0);
- path.AddPoint(10,5);
+ path.AddPoint(osmscout::Vertex2D(10.0,0.0));
+ path.AddPoint(osmscout::Vertex2D(0.0,0.0));
+ path.AddPoint(osmscout::Vertex2D(10.0,5.0));
REQUIRE_FALSE(path.TestAngleVariance(0, 20, DegToRad(45)));
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/MapRotate.cpp
^
|
@@ -19,6 +19,8 @@
#include <iostream>
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscoutmap/MapPainterNoOp.h>
#include <TestMain.h>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/MercatorProjection.cpp
^
|
@@ -0,0 +1,268 @@
+/*
+ MercatorProjection - a test program for libosmscout
+ Copyright (C) 2023 Tim Teulings
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "osmscout/projection/MercatorProjection.h"
+
+#include <TestMain.h>
+
+osmscout::GeoCoord defaultCenter(51.51241,
+ 7.46525);
+double defaultAngle =0.0;
+double defaultDpi =96.0;
+double defaultWidth =800;
+double defaultHeight=480;
+
+TEST_CASE("GetCenter() should return the center")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.GetCenter() == defaultCenter);
+}
+
+TEST_CASE("GetWidth() should return width")
+{
+ osmscout::MercatorProjection projection;
+ osmscout::GeoCoord center(51.51241,
+ 7.46525);
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.GetWidth()==defaultWidth);
+}
+
+TEST_CASE("GetHeight() should return height")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.GetHeight()==defaultHeight);
+}
+
+TEST_CASE("CanBatch() should return false")
+{
+ osmscout::MercatorProjection projection;
+
+ REQUIRE_FALSE(projection.CanBatch());
+}
+
+TEST_CASE("Uninitialised projection is not valid")
+{
+ osmscout::MercatorProjection projection;
+
+ REQUIRE_FALSE(projection.IsValid());
+}
+
+TEST_CASE("Correctly initialised projection is valid")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.IsValid());
+}
+
+TEST_CASE("Is validFor() for europe")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.IsValidFor(defaultCenter));
+}
+
+TEST_CASE("Is not validFor() north pole")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE_FALSE(projection.IsValidFor(osmscout::GeoCoord(90.0,0.0)));
+}
+
+TEST_CASE("Is not validFor() south pole")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE_FALSE(projection.IsValidFor(osmscout::GeoCoord(-90.0,0.0)));
+}
+
+TEST_CASE("GetPixelSize()")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.GetPixelSize()==Approx(5.9462763732));
+}
+
+TEST_CASE("GetMeterInMM()")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.GetMeterInMM()==Approx(0.0444956334));
+}
+
+TEST_CASE("GetMeterInPixel()")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.GetMeterInPixel()==Approx(0.1681724725));
+}
+
+TEST_CASE("ConvertWidthToPixel()")
+{
+ osmscout::MercatorProjection projection;
+
+ projection.Set(defaultCenter,
+ defaultAngle,
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.ConvertWidthToPixel(100.0)==Approx(377.9527559055));
+}
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/OpeningHours.cpp
^
|
@@ -0,0 +1,81 @@
+#include <osmscout/util/OpeningHours.h>
+
+#include <TestMain.h>
+
+TEST_CASE("Parse garbage")
+{
+ REQUIRE(osmscout::OpeningHours::Parse("garbage") == std::nullopt);
+}
+
+TEST_CASE("Parse 24/7")
+{
+ auto oh=osmscout::OpeningHours::Parse("24/7");
+ REQUIRE(oh != std::nullopt);
+
+ REQUIRE(oh->GetRules().size()==7);
+ REQUIRE(oh->GetRules()[0].intervals.size()==1);
+
+ REQUIRE(oh->GetRules()[0].intervals[0].from.hour==0);
+ REQUIRE(oh->GetRules()[0].intervals[0].from.minute==0);
+ REQUIRE(oh->GetRules()[0].intervals[0].to.hour==24);
+ REQUIRE(oh->GetRules()[0].intervals[0].to.minute==0);
+}
+
+TEST_CASE("Parse simple opening hours")
+{
+ auto oh=osmscout::OpeningHours::Parse("Mo-Fr 08:00-12:00,13:00-17:30");
+ REQUIRE(oh != std::nullopt);
+
+ REQUIRE(oh->GetRules().size()==5);
+ REQUIRE(oh->GetRules()[0].day==osmscout::OpeningHours::WeekDay::Monday);
+ REQUIRE(oh->GetRules()[1].day==osmscout::OpeningHours::WeekDay::Tuesday);
+ REQUIRE(oh->GetRules()[2].day==osmscout::OpeningHours::WeekDay::Wednesday);
+ REQUIRE(oh->GetRules()[3].day==osmscout::OpeningHours::WeekDay::Thursday);
+ REQUIRE(oh->GetRules()[4].day==osmscout::OpeningHours::WeekDay::Friday);
+
+ REQUIRE(oh->GetRules()[0].intervals.size()==2);
+
+ REQUIRE(oh->GetRules()[0].intervals[0].from.hour==8);
+ REQUIRE(oh->GetRules()[0].intervals[0].from.minute==0);
+ REQUIRE(oh->GetRules()[0].intervals[0].to.hour==12);
+ REQUIRE(oh->GetRules()[0].intervals[0].to.minute==0);
+
+ REQUIRE(oh->GetRules()[0].intervals[1].from.hour==13);
+ REQUIRE(oh->GetRules()[0].intervals[1].from.minute==0);
+ REQUIRE(oh->GetRules()[0].intervals[1].to.hour==17);
+ REQUIRE(oh->GetRules()[0].intervals[1].to.minute==30);
+}
+
+TEST_CASE("Parse multiple rules")
+{
+ auto oh=osmscout::OpeningHours::Parse("Mo-Fr 08:00-18:00; Sa 08:00-12:00");
+ REQUIRE(oh != std::nullopt);
+
+ REQUIRE(oh->GetRules().size()==6);
+}
+
+TEST_CASE("Parse multiple days")
+{
+ auto oh = osmscout::OpeningHours::Parse("Mo,We 08:00-12:00");
+ REQUIRE(oh != std::nullopt);
+
+ REQUIRE(oh->GetRules().size() == 2);
+ REQUIRE(oh->GetRules()[0].day==osmscout::OpeningHours::WeekDay::Monday);
+ REQUIRE(oh->GetRules()[1].day==osmscout::OpeningHours::WeekDay::Wednesday);
+}
+
+TEST_CASE("Public holidays as weekend")
+{
+ auto oh = osmscout::OpeningHours::Parse("Mo-Fr 08:00-18:00; Sa-Su,PH 08:00-12:00");
+ REQUIRE(oh != std::nullopt);
+ REQUIRE(oh->GetRules().size() == 8);
+}
+
+TEST_CASE("Closed at public holidays")
+{
+ auto oh = osmscout::OpeningHours::Parse("Mo-Fr 08:00-18:00; PH off");
+ REQUIRE(oh != std::nullopt);
+ REQUIRE(oh->GetRules().size() == 6);
+ REQUIRE(oh->GetRules()[5].day==osmscout::OpeningHours::WeekDay::PublicHoliday);
+ REQUIRE(oh->GetRules()[5].intervals.empty());
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/PerformanceTest.cpp
^
|
@@ -25,6 +25,9 @@
#include "config.h"
#include <osmscout/Database.h>
+
+#include <osmscout/projection/TileProjection.h>
+
#include <osmscoutmap/MapService.h>
#if defined(HAVE_LIB_OSMSCOUTMAPCAIRO)
@@ -835,7 +838,6 @@
osmscout::MapData data;
osmscout::OSMTileIdBox tileBox(osmscout::OSMTileId(tile.GetX()-1,tile.GetY()-1),
osmscout::OSMTileId(tile.GetX()+1,tile.GetY()+1));
- osmscout::GeoBox boundingBox;
if ((current % delta)==0) {
std::cout << current*100/tileCount << "% " << current;
@@ -854,7 +856,8 @@
args.TileWidth(),
args.TileHeight());
- projection.GetDimensions(boundingBox);
+ osmscout::GeoBox boundingBox(projection.GetDimensions());
+
projection.SetLinearInterpolationUsage(level.Get() >= 10);
for (size_t i=0; i<args.loadRepeat; i++) {
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/ScreenBox.cpp
^
|
@@ -0,0 +1,79 @@
+/*
+ GeoBox - a test program for libosmscout
+ Copyright (C) 2023 Tim Teulings
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/util/ScreenBox.h>
+
+#include <TestMain.h>
+
+TEST_CASE("GetCenter() should return the center")
+{
+ osmscout::ScreenBox box(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(1, 1));
+
+ REQUIRE(box.GetCenter()==osmscout::Vertex2D::ZERO);
+}
+
+TEST_CASE("GetWidth() should return width")
+{
+ osmscout::ScreenBox box(osmscout::Vertex2D(-2, -2),
+ osmscout::Vertex2D(1, 2));
+
+ REQUIRE(box.GetWidth()==3.0);
+}
+
+TEST_CASE("GetHeight() should return height")
+{
+ osmscout::ScreenBox box(osmscout::Vertex2D(-2, -2),
+ osmscout::Vertex2D(1, 2));
+
+ REQUIRE(box.GetHeight()==4.0);
+}
+
+TEST_CASE("Intersection check for disjunctive areas")
+{
+ osmscout::ScreenBox a(osmscout::Vertex2D(0, 0),
+ osmscout::Vertex2D(1, 1));
+ osmscout::ScreenBox b(osmscout::Vertex2D(2, 2),
+ osmscout::Vertex2D(3, 3));
+
+ REQUIRE_FALSE(a.Intersects(b));
+}
+
+TEST_CASE("Intersection check for containing areas")
+{
+ osmscout::ScreenBox a(osmscout::Vertex2D(-2, -2),
+ osmscout::Vertex2D(2, 2));
+ osmscout::ScreenBox b(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(1, 1));
+
+ REQUIRE(a.Intersects(b));
+ REQUIRE(b.Intersects(a));
+}
+
+TEST_CASE("Resize >0")
+{
+ osmscout::ScreenBox box(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(1, 1));
+ osmscout::ScreenBox resizedBox=box.Resize(1);
+
+ osmscout::ScreenBox expectedResizedBox(osmscout::Vertex2D(-2, -2),
+ osmscout::Vertex2D(2, 2));
+
+ REQUIRE(expectedResizedBox==resizedBox);
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/StringUtils.cpp
^
|
@@ -281,3 +281,11 @@
REQUIRE(osmscout::NumberToString(1002030, locale) == "1 002 030");
REQUIRE(osmscout::NumberToString(-1002030, locale) == "-1 002 030");
}
+
+TEST_CASE("Trim string")
+{
+ REQUIRE(osmscout::Trim("").empty());
+ REQUIRE(osmscout::Trim("a b c")=="a b c");
+ REQUIRE(osmscout::Trim(" abc ")=="abc");
+ REQUIRE(osmscout::Trim("-- abc --", '-')==" abc ");
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/Tests/src/TransPolygon.cpp
^
|
@@ -22,6 +22,8 @@
#include <TestWay.h>
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Transformation.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/ci/docker/debian_bullseye_gcc_meson/Dockerfile
^
|
@@ -26,9 +26,11 @@
RUN apt-get update && apt-get install -y \
g++ \
- meson \
+ python3-pip \
&& rm -rf /var/lib/apt/lists/*
+RUN pip install meson ninja
+
RUN mkdir /work
COPY data/build.sh /work
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/ci/docker/debian_buster_gcc_meson/Dockerfile
^
|
@@ -25,9 +25,11 @@
RUN apt-get update && apt-get install -y \
g++ \
- meson \
+ python3-pip \
&& rm -rf /var/lib/apt/lists/*
+RUN pip3 install meson ninja
+
RUN mkdir /work
COPY data/build.sh /work
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/ci/docker/ubuntu_22.04_gcc_meson_qt6/Dockerfile
^
|
@@ -16,10 +16,12 @@
ENV QT_QPA_PLATFORM offscreen
RUN apt-get update && apt-get install -y \
- meson \
g++ \
+ python3-pip \
&& rm -rf /var/lib/apt/lists/*
+RUN pip install meson ninja
+
RUN mkdir /work
COPY data/build.sh /work
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/jreleaser.yml
^
|
@@ -0,0 +1,43 @@
+project:
+ name: libosmscout
+ description: Libosmscout is a C++ library for offline map rendering, routing and location lookup based on OpenStreetMap data
+ longDescription: Libosmscout is a C++ library for offline map rendering, routing and location lookup based on OpenStreetMap data
+ links:
+ homepage: https://libosmscout.sourceforge.net/
+ contact: https://libosmscout.sourceforge.net/documentation/contact/
+ authors:
+ - Tim Teulings
+ - Lukáš Karas
+ - Others
+ maintainers:
+ - Framstag
+ - Karry
+ license: LGPL-2.1-or-later
+ inceptionYear: 2009
+ stereotype: NONE
+ versionPattern: CHRONVER
+ snapshot:
+ pattern: .*-latest
+ label: latest
+ fullChangelog: true
+
+release:
+ github:
+ owner: Framstag
+ overwrite: true
+ issues:
+ enabled: true
+ changelog:
+ formatted: ALWAYS
+ preset: conventional-commits
+ contributors:
+ format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
+ extraProperties:
+ categorizeScopes: true
+
+distributions:
+ source:
+ type: BINARY
+ artifacts:
+ - path: dist/meson-dist/libosmscout-{{projectVersion}}.tar.xz
+ - path: dist/meson-dist/libosmscout-{{projectVersion}}.zip
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/CMakeLists.txt
^
|
@@ -2,8 +2,8 @@
set(CMAKE_AUTORCC ON)
set(HEADER_FILES
- include/osmscoutclientqt/AdminRegionInfo.h
- include/osmscoutclientqt/ClientQtImportExport.h
+ include/osmscoutclientqt/AdminRegionInfo.h
+ include/osmscoutclientqt/ClientQtImportExport.h
include/osmscoutclientqt/DBThread.h
include/osmscoutclientqt/DBInstance.h
include/osmscoutclientqt/ElevationChartWidget.h
@@ -17,6 +17,7 @@
include/osmscoutclientqt/MapWidget.h
include/osmscoutclientqt/OnlineTileProvider.h
include/osmscoutclientqt/OnlineTileProviderModel.h
+ include/osmscoutclientqt/OpeningHoursModel.h
include/osmscoutclientqt/OsmTileDownloader.h
include/osmscoutclientqt/OSMTile.h
include/osmscoutclientqt/RoutingModel.h
@@ -76,6 +77,7 @@
src/osmscoutclientqt/MapWidget.cpp
src/osmscoutclientqt/OnlineTileProvider.cpp
src/osmscoutclientqt/OnlineTileProviderModel.cpp
+ src/osmscoutclientqt/OpeningHoursModel.cpp
src/osmscoutclientqt/OSMTile.cpp
src/osmscoutclientqt/OsmTileDownloader.cpp
src/osmscoutclientqt/RoutingModel.cpp
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/meson.build
^
|
@@ -19,6 +19,7 @@
'osmscoutclientqt/InputHandler.h',
'osmscoutclientqt/OnlineTileProvider.h',
'osmscoutclientqt/OnlineTileProviderModel.h',
+ 'osmscoutclientqt/OpeningHoursModel.h',
'osmscoutclientqt/SearchLocationModel.h',
'osmscoutclientqt/Settings.h',
'osmscoutclientqt/MapWidget.h',
@@ -60,4 +61,10 @@
'osmscoutclientqt/InstalledVoicesModel.h',
]
-install_headers(osmscoutclientqtHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutclientqtHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutclientqtHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/DBJob.h
^
|
@@ -27,9 +27,12 @@
#include <QReadWriteLock>
#include <osmscout/BasemapDatabase.h>
-#include <osmscoutclientqt/DBInstance.h>
+
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscoutmap/DataTileCache.h>
+#include <osmscoutclientqt/DBInstance.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/IconAnimation.h
^
|
@@ -22,7 +22,8 @@
#include <osmscoutclientqt/ClientQtImportExport.h>
-#include <osmscout/util/Projection.h>
+#include <osmscout/projection/Projection.h>
+
#include <osmscoutclientqt/IconLookup.h>
#include <QObject>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/IconLookup.h
^
|
@@ -52,6 +52,7 @@
QString operatorName;
QString phone;
QString website;
+ QString openingHours;
QImage image;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/InputHandler.h
^
|
@@ -115,7 +115,7 @@
struct AccumulatorEvent
{
QPointF pos;
- QElapsedTimer time;
+ QElapsedTimer timer;
};
/**
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/LocationInfoModel.h
^
|
@@ -79,7 +79,8 @@
AddressLocationRole = Qt::UserRole+11,
AddressNumberRole = Qt::UserRole+12,
IndexedAdminRegionRole = Qt::UserRole+13,
- AltLangName = Qt::UserRole+14
+ AltLangName = Qt::UserRole+14,
+ OpeningHours = Qt::UserRole+15
};
Q_ENUM(Roles)
@@ -102,7 +103,7 @@
};
Q_INVOKABLE double distance(double lat1, double lon1,
- double lat2, double lon2);
+ double lat2, double lon2);
Q_INVOKABLE QString bearing(double lat1, double lon1,
double lat2, double lon2);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapWidget.h
^
|
@@ -181,7 +181,8 @@
void iconTapped(QPoint screenCoord, double lat, double lon, QString databasePath,
QString objectType, quint64 objectId, int poiId, QString type,
- QString name, QString altName, QString ref, QString operatorName, QString phone, QString website);
+ QString name, QString altName, QString ref, QString operatorName, QString phone, QString website,
+ QString openingHours);
void stylesheetFilenameChanged();
void styleErrorsChanged();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NavigationModel.h
^
|
@@ -215,7 +215,7 @@
{
QStringList result;
for (const auto &turn : lane.turns){
- result << QString::fromStdString(turn);
+ result << QString::fromStdString(LaneTurnString(turn));
}
return result;
}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OpeningHoursModel.h
^
|
@@ -0,0 +1,98 @@
+#ifndef OSMSCOUT_CLIENT_QT_OPENING_HOURS_MODEL
+#define OSMSCOUT_CLIENT_QT_OPENING_HOURS_MODEL
+
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <osmscout/util/OpeningHours.h>
+
+#include <QObject>
+#include <QDateTime>
+#include <QAbstractListModel>
+#include <QLocale>
+
+namespace osmscout {
+
+/**
+ * \ingroup QtAPI
+ *
+ * QML Component for parsing OSM opening hours.
+ */
+class OSMSCOUT_CLIENT_QT_API OpeningHoursModel : public QAbstractListModel
+{
+ Q_OBJECT
+ Q_PROPERTY(QString openingHours READ getOpeningHours WRITE setOpeningHours NOTIFY updated)
+ Q_PROPERTY(QStringList today READ getToday NOTIFY updated)
+
+signals:
+ void updated();
+ void parseError();
+
+public:
+ enum Roles {
+ DayRole = Qt::UserRole,
+ ShortDayRole = Qt::UserRole+1,
+ TimeIntervalsRole = Qt::UserRole+2,
+ IsTodayRole = Qt::UserRole+3,
+ };
+ Q_ENUM(Roles)
+
+public:
+ OpeningHoursModel() = default;
+ OpeningHoursModel(const OpeningHoursModel &) = delete;
+ OpeningHoursModel(OpeningHoursModel&&) = delete;
+
+ ~OpeningHoursModel() override = default;
+
+ OpeningHoursModel& operator=(const OpeningHoursModel&) = delete;
+ OpeningHoursModel& operator=(OpeningHoursModel&&) = delete;
+
+ Q_INVOKABLE virtual int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const
+ {
+ return model.size();
+ };
+
+ Q_INVOKABLE QVariant data(const QModelIndex &index, int role) const override;
+ QHash<int, QByteArray> roleNames() const override;
+ Q_INVOKABLE Qt::ItemFlags flags(const QModelIndex &index) const override;
+
+ QStringList getToday() const;
+
+ QString getOpeningHours() const
+ {
+ return rawOpeningHours;
+ }
+
+ void setOpeningHours(const QString &openingHours);
+
+private:
+ QStringList intervalStrings(const std::vector<OpeningHours::TimeInterval> &intervals) const;
+ QString dayName(OpeningHours::WeekDay weekDay) const;
+ QString shortDayName(OpeningHours::WeekDay weekDay) const;
+
+private:
+ QString rawOpeningHours;
+ std::vector<OpeningHours::Rule> model;
+ QLocale locale;
+};
+}
+
+#endif /* OSMSCOUT_CLIENT_QT_OPENING_HOURS_MODEL */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/RouteDescriptionBuilder.h
^
|
@@ -59,15 +59,15 @@
GeoCoord coord;
Distance distance;
Distance distancePrevious;
- Duration time;
- Duration timePrevious;
+ Duration timestamp;
+ Duration timestampPrevious;
public:
Callback(QList<RouteStep> &routeSteps,
const Distance &stopAfter = Distance::Lowest(),
bool skipInformative=false);
- ~Callback() override;
+ ~Callback() override = default;
void OnStart(const RouteDescription::StartDescriptionRef& startDescription,
const RouteDescription::TypeNameDescriptionRef& typeNameDescription,
@@ -112,9 +112,7 @@
RouteStep MkStep(const QString &name);
};
public:
- RouteDescriptionBuilder();
-
- ~RouteDescriptionBuilder() override;
+ ~RouteDescriptionBuilder() override = default;
void GenerateRouteSteps(const osmscout::RouteDescription &routeDescription,
QList<RouteStep> &routeSteps) const;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/RouteStep.h
^
|
@@ -85,8 +85,8 @@
Distance distance; //!< Estimate distance from route start
Distance distanceDelta; //!< Estimate distance from previous route step
Distance distanceTo; //!< Estimate distance to this step (used with navigation)
- Duration time; //!< Estimate time from route start
- Duration timeDelta; //!< Estimate time from previous route step
+ Duration timestamp; //!< Estimate time from route start
+ Duration timestampDelta; //!< Estimate time from previous route step
QString description; //!< Formatted (html) verbose description (translated already)
QString shortDescription; //!< Plain short description (translated already)
QStringList streetNames; //!< Street names leading to this step
@@ -111,8 +111,8 @@
const GeoCoord &coord,
const Distance &distance,
const Distance &distanceDelta,
- const Duration &time,
- const Duration &timeDelta,
+ const Duration ×tamp,
+ const Duration ×tampDelta,
const QStringList &streetNames);
RouteStep(const RouteStep& other);
@@ -161,12 +161,12 @@
double getTime() const
{
- return DurationAsSeconds(time);
+ return DurationAsSeconds(timestamp);
}
double getTimeDelta() const
{
- return DurationAsSeconds(timeDelta);
+ return DurationAsSeconds(timestampDelta);
}
QString getDescription() const
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/meson.build
^
|
@@ -31,6 +31,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, qt5GuiDep, qt5QmlDep, qt5QuickDep, qt5WidgetsDep, qt5NetworkDep, qt5SvgDep, qt5MultimediaDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt],
+ version: libraryVersion,
install: true)
elif get_option('qtVersion') == 6
mocFiles = qt6.preprocess(moc_headers : mocHeaders,
@@ -43,6 +44,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, qt6GuiDep, qt6QmlDep, qt6QuickDep, qt6WidgetsDep, qt6NetworkDep, qt6SvgDep, qt6MultimediaDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt],
+ version: libraryVersion,
install: true)
endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/meson.build
^
|
@@ -15,6 +15,7 @@
'src/osmscoutclientqt/InputHandler.cpp',
'src/osmscoutclientqt/OnlineTileProvider.cpp',
'src/osmscoutclientqt/OnlineTileProviderModel.cpp',
+ 'src/osmscoutclientqt/OpeningHoursModel.cpp',
'src/osmscoutclientqt/SearchLocationModel.cpp',
'src/osmscoutclientqt/Settings.cpp',
'src/osmscoutclientqt/MapWidget.cpp',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/DBJob.cpp
^
|
@@ -97,8 +97,7 @@
const std::list<DBInstanceRef> &databases,
QReadLocker *locker)
{
- osmscout::GeoBox lookupBox;
- lookupProjection.GetDimensions(lookupBox);
+ osmscout::GeoBox lookupBox(lookupProjection.GetDimensions());
std::list<DBInstanceRef> relevantDatabases;
for (const auto &db:databases){
if (!db->IsOpen() || (!db->GetStyleConfig())) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/IconAnimation.cpp
^
|
@@ -61,8 +61,9 @@
void IconAnimation::paint(QPainter *painter, const MercatorProjection &projection)
{
for (Animation &animation: icons) {
- double x,y;
- projection.GeoToPixel(animation.icon.coord, x, y);
+ osmscout::Vertex2D screenPos;
+ projection.GeoToPixel(animation.icon.coord,
+ screenPos);
double w = animation.size;
double h = animation.icon.image.height() * (w / animation.icon.image.width());
@@ -70,9 +71,9 @@
double r = std::sqrt(std::pow(w, 2) + std::pow(h, 2)) / 2;
painter->setPen(Qt::NoPen);
painter->setBrush(QBrush(QColor::fromRgbF(0, 0, 0, 0.1)));
- painter->drawEllipse(QPointF(x, y) ,r ,r);
+ painter->drawEllipse(QPointF(screenPos.GetX(), screenPos.GetY()) ,r ,r);
- painter->drawImage(QRectF(x-w/2, y-h/2, w, h), animation.icon.image);
+ painter->drawImage(QRectF(screenPos.GetX()-w/2, screenPos.GetY()-h/2, w, h), animation.icon.image);
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/IconLookup.cpp
^
|
@@ -71,22 +71,29 @@
const TypeInfoRef& type,
const FeatureValueBuffer& featureBuffer) {
if (iconStyle && iconStyle->IsVisible() && !iconStyle->IsOverlay()) {
- double x, y;
- projection.GeoToPixel(coord, x, y);
+ osmscout::Vertex2D screenPos;
+ projection.GeoToPixel(coord,
+ screenPos);
QRectF iconRect;
if (!iconStyle->GetIconName().empty()) {
- iconRect=QRectF(x - iconSize/2, y-iconSize/2, iconSize, iconSize);
+ iconRect=QRectF(screenPos.GetX() - iconSize/2,
+ screenPos.GetY()-iconSize/2,
+ iconSize,
+ iconSize);
} else {
auto symbol=iconStyle->GetSymbol();
assert(symbol);
double w=symbol->GetWidth(projection);
double h=symbol->GetHeight(projection);
- iconRect=QRectF(x - w/2, y-h/2, w, h);
+ iconRect=QRectF(screenPos.GetX() - w/2,
+ screenPos.GetY()-h/2,
+ w,
+ h);
}
if (iconRect.intersects(tapRectangle)) {
double distanceSquare=iconRect.contains(lookupCoord) ? 0 :
- std::pow(lookupCoord.x()-x,2)+std::pow(lookupCoord.y()-y,2);
+ std::pow(lookupCoord.x()-screenPos.GetX(),2)+std::pow(lookupCoord.y()-screenPos.GetY(),2);
QString name;
QString altName;
@@ -94,6 +101,7 @@
QString operatorName;
QString phone;
QString website;
+ QString openingHours;
if (const osmscout::NameFeatureValue *nameValue=featureBuffer.findValue<osmscout::NameFeatureValue>();
nameValue!=nullptr){
name=QString::fromStdString(nameValue->GetLabel(Locale(), 0));
@@ -118,10 +126,15 @@
websiteValue!=nullptr){
website=QString::fromStdString(websiteValue->GetWebsite());
}
+ if (const osmscout::OpeningHoursFeatureValue *openingHoursValue=featureBuffer.findValue<osmscout::OpeningHoursFeatureValue>();
+ openingHoursValue!=nullptr){
+ openingHours=QString::fromStdString(openingHoursValue->GetValue());
+ }
- findIcons.push_back(MapIcon{QPoint(x,y), iconRect, coord, distanceSquare, iconStyle,
+ findIcons.push_back(MapIcon{QPoint(screenPos.GetX(),screenPos.GetY()),
+ iconRect, coord, distanceSquare, iconStyle,
databasePath, objectRef, poiId, QString::fromStdString(type->GetName()),
- name, altName, ref, operatorName, phone, website, QImage()});
+ name, altName, ref, operatorName, phone, website, openingHours, QImage()});
}
}
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/InputHandler.cpp
^
|
@@ -21,14 +21,13 @@
#include <QDebug>
#include <QPoint>
-#include <QVector>
#include <QTime>
#include <QElapsedTimer>
#include <osmscoutclientqt/InputHandler.h>
#include <osmscoutclientqt/OSMTile.h>
-#include <osmscout/util/Projection.h>
+#include <osmscout/projection/MercatorProjection.h>
#include <osmscout/system/Math.h>
@@ -144,10 +143,10 @@
MoveAccumulator& MoveAccumulator::operator+=(const QPointF p)
{
AccumulatorEvent ev = {p, QElapsedTimer()};
- ev.time.start();
+ ev.timer.start();
events.push_back(ev);
// flush old events
- while ((!events.isEmpty()) && events.first().time.elapsed() > memory){
+ while ((!events.isEmpty()) && events.first().timer.elapsed() > memory){
events.pop_front();
}
return *this;
@@ -158,7 +157,7 @@
QVector2D vector;
double distance = 0;
// flush old events
- while ((!events.isEmpty()) && events.first().time.elapsed() > memory){
+ while ((!events.isEmpty()) && events.first().timer.elapsed() > memory){
events.pop_front();
}
if (!events.isEmpty()){
@@ -760,11 +759,11 @@
return false;
}
- double x;
- double y;
- projection.GeoToPixel(currentPosition, x, y);
- double distanceFromCenter = sqrt(pow(std::abs(projection.GetWidth()/2 - x), 2) +
- pow(std::abs(projection.GetHeight()/2 - y), 2));
+ Vertex2D screenPos;
+ projection.GeoToPixel(currentPosition,
+ screenPos);
+ double distanceFromCenter = sqrt(pow(std::abs(projection.GetWidth()/2 - screenPos.GetX()), 2) +
+ pow(std::abs(projection.GetHeight()/2 - screenPos.GetY()), 2));
double moveTolerance = std::min(window.width(), window.height()) / 4;
if (distanceFromCenter > moveTolerance){
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LocationInfoModel.cpp
^
|
@@ -120,6 +120,7 @@
roles[AddressNumberRole] = "addressNumber";
roles[IndexedAdminRegionRole] = "indexedAdminRegion";
roles[AltLangName]="altLangName";
+ roles[OpeningHours]="openingHours";
return roles;
}
@@ -203,6 +204,7 @@
QString website;
QString phone;
QString altName;
+ QString openingHours;
if (place.GetObjectFeatures()){
for (const auto& featureInstance :place.GetObjectFeatures()->GetType()->GetFeatures()){
if (place.GetObjectFeatures()->HasFeature(featureInstance.GetIndex())){
@@ -223,6 +225,9 @@
} else if (const osmscout::NameAltFeatureValue *altNameValue = dynamic_cast<const osmscout::NameAltFeatureValue*>(value);
altNameValue != nullptr){
altName = QString::fromStdString(altNameValue->GetNameAlt());
+ } else if (const osmscout::OpeningHoursFeatureValue *openingHoursValue = dynamic_cast<const osmscout::OpeningHoursFeatureValue*>(value);
+ openingHoursValue != nullptr) {
+ openingHours = QString::fromStdString(openingHoursValue->GetValue());
}
}
}
@@ -249,6 +254,7 @@
obj[AddressNumberRole] = addressNumber;
obj[IndexedAdminRegionRole] = LookupModule::IndexedAdminRegionNames(regions, settings->GetShowAltLanguage());
obj[AltLangName] = altName;
+ obj[OpeningHours] = openingHours;
model << obj;
@@ -338,6 +344,7 @@
obj[AddressNumberRole] = "";
obj[IndexedAdminRegionRole] = QStringList();
obj[AltLangName] = bottom->qStringAltName();
+ obj[OpeningHours] = "";
model << obj;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LookupModule.cpp
^
|
@@ -224,15 +224,12 @@
std::map<osmscout::FileOffset,osmscout::AdminRegionRef> regionMap;
DBInstanceRef db;
- double x;
- double y;
- double x2;
- double y2;
-
//std::cout << "nodes: " << d.nodes.size() << std::endl;
for (auto const &n:mapData.nodes){
- projection.GeoToPixel(n->GetCoords(),x,y);
- if (filterRectangle.contains(x,y)){
+ osmscout::Vertex2D screenPos;
+ projection.GeoToPixel(n->GetCoords(),
+ screenPos);
+ if (filterRectangle.contains(screenPos.GetX(),screenPos.GetY())){
addObjectInfo(objectList, n, reverseLookupMap, db, regionMap);
}
}
@@ -241,9 +238,14 @@
for (auto const &w:mapData.ways){
// TODO: better detection
osmscout::GeoBox bbox=w->GetBoundingBox();
- projection.GeoToPixel(bbox.GetMinCoord(),x,y);
- projection.GeoToPixel(bbox.GetMaxCoord(),x2,y2);
- if (filterRectangle.intersects(QRectF(QPointF(x,y),QPointF(x2,y2)))){
+ osmscout::Vertex2D minScreenPos;
+ osmscout::Vertex2D maxScreenPos;
+ projection.GeoToPixel(bbox.GetMinCoord(),
+ minScreenPos);
+ projection.GeoToPixel(bbox.GetMaxCoord(),
+ maxScreenPos);
+ if (filterRectangle.intersects(QRectF(QPointF(minScreenPos.GetX(),minScreenPos.GetY()),
+ QPointF(maxScreenPos.GetX(),maxScreenPos.GetY())))){
addObjectInfo(objectList, w, reverseLookupMap, db, regionMap);
}
}
@@ -252,9 +254,14 @@
for (auto const &a:mapData.areas){
// TODO: better detection
osmscout::GeoBox bbox=a->GetBoundingBox();
- projection.GeoToPixel(bbox.GetMinCoord(),x,y);
- projection.GeoToPixel(bbox.GetMaxCoord(),x2,y2);
- if (filterRectangle.intersects(QRectF(QPointF(x,y),QPointF(x2,y2)))){
+ osmscout::Vertex2D minScreenPos;
+ osmscout::Vertex2D maxScreenPos;
+ projection.GeoToPixel(bbox.GetMinCoord(),
+ minScreenPos);
+ projection.GeoToPixel(bbox.GetMaxCoord(),
+ maxScreenPos);
+ if (filterRectangle.intersects(QRectF(QPointF(minScreenPos.GetX(),minScreenPos.GetY()),
+ QPointF(maxScreenPos.GetY(),maxScreenPos.GetY())))){
addObjectInfo(objectList, a, reverseLookupMap, db, regionMap);
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapRenderer.cpp
^
|
@@ -286,7 +286,7 @@
}
// prepare data for batch
- osmscout::MapPainterBatchQt batch(databases.size());
+ osmscout::BatchMapPainterQt batch(databases.size());
size_t i=0;
for (const auto &db: databases) {
bool first = (i == 0);
@@ -328,7 +328,7 @@
auto *painter = db->GetPainter();
if (painter != nullptr) {
- batch.addData(data, painter);
+ batch.AddData(data, painter);
} else {
osmscout::log.Warn() << "Painter is not available for database: " << db->path.toStdString();
success = false;
@@ -336,7 +336,7 @@
}
std::unique_ptr<MapPainterQt> painter;
- if (databases.empty()) {
+ if (databases.empty() && emptyStyleConfig) {
osmscout::MapDataRef data = std::make_shared<osmscout::MapData>();
if (renderBasemap) {
addBasemapData(data);
@@ -344,7 +344,7 @@
addOverlayObjectData(data, emptyStyleConfig->GetTypeConfig());
painter=std::make_unique<osmscout::MapPainterQt>(emptyStyleConfig);
MapPainterQt *p = painter.get();
- batch.addData(data, p);
+ batch.AddData(data, p);
}
// draw databases
@@ -363,8 +363,7 @@
if (!waterIndex) {
return false;
}
- osmscout::GeoBox boundingBox;
- renderProjection.GetDimensions(boundingBox);
+ osmscout::GeoBox boundingBox(renderProjection.GetDimensions());
return waterIndex->GetRegions(boundingBox,
renderProjection.GetMagnification(),
data->baseMapTiles);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapWidget.cpp
^
|
@@ -309,9 +309,9 @@
// render vehicle
if (vehicle.position && !vehicle.getIcon().isNull()){
QImage vehicleIcon=vehicle.getIcon();
- double x;
- double y;
- projection.GeoToPixel(vehicle.position->getCoord(), x, y);
+ osmscout::Vertex2D screenPos;
+ projection.GeoToPixel(vehicle.position->getCoord(),
+ screenPos);
Bearing iconAngle;
if (vehicle.position->getBearing()) {
@@ -321,26 +321,32 @@
}
painter->save();
- painter->translate(x,y);
+ painter->translate(screenPos.GetX(),
+ screenPos.GetY());
painter->rotate(iconAngle.AsDegrees());
// draw vehicleIcon center on coordinate 0x0
- painter->drawImage(QPointF(vehicleIcon.width()/-2, vehicleIcon.height()/-2), vehicleIcon);
+ painter->drawImage(QPointF(vehicleIcon.width()/-2,
+ vehicleIcon.height()/-2),
+ vehicleIcon);
painter->restore();
}
// render current position spot
if (showCurrentPosition && currentPosition.valid){
- double x;
- double y;
- projection.GeoToPixel(currentPosition.coord, x, y);
- if (boundingBox.contains(x, y)){
+ osmscout::Vertex2D screenPos;
+ projection.GeoToPixel(currentPosition.coord,
+ screenPos);
+ if (boundingBox.contains(screenPos.GetX(), screenPos.GetY())){
if (currentPosition.horizontalAccuracyValid){
double diameter = currentPosition.horizontalAccuracy * projection.GetMeterInPixel();
if (diameter > 25.0 && diameter < std::max(request.width, request.height)){
painter->setBrush(QBrush(QColor::fromRgbF(1.0, 1.0, 1.0, 0.4)));
painter->setPen(QColor::fromRgbF(1.0, 1.0, 1.0, 0.7));
- painter->drawEllipse(x - (diameter /2.0), y - (diameter /2.0), diameter, diameter);
+ painter->drawEllipse(screenPos.GetX() - (diameter /2.0),
+ screenPos.GetY() - (diameter /2.0),
+ diameter,
+ diameter);
}
}
@@ -353,14 +359,15 @@
}
painter->setPen(QColor::fromRgbF(0.0, 0.5, 0.0, 0.9));
double dimension = projection.ConvertWidthToPixel(2.8);
- painter->drawEllipse(x - dimension/2, y - dimension/2, dimension, dimension);
+ painter->drawEllipse(screenPos.GetX() - dimension/2,
+ screenPos.GetY() - dimension/2,
+ dimension,
+ dimension);
}
}
// render marks
if (!marks.isEmpty()){
- double x;
- double y;
painter->setBrush(QBrush());
QPen pen;
pen.setColor(QColor::fromRgbF(0.8, 0.0, 0.0, 0.9));
@@ -368,10 +375,14 @@
painter->setPen(pen);
for (auto &entry: marks){
- projection.GeoToPixel(osmscout::GeoCoord(entry.GetLat(), entry.GetLon()), x, y);
- if (boundingBox.contains(x, y)){
+ osmscout::Vertex2D screenPos;
+ projection.GeoToPixel(osmscout::GeoCoord(entry.GetLat(), entry.GetLon()),
+ screenPos);
+ if (boundingBox.contains(screenPos.GetX(), screenPos.GetY())){
double dimension = projection.ConvertWidthToPixel(6);
- painter->drawEllipse(x - dimension/2, y - dimension/2, dimension, dimension);
+ painter->drawEllipse(screenPos.GetX() - dimension/2,
+ screenPos.GetY() - dimension/2,
+ dimension, dimension);
}
}
}
@@ -410,10 +421,10 @@
QPointF MapWidget::screenPosition(double lat, double lon)
{
- double x;
- double y;
- getProjection().GeoToPixel(osmscout::GeoCoord(lat, lon), x, y);
- return QPointF(x, y);
+ osmscout::Vertex2D screenPos;
+ getProjection().GeoToPixel(osmscout::GeoCoord(lat, lon),
+ screenPos);
+ return QPointF(screenPos.GetX(), screenPos.GetY());
}
void MapWidget::zoom(double zoomFactor)
@@ -766,7 +777,8 @@
emit iconTapped(icon.screenCoord, icon.coord.GetLat(), icon.coord.GetLon(), icon.databasePath,
QString(icon.objectRef.GetTypeName()), icon.objectRef.GetFileOffset(), icon.poiId,
- icon.type, icon.name, icon.altName, icon.ref, icon.operatorName, icon.phone, icon.website);
+ icon.type, icon.name, icon.altName, icon.ref, icon.operatorName, icon.phone, icon.website,
+ icon.openingHours);
}
void MapWidget::onDoubleTap(const QPoint p)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OSMScoutQt.cpp
^
|
@@ -51,6 +51,7 @@
#include <osmscoutclientqt/InstalledVoicesModel.h>
#include <osmscoutclientqt/QmlRoutingProfile.h>
#include <osmscoutclientqt/SunriseSunset.h>
+#include <osmscoutclientqt/OpeningHoursModel.h>
#include <optional>
@@ -196,6 +197,7 @@
qmlRegisterType<AvailableVoicesModel>(uri, versionMajor, versionMinor, "AvailableVoicesModel");
qmlRegisterType<InstalledVoicesModel>(uri, versionMajor, versionMinor, "InstalledVoicesModel");
qmlRegisterType<SunriseSunset>(uri, versionMajor, versionMinor, "SunriseSunset");
+ qmlRegisterType<OpeningHoursModel>(uri, versionMajor, versionMinor, "OpeningHoursModel");
}
OSMScoutQtBuilder OSMScoutQt::NewInstance()
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OpeningHoursModel.cpp
^
|
@@ -0,0 +1,159 @@
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclientqt/OpeningHoursModel.h>
+
+#include <QLocale>
+#include <QTextStream>
+
+namespace osmscout {
+
+QStringList OpeningHoursModel::intervalStrings(const std::vector<OpeningHours::TimeInterval> &intervals) const
+{
+ QStringList result;
+ if (intervals.empty()) {
+ //: example: restaurant is "closed" at Monday
+ result << OpeningHoursModel::tr("closed");
+ }
+ auto timeString=[](const OpeningHours::DayTime &time) -> QString {
+ return QString("%1:%2").arg(int(time.hour)).arg(int(time.minute), 2, 10, QLatin1Char('0'));
+ };
+
+ for (auto const interval: intervals) {
+ result << timeString(interval.from) + " - " + timeString(interval.to);
+ }
+ return result;
+}
+
+QString OpeningHoursModel::dayName(OpeningHours::WeekDay weekDay) const
+{
+ if (weekDay==OpeningHours::WeekDay::PublicHoliday) {
+ //: long variant
+ return OpeningHoursModel::tr("Public holiday");
+ }
+ if (weekDay==OpeningHours::WeekDay::SchoolHoliday) {
+ //: long variant
+ return OpeningHoursModel::tr("School holiday");
+ }
+ return locale.standaloneDayName(int(weekDay)+1, QLocale::FormatType::LongFormat);
+ // return calendar.standaloneWeekDayName(locale, int(weekDay)+1, QLocale::FormatType::LongFormat);
+}
+
+QString OpeningHoursModel::shortDayName(OpeningHours::WeekDay weekDay) const
+{
+ if (weekDay==OpeningHours::WeekDay::PublicHoliday) {
+ //: short variant of "Public holiday"
+ return OpeningHoursModel::tr("PH");
+ }
+ if (weekDay==OpeningHours::WeekDay::SchoolHoliday) {
+ //: short variant of "School holiday"
+ return OpeningHoursModel::tr("SH");
+ }
+ // return calendar.standaloneWeekDayName(locale, int(weekDay)+1, QLocale::FormatType::ShortFormat);
+ return locale.standaloneDayName(int(weekDay)+1, QLocale::FormatType::ShortFormat);
+}
+
+
+QStringList OpeningHoursModel::getToday() const
+{
+ int dayOfTheWeek=QDate::currentDate().dayOfWeek()-1;
+ if (dayOfTheWeek<0 // invalid weekday (bad locale?)
+ || dayOfTheWeek>int(OpeningHours::WeekDay::Sunday) // day not in range Mo-Su, current calendar is special?
+ || model.empty() // not initialized or failed to parse provided opening hours
+ ) {
+ return QStringList();
+ }
+ for (auto const &rule:model) {
+ if (dayOfTheWeek==int(rule.day)) {
+ return intervalStrings(rule.intervals);
+ }
+ }
+ // we have no rule for today, so it is closed
+ return intervalStrings(std::vector<OpeningHours::TimeInterval>());
+}
+
+void OpeningHoursModel::setOpeningHours(const QString &openingHours)
+{
+ rawOpeningHours = openingHours;
+ beginResetModel();
+ model.clear();
+ auto result=OpeningHours::Parse(openingHours.toStdString(), true);
+ if (result) {
+ bool sundayFirst=locale.firstDayOfWeek()==Qt::Sunday;
+ auto dayNum=[sundayFirst](const OpeningHours::WeekDay day) -> int {
+ if (sundayFirst && day==OpeningHours::WeekDay::Sunday) {
+ return -1;
+ }
+ return int(day);
+ };
+ model=result->GetRules();
+ std::sort(model.begin(), model.end(), [&](const OpeningHours::Rule &a, const OpeningHours::Rule &b) -> bool {
+ return dayNum(a.day) < dayNum(b.day);
+ });
+ } else {
+ emit parseError();
+ }
+ endResetModel();
+ emit updated();
+}
+
+QVariant OpeningHoursModel::data(const QModelIndex &index, int role) const
+{
+ if(index.row() < 0 || index.row() >= int(model.size())) {
+ return QVariant();
+ }
+ int dayOfTheWeek;
+ auto const &rule = model[index.row()];
+ switch (role) {
+ case DayRole:
+ return dayName(rule.day);
+ case ShortDayRole:
+ return shortDayName(rule.day);
+ case TimeIntervalsRole:
+ return intervalStrings(rule.intervals);
+ case IsTodayRole:
+ dayOfTheWeek=QDate::currentDate().dayOfWeek()-1;
+ return dayOfTheWeek>=0 && dayOfTheWeek<=int(OpeningHours::WeekDay::Sunday) && dayOfTheWeek==int(rule.day);
+ default:
+ return QVariant();
+ }
+}
+
+QHash<int, QByteArray> OpeningHoursModel::roleNames() const
+{
+ QHash<int, QByteArray> roles=QAbstractListModel::roleNames();
+
+ roles[DayRole]="day";
+ roles[ShortDayRole]="shortDay";
+ roles[TimeIntervalsRole]="timeIntervals";
+ roles[IsTodayRole]="isToday";
+
+ return roles;
+}
+
+Qt::ItemFlags OpeningHoursModel::flags(const QModelIndex &index) const
+{
+ if(!index.isValid()) {
+ return Qt::ItemIsEnabled;
+ }
+
+ return QAbstractListModel::flags(index) | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+}
+
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/PlaneMapRenderer.cpp
^
|
@@ -164,17 +164,17 @@
finalImgProjection.GetWidth(),
finalImgProjection.GetHeight());
- double targetCenterX;
- double targetCenterY;
+ osmscout::Vertex2D targetCenter;
osmscout::GeoCoord srcImageCenterCoord;
finalImgProjection.PixelToGeo(finalImgProjection.GetWidth()/2,
finalImgProjection.GetHeight()/2,
srcImageCenterCoord);
- requestProjection.GeoToPixel(srcImageCenterCoord,targetCenterX,targetCenterY);
- double targetTopLeftX=targetCenterX - finalImgProjection.GetWidth()*scale*0.5;
- double targetTopLeftY=targetCenterY - finalImgProjection.GetHeight()*scale*0.5;
+ requestProjection.GeoToPixel(srcImageCenterCoord,
+ targetCenter);
+ double targetTopLeftX=targetCenter.GetX() - finalImgProjection.GetWidth()*scale*0.5;
+ double targetTopLeftY=targetCenter.GetY() - finalImgProjection.GetHeight()*scale*0.5;
QRectF targetRectangle(targetTopLeftX,
targetTopLeftY,
@@ -281,14 +281,14 @@
currentProjection.PixelToGeo(currentProjection.GetWidth(),currentProjection.GetHeight(),
bottomRight);
- double x1;
- double y1;
- previousProjection.GeoToPixel(topLeft,x1,y1);
- double x2;
- double y2;
- previousProjection.GeoToPixel(bottomRight,x2,y2);
+ osmscout::Vertex2D pos1;
+ osmscout::Vertex2D pos2;
+ previousProjection.GeoToPixel(topLeft,
+ pos1);
+ previousProjection.GeoToPixel(bottomRight,
+ pos2);
- double previousDiagonal=sqrt(pow(x2-x1,2) + pow(y2-y1,2));
+ double previousDiagonal=sqrt(pow(pos2.GetX()-pos1.GetX(),2) + pow(pos2.GetY()-pos1.GetY(),2));
return currentDiagonal / previousDiagonal;
}
@@ -379,8 +379,7 @@
// overlay objects
std::vector<OverlayObjectRef> overlayObjects;
- osmscout::GeoBox renderBox;
- projection.GetDimensions(renderBox);
+ osmscout::GeoBox renderBox(projection.GetDimensions());
getOverlayObjects(overlayObjects, renderBox);
bool success;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/RouteDescriptionBuilder.cpp
^
|
@@ -40,10 +40,6 @@
{
}
-RouteDescriptionBuilder::RouteDescriptionBuilder::Callback::~Callback()
-{
-}
-
static QString TurnCommandType(const RouteDescription::DirectionDescriptionRef& directionDescription)
{
if (!directionDescription) {
@@ -613,7 +609,7 @@
{
distance=node.GetDistance();
coord=node.GetLocation();
- time=node.GetTime();
+ timestamp=node.GetTime();
}
RouteStep RouteDescriptionBuilder::Callback::MkStep(const QString &name)
@@ -622,13 +618,13 @@
coord,
distance,
distance-distancePrevious,
- time,
- time-timePrevious,
+ timestamp,
+ timestamp-timestampPrevious,
streetNames);
streetNames.clear();
distancePrevious = distance;
- timePrevious = time;
+ timestampPrevious = timestamp;
return step;
}
@@ -639,12 +635,6 @@
routeSteps.constLast().distance <= stopAfter;
}
-RouteDescriptionBuilder::RouteDescriptionBuilder()
-{}
-
-RouteDescriptionBuilder::~RouteDescriptionBuilder()
-{}
-
void RouteDescriptionBuilder::GenerateRouteSteps(const RouteDescription &routeDescription,
QList<RouteStep> &routeSteps) const
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/RouteStep.cpp
^
|
@@ -30,16 +30,16 @@
const GeoCoord &coord,
const Distance &distance,
const Distance &distanceDelta,
- const Duration &time,
- const Duration &timeDelta,
+ const Duration ×tamp,
+ const Duration ×tampDelta,
const QStringList &streetNames):
type(type),
coord(coord),
distance(distance),
distanceDelta(distanceDelta),
distanceTo(Distance::Zero()),
- time(time),
- timeDelta(timeDelta),
+ timestamp(timestamp),
+ timestampDelta(timestampDelta),
streetNames(streetNames)
{
@@ -52,8 +52,8 @@
distance(other.distance),
distanceDelta(other.distanceDelta),
distanceTo(other.distanceTo),
- time(other.time),
- timeDelta(other.timeDelta),
+ timestamp(other.timestamp),
+ timestampDelta(other.timestampDelta),
description(other.description),
shortDescription(other.shortDescription),
streetNames(other.streetNames),
@@ -138,8 +138,8 @@
distance=other.distance;
distanceDelta=other.distanceDelta;
distanceTo=other.distanceTo;
- time=other.time;
- timeDelta=other.timeDelta;
+ timestamp=other.timestamp;
+ timestampDelta=other.timestampDelta;
description=other.description;
shortDescription=other.shortDescription;
streetNames=other.streetNames;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/TiledMapRenderer.cpp
^
|
@@ -464,8 +464,7 @@
// overlay ways
std::vector<OverlayObjectRef> overlayObjects;
- osmscout::GeoBox renderBox;
- projection.GetDimensions(renderBox);
+ osmscout::GeoBox renderBox(projection.GetDimensions());
getOverlayObjects(overlayObjects, renderBox);
//DrawMap(p, tileVisualCenter, loadZ, canvas.width(), canvas.height());
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/TiledRenderingHelper.cpp
^
|
@@ -69,9 +69,7 @@
width,
height);
- osmscout::GeoBox boundingBox;
-
- projection.GetDimensions(boundingBox);
+ osmscout::GeoBox boundingBox(projection.GetDimensions());
QColor grey2 = QColor::fromRgbF(0.8,0.8,0.8);
@@ -90,15 +88,15 @@
}
uint32_t osmTileRes = OSMTile::worldRes(projection.GetMagnification().GetLevel());
- double x1;
- double y1;
- projection.GeoToPixel(osmscout::GeoCoord(osmMaxLat, osmMinLon), x1, y1);
- double x2;
- double y2;
- projection.GeoToPixel(osmscout::GeoCoord(osmMinLat, osmMaxLon), x2, y2);
+ Vertex2D pos1;
+ Vertex2D pos2;
+ projection.GeoToPixel(osmscout::GeoCoord(osmMaxLat, osmMinLon),
+ pos1);
+ projection.GeoToPixel(osmscout::GeoCoord(osmMinLat, osmMaxLon),
+ pos2);
- double renderTileWidth = (x2 - x1) / osmTileRes; // pixels
- double renderTileHeight = (y2 - y1) / osmTileRes; // pixels
+ double renderTileWidth = (pos2.GetX() - pos1.GetX()) / osmTileRes; // pixels
+ double renderTileHeight = (pos2.GetY() - pos1.GetY()) / osmTileRes; // pixels
uint32_t osmTileFromX = std::max(0.0, (double)osmTileRes * ((boundingBox.GetMinLon() + (double)180.0) / (double)360.0));
double maxLatRad = boundingBox.GetMaxLat() * GRAD_TO_RAD;
@@ -113,8 +111,6 @@
}
// render available tiles
- double x;
- double y;
painter.save();
if (request.angle!=Bearing()) {
@@ -143,22 +139,27 @@
uint32_t xtile = (osmTileFromX + tx);
double xtileDeg = (double)xtile / (double)osmTileRes * 360.0 - 180.0;
+ osmscout::Vertex2D pos;
- projection.GeoToPixel(osmscout::GeoCoord(ytileLatDeg, xtileDeg), x, y);
+ projection.GeoToPixel(osmscout::GeoCoord(ytileLatDeg, xtileDeg),
+ pos);
bool lookupTileFound = false;
for (TileCache *cache:layerCaches){
lookupTileFound |= lookupAndDrawTile(*cache, painter,
- x, y, renderTileWidth, renderTileHeight,
- zoomLevel, xtile, ytile, /* up limit */ 6, /* down limit */ 3,
+ pos.GetX(), pos.GetY(),
+ renderTileWidth, renderTileHeight,
+ zoomLevel,
+ xtile, ytile,
+ /* up limit */ 6, /* down limit */ 3,
overlap
);
}
if (!lookupTileFound){
// no tile found, draw its outline
- painter.drawLine(x,y, x + renderTileWidth, y);
- painter.drawLine(x,y, x, y + renderTileHeight);
+ painter.drawLine(pos.GetX(),pos.GetY(), pos.GetX() + renderTileWidth, pos.GetY());
+ painter.drawLine(pos.GetX(),pos.GetY(), pos.GetX(), pos.GetY() + renderTileHeight);
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-gpx/include/meson.build
^
|
@@ -19,4 +19,10 @@
]
endif
-install_headers(osmscoutgpxHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutgpxHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutgpxHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-gpx/include/osmscoutgpx/GpxFile.h
^
|
@@ -37,7 +37,7 @@
public:
std::optional<std::string> name;
std::optional<std::string> desc;
- std::optional<Timestamp> time;
+ std::optional<Timestamp> timestamp;
std::vector<Track> tracks;
std::vector<Route> routes;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-gpx/include/osmscoutgpx/TrackPoint.h
^
|
@@ -40,7 +40,7 @@
osmscout::GeoCoord coord;
std::optional<double> elevation; // meters above sea
- std::optional<Timestamp> time;
+ std::optional<Timestamp> timestamp;
std::optional<double> course; // alias magvar - degrees, 0.0 <= value < 360.0
/**
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-gpx/include/osmscoutgpx/Waypoint.h
^
|
@@ -44,7 +44,7 @@
osmscout::GeoCoord coord;
std::optional<double> elevation; // meters above sea
- std::optional<Timestamp> time;
+ std::optional<Timestamp> timestamp;
std::optional<double> course; // alias magvar - degrees, 0.0 <= value < 360.0
std::optional<double> hdop; // meters
std::optional<double> vdop; // meters
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-gpx/meson.build
^
|
@@ -19,6 +19,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, xml2Dep, iconvDep, zlibDep],
link_with: [osmscout],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-gpx/src/osmscoutgpx/Export.cpp
^
|
@@ -266,8 +266,8 @@
return false;
}
}
- if (waypoint.time){
- if (!WriteTextElement("time", *waypoint.time)){
+ if (waypoint.timestamp){
+ if (!WriteTextElement("time", *waypoint.timestamp)){
return false;
}
}
@@ -324,8 +324,8 @@
return false;
}
}
- if (point.time){
- if (!WriteTextElement("time", *point.time)){
+ if (point.timestamp){
+ if (!WriteTextElement("time", *point.timestamp)){
return false;
}
}
@@ -473,7 +473,7 @@
bool GpxWritter::WriteMetadata(const GpxFile file)
{
- if (!file.name && !file.desc && !file.time){
+ if (!file.name && !file.desc && !file.timestamp){
return true;
}
@@ -491,8 +491,8 @@
return false;
}
}
- if (file.time){
- if (!WriteTextElement("time", *file.time)){
+ if (file.timestamp){
+ if (!WriteTextElement("time", *file.timestamp)){
return false;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-gpx/src/osmscoutgpx/Import.cpp
^
|
@@ -175,9 +175,9 @@
FileOffset position=0;
while ((res=std::fread(chars,1,sizeof(chars),file))>0) {
- if (xmlParseChunk(ctxt,chars,
+ if (::xmlParseChunk(ctxt,chars,
static_cast<int>(res),0)!=0) {
- xmlParserError(ctxt,"xmlParseChunk");
+ ::xmlParserError(ctxt,"xmlParseChunk");
return false;
}
if (errorCnt>0){
@@ -195,8 +195,8 @@
}
}
- if (xmlParseChunk(ctxt,chars,0,1)!=0) {
- xmlParserError(ctxt,"xmlParseChunk");
+ if (::xmlParseChunk(ctxt,chars,0,1)!=0) {
+ ::xmlParserError(ctxt,"xmlParseChunk");
return false;
}
@@ -247,7 +247,7 @@
void Error(const std::string& msg)
{
- errorCnt++;
+ ++errorCnt;
if (callback){
callback->Error(msg);
}
@@ -370,7 +370,7 @@
const std::string &name,
[[maybe_unused]] const std::map<AttrKey, std::string> &atts)
{
- xmlParserWarning(ctxt,"Unexpected element %s start on context %s\n", name.c_str(), ContextName());
+ ::xmlParserWarning(ctxt,"Unexpected element %s start on context %s\n", name.c_str(), ContextName());
parser.Warning("Unexpected element");
return nullptr;
}
@@ -426,7 +426,7 @@
if (StringToNumber(value, ele)){
point.elevation=std::make_optional<double>(ele);
}else{
- xmlParserWarning(ctxt,"Can't parse Ele value\n");
+ ::xmlParserWarning(ctxt,"Can't parse Ele value\n");
parser.Warning("Can't parse Ele value");
}
});
@@ -438,7 +438,7 @@
if (StringToNumber(value, course)){
point.course=std::make_optional<double>(course);
}else{
- xmlParserWarning(ctxt,"Can't parse Magvar value\n");
+ ::xmlParserWarning(ctxt,"Can't parse Magvar value\n");
parser.Warning("Can't parse Magvar value");
}
});
@@ -450,7 +450,7 @@
if (StringToNumber(value, hdop)){
point.hdop=std::make_optional<double>(hdop);
}else{
- xmlParserWarning(ctxt,"Can't parse HDop value\n");
+ ::xmlParserWarning(ctxt,"Can't parse HDop value\n");
parser.Warning("Can't parse HDop value");
}
});
@@ -462,7 +462,7 @@
if (StringToNumber(value, vdop)){
point.vdop=std::make_optional<double>(vdop);
}else{
- xmlParserWarning(ctxt,"Can't parse VDop value\n");
+ ::xmlParserWarning(ctxt,"Can't parse VDop value\n");
parser.Warning("Can't parse VDop value");
}
});
@@ -474,7 +474,7 @@
if (StringToNumber(value, pdop)){
point.pdop=std::make_optional<double>(pdop);
}else{
- xmlParserWarning(ctxt,"Can't parse PDop value\n");
+ ::xmlParserWarning(ctxt,"Can't parse PDop value\n");
parser.Warning("Can't parse PDop value");
}
});
@@ -482,11 +482,11 @@
if (ns == NameSpace::Gpx && name == "time") {
return new SimpleValueContext("TimeContext", ctxt, parser, [&](const std::string &value){
- Timestamp time;
- if (ParseISO8601TimeString(value, time)){
- point.time=std::make_optional<Timestamp>(time);
+ Timestamp timestamp;
+ if (ParseISO8601TimeString(value,timestamp)){
+ point.timestamp=std::make_optional<Timestamp>(timestamp);
}else{
- xmlParserWarning(ctxt,"Can't parse Time value\n");
+ ::xmlParserWarning(ctxt,"Can't parse Time value\n");
parser.Warning("Can't parse Time value");
}
});
@@ -578,7 +578,7 @@
if (StringToNumber(value, ele)){
waypoint.elevation=std::make_optional<double>(ele);
}else{
- xmlParserWarning(ctxt,"Can't parse Ele value\n");
+ ::xmlParserWarning(ctxt,"Can't parse Ele value\n");
parser.Warning("Can't parse Ele value");
}
});
@@ -590,7 +590,7 @@
if (StringToNumber(value, hdop)){
waypoint.hdop=std::make_optional<double>(hdop);
}else{
- xmlParserWarning(ctxt,"Can't parse HDop value\n");
+ ::xmlParserWarning(ctxt,"Can't parse HDop value\n");
parser.Warning("Can't parse HDop value");
}
});
@@ -602,7 +602,7 @@
if (StringToNumber(value, vdop)){
waypoint.vdop=std::make_optional<double>(vdop);
}else{
- xmlParserWarning(ctxt,"Can't parse Ele value\n");
+ ::xmlParserWarning(ctxt,"Can't parse Ele value\n");
parser.Warning("Can't parse Ele value");
}
});
@@ -614,7 +614,7 @@
if (StringToNumber(value, pdop)){
waypoint.pdop=std::make_optional<double>(pdop);
}else{
- xmlParserWarning(ctxt,"Can't parse PDop value\n");
+ ::xmlParserWarning(ctxt,"Can't parse PDop value\n");
parser.Warning("Can't parse PDop value");
}
});
@@ -624,9 +624,9 @@
return new SimpleValueContext("TimeContext", ctxt, parser, [&](const std::string &value){
Timestamp time;
if (ParseISO8601TimeString(value, time)){
- waypoint.time=std::make_optional<Timestamp>(time);
+ waypoint.timestamp=std::make_optional<Timestamp>(time);
}else{
- xmlParserWarning(ctxt,"Can't parse Time value\n");
+ ::xmlParserWarning(ctxt,"Can't parse Time value\n");
parser.Warning("Can't parse Time value");
}
});
@@ -672,9 +672,9 @@
return new SimpleValueContext("TimeContext", ctxt, parser, [&](const std::string &value){
Timestamp time;
if (ParseISO8601TimeString(value, time)){
- output.time=std::make_optional<Timestamp>(time);
+ output.timestamp=std::make_optional<Timestamp>(time);
}else{
- xmlParserWarning(ctxt,"Can't parse Time value\n");
+ ::xmlParserWarning(ctxt,"Can't parse Time value\n");
parser.Warning("Can't parse Time value");
}
});
@@ -715,7 +715,7 @@
return new TrkptContext(ctxt, segment, parser, lat, lon);
}
- xmlParserError(ctxt,"Can't parse trkpt lan/lon\n");
+ ::xmlParserError(ctxt,"Can't parse trkpt lan/lon\n");
parser.Error("Can't parse trkpt lan/lon");
return nullptr;
}
@@ -755,7 +755,7 @@
return new RteptContext(ctxt, route, parser, lat, lon);
}
- xmlParserError(ctxt, "Can't parse trkpt lan/lon\n");
+ ::xmlParserError(ctxt, "Can't parse trkpt lan/lon\n");
parser.Error("Can't parse trkpt lan/lon");
return nullptr;
}
@@ -777,9 +777,7 @@
TrkExtensionContext(xmlParserCtxtPtr ctxt, Track &track, GpxParser &parser) :
GpxParserContext(ctxt, parser), track(track) {}
- ~TrkExtensionContext() override
- {
- }
+ ~TrkExtensionContext() override = default;
const char *ContextName() const override
{
@@ -889,7 +887,7 @@
return new WaypointContext(ctxt, output, parser, lat, lon);
}
- xmlParserError(ctxt,"Can't parse wpt lan/lon\n");
+ ::xmlParserError(ctxt,"Can't parse wpt lan/lon\n");
parser.Error("Can't parse wpt lan/lon");
return nullptr;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-import/include/meson.build
^
|
@@ -63,4 +63,10 @@
osmscoutimportHeader += ['osmscoutimport/GenTextIndex.h']
endif
-install_headers(osmscoutimportHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutimportHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutimportHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/WaterIndexProcessor.h
^
|
@@ -32,10 +32,11 @@
#include <osmscout/GroundTile.h>
+#include <osmscout/projection/Projection.h>
+
#include <osmscout/util/FileWriter.h>
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Progress.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/util/Transformation.h>
#include <osmscout/system/Compiler.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-import/meson.build
^
|
@@ -26,6 +26,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, tbbDep, openmpDep, wsock32Dep, xml2Dep, marisaDep, protobufDep, zlibDep],
link_with: [osmscout],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenOptimizeAreasLowZoom.cpp
^
|
@@ -28,11 +28,12 @@
#include <osmscout/system/Assert.h>
#include <osmscout/system/Math.h>
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscout/util/File.h>
#include <osmscout/util/GeoBox.h>
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Number.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/util/TileId.h>
#include <osmscout/util/Transformation.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenOptimizeWaysLowZoom.cpp
^
|
@@ -31,11 +31,12 @@
#include <osmscout/system/Assert.h>
#include <osmscout/system/Math.h>
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscout/util/File.h>
#include <osmscout/util/Geometry.h>
#include <osmscout/util/GeoBox.h>
#include <osmscout/util/Number.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/util/TileId.h>
#include <osmscout/util/Transformation.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenWaterIndex.cpp
^
|
@@ -29,7 +29,7 @@
#include <osmscout/WaterIndex.h>
#include <osmscout/WayDataFile.h>
-#include <osmscout/system/Math.h>
+#include <osmscout/projection/MercatorProjection.h>
#include <osmscout/util/File.h>
#include <osmscout/util/FileScanner.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-agg/include/meson.build
^
|
@@ -5,4 +5,10 @@
'osmscoutmapagg/MapPainterAgg.h'
]
-install_headers(osmscoutmapaggHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapaggHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapaggHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-agg/include/osmscoutmapagg/MapPainterAgg.h
^
|
@@ -128,13 +128,13 @@
const FillStyle& style) override;
void DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawPath(const Projection& projection,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-agg/meson.build
^
|
@@ -2,7 +2,7 @@
if get_option('default_library')=='shared'
cppArgs += ['-DOSMScoutMapAGG_EXPORTS']
-
+
if haveVisibility
cppArgs += ['-fvisibility=hidden']
endif
@@ -19,7 +19,7 @@
mapaggDep += aggftpicDep
else
mapaggDep += aggftDep
-endif
+endif
mapaggDep += ftDep
@@ -29,6 +29,7 @@
cpp_args: cppArgs,
dependencies: mapaggDep,
link_with: [osmscoutmap, osmscout],
+ version: libraryVersion,
install: true)
-
-# TODO: Generate PKG_CONFIG file
+
+# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-agg/src/osmscoutmapagg/MapPainterAgg.cpp
^
|
@@ -353,7 +353,7 @@
for (const auto &nativeGlyph : label.glyphs) {
MapPainterAgg::AggGlyph glyph{};
glyph.glyph=nativeGlyph;
- glyph.position.Set(nativeGlyph.x, nativeGlyph.y);
+ glyph.position=Vertex2D(nativeGlyph.x, nativeGlyph.y);
result.emplace_back(glyph);
}
return result;
@@ -422,7 +422,10 @@
const PathLabelData &label,
const LabelPath &labelPath)
{
- labelLayouter.RegisterContourLabel(projection, parameter, label, labelPath);
+ labelLayouter.RegisterContourLabel(projection,
+ parameter,
+ label,
+ labelPath);
}
void MapPainterAgg::DrawLabels(const Projection& projection,
@@ -456,7 +459,7 @@
}
void MapPainterAgg::DrawIcon(const IconStyle* /*style*/,
- double /*centerX*/, double /*centerY*/,
+ const Vertex2D& /*centerPos*/,
double /*width*/, double /*height*/)
{
// Not implemented
@@ -465,7 +468,7 @@
void MapPainterAgg::DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double /*scaleFactor*/)
{
ScreenBox boundingBox=symbol.GetBoundingBox(projection);
@@ -485,12 +488,12 @@
pixel!=polygon->GetCoords().end();
++pixel) {
if (pixel==polygon->GetCoords().begin()) {
- path.move_to(x+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
- y+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
+ path.move_to(screenPos.GetX()+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
+ screenPos.GetY()+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
}
else {
- path.line_to(x+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
- y+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
+ path.line_to(screenPos.GetX()+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
+ screenPos.GetY()+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
}
}
@@ -510,8 +513,8 @@
FillStyleRef fillStyle=rectangle->GetFillStyle();
BorderStyleRef borderStyle=rectangle->GetBorderStyle();
agg::path_storage path;
- double xPos=x+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX())-center.GetX();
- double yPos=y+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY())-center.GetY();
+ double xPos=screenPos.GetX()+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX())-center.GetX();
+ double yPos=screenPos.GetY()+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY())-center.GetY();
double width=projection.ConvertWidthToPixel(rectangle->GetWidth());
double height=projection.ConvertWidthToPixel(rectangle->GetHeight());
@@ -538,8 +541,8 @@
agg::path_storage path;
double radius=projection.ConvertWidthToPixel(circle->GetRadius());
- agg::ellipse ellipse(x+projection.ConvertWidthToPixel(circle->GetCenter().GetX())-center.GetX(),
- y+projection.ConvertWidthToPixel(circle->GetCenter().GetY())-center.GetY(),
+ agg::ellipse ellipse(screenPos.GetX()+projection.ConvertWidthToPixel(circle->GetCenter().GetX())-center.GetX(),
+ screenPos.GetY()+projection.ConvertWidthToPixel(circle->GetCenter().GetY())-center.GetY(),
radius,
radius);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-cairo/include/meson.build
^
|
@@ -10,4 +10,10 @@
osmscoutmapcairoHeader += ['osmscoutmapcairo/LoaderPNG.h']
endif
-install_headers(osmscoutmapcairoHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapcairoHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapcairoHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-cairo/include/osmscoutmapcairo/MapPainterCairo.h
^
|
@@ -174,11 +174,11 @@
void DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawPath(const Projection& projection,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-cairo/meson.build
^
|
@@ -20,6 +20,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, cairoDep, pangoDep, pangocairoDep, pngDep, gobjectDep],
link_with: [osmscoutmap, osmscout],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-cairo/src/osmscoutmapcairo/MapPainterCairo.cpp
^
|
@@ -714,8 +714,8 @@
result.back().glyph.font = font;
- result.back().position.SetX(((double)glyphInfo.geometry.x_offset/(double)PANGO_SCALE) + horizontalOffset);
- result.back().position.SetY((double)glyphInfo.geometry.y_offset/(double)PANGO_SCALE);
+ result.back().position=Vertex2D(((double)glyphInfo.geometry.x_offset/(double)PANGO_SCALE) + horizontalOffset,
+ (double)glyphInfo.geometry.y_offset/(double)PANGO_SCALE);
if constexpr (debugLabelLayouter) {
std::cout << " " << glyphInfo.glyph << ": " << result.back().position.GetX() << " x "
@@ -875,8 +875,7 @@
result.back().glyph.width = textExtents.width;
result.back().glyph.height = label.fontExtents.height;
- result.back().position.SetX(horizontalOffset);
- result.back().position.SetY(0);
+ result.back().position=Vertex2D(horizontalOffset,0);
horizontalOffset += result.back().glyph.width;
}
@@ -1120,19 +1119,19 @@
void MapPainterCairo::DrawSymbol(const Projection& projection,
const MapParameter& /*parameter*/,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor)
{
SymbolRendererCairo renderer(draw);
renderer.Render(projection,
symbol,
- Vertex2D(x, y),
+ screenPos,
scaleFactor);
}
void MapPainterCairo::DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height)
{
size_t idx=style->GetIconId()-1;
@@ -1152,8 +1151,8 @@
cairo_set_source_surface(draw,
icon,
- (centerX-width/2) / scaleW,
- (centerY-height/2) / scaleH);
+ (centerPos.GetX()-width/2) / scaleW,
+ (centerPos.GetY()-height/2) / scaleH);
cairo_paint(draw);
cairo_set_matrix(draw, &matrix);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-directx/include/meson.build
^
|
@@ -6,4 +6,10 @@
'osmscoutmapdirectx/PathTextRenderer.h'
]
-install_headers(osmscoutmapdirectxHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapdirectxHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapdirectxHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-directx/include/osmscoutmapdirectx/MapPainterDirectX.h
^
|
@@ -184,13 +184,13 @@
const MapData &data) override;
void DrawIcon(const IconStyle *style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawSymbol(const Projection &projection,
const MapParameter ¶meter,
const Symbol &symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawPath(const Projection &projection,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-directx/meson.build
^
|
@@ -19,6 +19,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, d2d1Dep, dwriteDep, winCodecsDep],
link_with: [osmscoutmap, osmscout],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-directx/src/osmscoutmapdirectx/MapPainterDirectX.cpp
^
|
@@ -177,8 +177,7 @@
result.back().glyph.height = label.m_TextMetrics.height;
}
- result.back().position.SetX(horizontalOffset);
- result.back().position.SetY(0);
+ result.back().position=Vertex2D(horizontalOffset,0);
horizontalOffset += result.back().glyph.width;
}
@@ -713,7 +712,7 @@
}
void MapPainterDirectX::DrawIcon(const IconStyle* style,
- double x, double y,
+ const Vertex2D& centerPos,
double width, double height)
{
size_t idx = style->GetIconId() - 1;
@@ -722,14 +721,16 @@
FLOAT dx = (FLOAT)width / 2.0f;
FLOAT dy = (FLOAT)height / 2.0f;
- m_pRenderTarget->DrawBitmap(m_Bitmaps[idx], RECTF(x - dx, y - dy, x + dx, y + dy));
+ m_pRenderTarget->DrawBitmap(m_Bitmaps[idx], RECTF(centerPos.GetX() - dx,
+ centerPos.GetY() - dy,
+ centerPos.GetX() + dx,
+ centerPos.GetY() + dy));
}
void MapPainterDirectX::DrawSymbol(const Projection& projection,
const MapParameter& /*parameter*/,
const Symbol& symbol,
- double x,
- double y,
+ const Vertex2D& screenPos,
double /*scaleFactor*/)
{
ScreenBox boundingBox=symbol.GetBoundingBox(projection);
@@ -791,10 +792,10 @@
else if (RectanglePrimitive* rectangle = dynamic_cast<RectanglePrimitive*>(primitive);
rectangle != nullptr)
{
- D2D1_RECT_F rect = RECTF(x + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX()) - center.GetX(),
- y + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY()) - center.GetY(),
- x + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX()) - center.GetX() + projection.ConvertWidthToPixel(rectangle->GetWidth()),
- y + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY()) - center.GetY() + projection.ConvertWidthToPixel(rectangle->GetHeight()));
+ D2D1_RECT_F rect = RECTF(screenPos.GetX() + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX()) - center.GetX(),
+ screenPos.GetY() + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY()) - center.GetY(),
+ screenPos.GetX() + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX()) - center.GetX() + projection.ConvertWidthToPixel(rectangle->GetWidth()),
+ screenPos.GetY() + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY()) - center.GetY() + projection.ConvertWidthToPixel(rectangle->GetHeight()));
m_pRenderTarget->FillRectangle(rect, GetColorBrush(fillStyle->GetFillColor()));
if (hasBorder) m_pRenderTarget->DrawRectangle(rect, GetColorBrush(borderStyle->GetColor()), borderWidth, GetStrokeStyle(borderStyle->GetDash()));
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-gdi/include/meson.build
^
|
@@ -6,4 +6,10 @@
'osmscoutmapgdi/MapPainterGDIWindow.h'
]
-install_headers(osmscoutmapgdiHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapgdiHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapgdiHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-gdi/include/osmscoutmapgdi/MapPainterGDI.h
^
|
@@ -130,11 +130,11 @@
void DrawSymbol(const Projection &projection,
const MapParameter ¶meter,
const Symbol &style,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawIcon(const IconStyle *style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawPath(const Projection &projection,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-gdi/meson.build
^
|
@@ -2,7 +2,7 @@
if get_option('default_library')=='shared'
cppArgs += ['-DOSMScoutMapGDI_EXPORTS']
-
+
if haveVisibility
cppArgs += ['-fvisibility=hidden']
endif
@@ -19,6 +19,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, gdiplusDep],
link_with: [osmscoutmap, osmscout],
+ version: libraryVersion,
install: true)
-
-# TODO: Generate PKG_CONFIG file
+
+# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-gdi/src/osmscoutmapgdi/MapPainterGDI.cpp
^
|
@@ -349,8 +349,7 @@
result.emplace_back();
result.back().glyph.character = WStringToUTF8String(buffer.data());
- result.back().position.SetX(horizontalOffset);
- result.back().position.SetY(0);
+ result.back().position=Vertex2D(horizontalOffset,0);
Gdiplus::RectF bb;
@@ -639,7 +638,7 @@
void MapPainterGDI::DrawSymbol(const Projection &projection,
const MapParameter & /*parameter*/,
const Symbol &symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double /*scaleFactor*/) {
Gdiplus::Pen *pPen;
@@ -660,8 +659,8 @@
pRender->pointBuffer.ResetAndReserve(polygon->GetCoords().size());
for (const auto &pixel: polygon->GetCoords()) {
- pRender->pointBuffer.AddPoint(x + projection.ConvertWidthToPixel(pixel.GetX()) - center.GetX(),
- y + projection.ConvertWidthToPixel(pixel.GetY()) - center.GetY());
+ pRender->pointBuffer.AddPoint(screenPos.GetX() + projection.ConvertWidthToPixel(pixel.GetX()) - center.GetX(),
+ screenPos.GetY() + projection.ConvertWidthToPixel(pixel.GetY()) - center.GetY());
}
if (polygon->GetFillStyle()) {
@@ -680,8 +679,8 @@
} else if (rectangle != nullptr) {
pPen = (rectangle->GetBorderStyle()) ? pRender->GetPen(rectangle->GetBorderStyle()) : nullptr;
Gdiplus::RectF rect(
- (Gdiplus::REAL) (x + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX()) - center.GetX()),
- (Gdiplus::REAL) (y + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY()) - center.GetY()),
+ (Gdiplus::REAL) (screenPos.GetX() + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX()) - center.GetX()),
+ (Gdiplus::REAL) (screenPos.GetY() + projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY()) - center.GetY()),
(Gdiplus::REAL) (projection.ConvertWidthToPixel(rectangle->GetWidth())),
(Gdiplus::REAL) (projection.ConvertWidthToPixel(rectangle->GetHeight()))
);
@@ -698,9 +697,9 @@
} else if (circle != nullptr) {
pPen = (circle->GetBorderStyle()) ? pRender->GetPen(circle->GetBorderStyle()) : nullptr;
Gdiplus::RectF rect(
- (Gdiplus::REAL) (x + projection.ConvertWidthToPixel(circle->GetCenter().GetX()) - center.GetX() -
+ (Gdiplus::REAL) (screenPos.GetX() + projection.ConvertWidthToPixel(circle->GetCenter().GetX()) - center.GetX() -
2 * projection.ConvertWidthToPixel(circle->GetRadius())),
- (Gdiplus::REAL) (y + projection.ConvertWidthToPixel(circle->GetCenter().GetY()) - center.GetY() -
+ (Gdiplus::REAL) (screenPos.GetY() + projection.ConvertWidthToPixel(circle->GetCenter().GetY()) - center.GetY() -
2 * projection.ConvertWidthToPixel(circle->GetRadius())),
(Gdiplus::REAL) (2 * projection.ConvertWidthToPixel(circle->GetRadius())),
(Gdiplus::REAL) (2 * projection.ConvertWidthToPixel(circle->GetRadius()))
@@ -720,13 +719,16 @@
}
void MapPainterGDI::DrawIcon(const IconStyle *style,
- double x, double y,
+ const Vertex2D& centerPos,
double width, double height) {
RENDEROBJECT(pRender);
Gdiplus::Image *pImage = pRender->GetIcon(style->GetIconId());
if (pImage != nullptr) {
- pRender->m_pGraphics->DrawImage(pImage, (INT) (x - width / 2.0), (INT) (y - height / 2.0), (INT) width,
+ pRender->m_pGraphics->DrawImage(pImage,
+ (INT) (centerPos.GetX() - width / 2.0),
+ (INT) (centerPos.GetY() - height / 2.0),
+ (INT) width,
(INT) height);
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-gdi/src/osmscoutmapgdi/MapPainterGDIWindow.cpp
^
|
@@ -28,6 +28,8 @@
#include <windows.h>
+#include <osmscout/projection/MercatorProjection.h>
+
#include <osmscoutmapgdi/MapPainterGDIWindow.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/include/meson.build
^
|
@@ -4,4 +4,10 @@
'osmscoutmapiosx/MapPainterIOS.h'
]
-install_headers(osmscoutmapiosxHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapiosxHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapiosxHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/include/osmscoutmapiosx/MapPainterIOS.h
^
|
@@ -158,7 +158,7 @@
private:
const float ProposedWidthExpandRatio = 1.6;
const float ProposedWidthMinWidth = 50.0;
-
+
CGContextRef cg;
CGFloat contentScale;
@@ -236,13 +236,13 @@
const MapData& data) override;
void DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawPath(const Projection& projection,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/meson.build
^
|
@@ -13,6 +13,7 @@
cocoaDep,
appKitDep],
link_with: [osmscoutmap, osmscout],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/src/osmscout/MapPainterIOS.mm
^
|
@@ -313,7 +313,7 @@
glyph.glyph.line = label.line[i];
glyph.glyph.run = run;
glyph.glyph.index = index;
- glyph.position.Set(glyphPositions[index].x, glyphPositions[index].y);
+ glyph.position=Vertex2D(glyphPositions[index].x, glyphPositions[index].y);
result.push_back(std::move(glyph));
}
i++;
@@ -377,11 +377,11 @@
log.Debug() << "proposedWidth=" << proposedWidth << " for '" << text << "'";
}
-
+
NSString *str = [NSString stringWithCString:text.c_str() encoding:NSUTF8StringEncoding];
- // replace hyphen by unicode NON-BREAKING HYPHEN
+ // replace hyphen by unicode NON-BREAKING HYPHEN
str = [str stringByReplacingOccurrencesOfString:@"-" withString:@"\u2011"];
-
+
Font *font = GetFont(projection, parameter, fontSize);
NSMutableDictionary<NSAttributedStringKey, id> *attr = [NSMutableDictionary dictionaryWithDictionary: @{}];
if(font){
@@ -414,9 +414,9 @@
}
result->label.lineWidth = rect.size.width;
result->label.lineHeight = GetFontHeight(projection, parameter, fontSize);
-
+
log.Debug() << "Layout '"<<text<<"' width=" << rect.size.width <<" height=" << rect.size.height;
-
+
result->text = text;
result->fontSize = fontSize;
result->width = rect.size.width;
@@ -586,7 +586,7 @@
hnd.transEnd = transStart;
}
hnd.direction = (hnd.transStart < hnd.transEnd) ? 1 : -1;
- origin.Set(coordBuffer.buffer[hnd.transStart].GetX(), coordBuffer.buffer[hnd.transStart].GetY());
+ origin=Vertex2D(coordBuffer.buffer[hnd.transStart].GetX(), coordBuffer.buffer[hnd.transStart].GetY());
}
bool MapPainterIOS::followPath(FollowPathHandle &hnd, double l, Vertex2D &origin) {
@@ -609,7 +609,7 @@
fracToGo = l/len;
if(fracToGo <= 1.0) {
- origin.Set(x + deltaX*fracToGo,y + deltaY*fracToGo);
+ origin=Vertex2D(x + deltaX*fracToGo,y + deltaY*fracToGo);
return true;
}
@@ -657,7 +657,7 @@
CGContextTranslateCTM(cg, x2, y2);
CGAffineTransform ct = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(slope));
CGContextConcatCTM(cg, ct);
- DrawSymbol(projection, parameter, symbol, 0, 0, data.symbolScale);
+ DrawSymbol(projection, parameter, symbol, Vertex2D::ZERO, data.symbolScale);
CGContextRestoreGState(cg);
loop = followPath(followPathHnd, data.symbolSpace, origin);
}
@@ -672,7 +672,7 @@
* double width, double height)
*/
void MapPainterIOS::DrawIcon(const IconStyle* style,
- double x, double y,
+ const Vertex2D& centerPos,
double /*width*/, double /*height*/){
size_t idx=style->GetIconId()-1;
@@ -681,7 +681,9 @@
CGFloat w = CGImageGetWidth(images[idx]);
CGFloat h = CGImageGetHeight(images[idx]);
- CGRect rect = CGRectMake(x-w/2, -h/2-y, w, h);
+ CGRect rect = CGRectMake(centerPos.GetX()-w/2,
+ -h/2-centerPos.GetY(),
+ w, h);
CGContextSaveGState(cg);
CGContextScaleCTM(cg, 1.0, -1.0);
CGContextDrawImage(cg, rect, images[idx]);
@@ -697,7 +699,7 @@
void MapPainterIOS::DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor){
ScreenBox boundingBox=symbol.GetBoundingBox(projection);
Vertex2D center=boundingBox.GetCenter();
@@ -733,11 +735,13 @@
pixel!=polygon->GetCoords().end();
++pixel) {
if (pixel==polygon->GetCoords().begin()) {
- CGContextMoveToPoint(cg,x+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
- y+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
+ CGContextMoveToPoint(cg,
+ screenPos.GetX()+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
+ screenPos.GetY()+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
} else {
- CGContextAddLineToPoint(cg,x+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
- y+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
+ CGContextAddLineToPoint(cg,
+ screenPos.GetX()+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
+ screenPos.GetY()+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
}
}
@@ -759,8 +763,8 @@
} else {
CGContextSetRGBStrokeColor(cg,0,0,0,0);
}
- CGRect rect = CGRectMake(x+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX())-center.GetX(),
- y+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY())-center.GetY(),
+ CGRect rect = CGRectMake(screenPos.GetX()+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX())-center.GetX(),
+ screenPos.GetY()+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY())-center.GetY(),
projection.ConvertWidthToPixel(rectangle->GetWidth()),
projection.ConvertWidthToPixel(rectangle->GetHeight()));
CGContextAddRect(cg,rect);
@@ -782,8 +786,8 @@
} else {
CGContextSetRGBStrokeColor(cg,0,0,0,0);
}
- CGRect rect = CGRectMake(x+projection.ConvertWidthToPixel(circle->GetCenter().GetX())-center.GetX(),
- y+projection.ConvertWidthToPixel(circle->GetCenter().GetY())-center.GetY(),
+ CGRect rect = CGRectMake(screenPos.GetX()+projection.ConvertWidthToPixel(circle->GetCenter().GetX())-center.GetX(),
+ screenPos.GetY()+projection.ConvertWidthToPixel(circle->GetCenter().GetY())-center.GetY(),
projection.ConvertWidthToPixel(circle->GetRadius()),
projection.ConvertWidthToPixel(circle->GetRadius()));
CGContextAddEllipseInRect(cg, rect);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/include/meson.build
^
|
@@ -8,13 +8,13 @@
'osmscoutmapopengl/OpenGLProjection.h',
'osmscoutmapopengl/PNGLoaderOpenGL.h',
'osmscoutmapopengl/ShaderUtils.h',
- 'osmscoutmapopengl/TextLoader.h',
- 'poly2tri/poly2tri.h',
- 'poly2tri/sweep/cdt.h',
- 'poly2tri/sweep/sweep.h',
- 'poly2tri/common/utils.h',
- 'poly2tri/sweep/sweep.h',
- 'poly2tri/sweep/advancing_front.h'
+ 'osmscoutmapopengl/TextLoader.h'
]
-install_headers(osmscoutmapopenglHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapopenglHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapopenglHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/include/osmscoutmapopengl/OpenGLProjection.h
^
|
@@ -22,7 +22,7 @@
#include <osmscoutmapopengl/MapOpenGLImportExport.h>
-#include <osmscout/util/Projection.h>
+#include <osmscout/projection/MercatorProjection.h>
#include <cassert>
@@ -50,15 +50,15 @@
assert(width>0);
assert(height>0);
- auto SetGLf = [shaderProgram](const char *uniformName, GLfloat f) {
- glUniform1f(glGetUniformLocation(shaderProgram, uniformName), f);
+ auto SetGLf = [shaderProgram](const std::string_view& uniformName, GLfloat f) {
+ glUniform1f(glGetUniformLocation(shaderProgram, uniformName.data()), f);
};
- auto SetGLui = [shaderProgram](const char *uniformName, GLuint i) {
- glUniform1ui(glGetUniformLocation(shaderProgram, uniformName), i);
+ auto SetGLui = [shaderProgram](const std::string_view& uniformName, GLuint i) {
+ glUniform1ui(glGetUniformLocation(shaderProgram, uniformName.data()), i);
};
- SetGLf("centerLat", lat);
- SetGLf("centerLon", lon);
+ SetGLf("centerLat", center.GetLat());
+ SetGLf("centerLon", center.GetLon());
SetGLf("scaleGradtorad", scaleGradtorad);
SetGLui("useLinearInterpolation", useLinearInterpolation ? 1 : 0);
SetGLf("scaledLatDeriv", scaledLatDeriv);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/meson.build
^
|
@@ -19,6 +19,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, openGLDep, glmDep, glewDep, pngDep, ftDep],
link_with: [osmscout, osmscoutmap],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/src/osmscoutmapopengl/MapPainterOpenGL.cpp
^
|
@@ -401,26 +401,21 @@
bool osmscout::MapPainterOpenGL::IsVisibleArea(const Projection &projection, const GeoBox &boundingBox,
double pixelOffset) {
- double x1;
- double x2;
- double y1;
- double y2;
+ Vertex2D minPixel;
+ Vertex2D maxPixel;
projection.GeoToPixel(boundingBox.GetMinCoord(),
- x1,
- y1);
+ minPixel);
projection.GeoToPixel(boundingBox.GetMaxCoord(),
- x2,
- y2);
+ maxPixel);
- double xMin = std::min(x1, x2) - pixelOffset;
- double xMax = std::max(x1, x2) + pixelOffset;
- double yMin = std::min(y1, y2) - pixelOffset;
- double yMax = std::max(y1, y2) + pixelOffset;
+ double xMin = std::min(minPixel.GetX(), maxPixel.GetX()) - pixelOffset;
+ double xMax = std::max(minPixel.GetX(), maxPixel.GetX()) + pixelOffset;
+ double yMin = std::min(minPixel.GetY(), maxPixel.GetY()) - pixelOffset;
+ double yMax = std::max(minPixel.GetY(), maxPixel.GetY()) + pixelOffset;
- osmscout::GeoBox gb;
- projection.GetDimensions(gb);
+ osmscout::GeoBox gb(projection.GetDimensions());
double areaMinDimension = projection.ConvertWidthToPixel(parameter.GetAreaMinDimensionMM());
if (xMax - xMin <= areaMinDimension &&
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-qt/include/meson.build
^
|
@@ -6,4 +6,10 @@
'osmscoutmapqt/SymbolRendererQt.h'
]
-install_headers(osmscoutmapqtHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapqtHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapqtHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-qt/include/osmscoutmapqt/MapPainterQt.h
^
|
@@ -28,6 +28,7 @@
#include <osmscoutmapqt/MapQtImportExport.h>
+#include <osmscoutmap/BatchMapPainter.h>
#include <osmscoutmap/MapPainter.h>
#include <QtGui/QTextLayout>
@@ -38,14 +39,14 @@
using QtLabel = Label<QGlyphRun, QTextLayout>;
using QtLabelInstance = LabelInstance<QGlyphRun, QTextLayout>;
- class MapPainterBatchQt;
+ class BatchMapPainterQt;
/**
Implementation of MapPainter for Qt
*/
class OSMSCOUT_MAP_QT_API MapPainterQt : public MapPainter
{
- friend class MapPainterBatchQt;
+ friend class BatchMapPainterQt;
using QtLabelLayouter = LabelLayouter<QGlyphRun, QTextLayout, MapPainterQt>;
friend QtLabelLayouter;
@@ -197,13 +198,13 @@
const MapData& data) override;
void DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawPath(const Projection& projection,
@@ -248,12 +249,12 @@
* are used from multiple threads, they should be always
* added in same order to avoid deadlocks.
*/
- class OSMSCOUT_MAP_QT_API MapPainterBatchQt:
- public MapPainterBatch<MapPainterQt*> {
+ class OSMSCOUT_MAP_QT_API BatchMapPainterQt:
+ public BatchMapPainter<MapPainterQt*> {
public:
- explicit MapPainterBatchQt(size_t expectedCount);
+ explicit BatchMapPainterQt(size_t expectedCount);
- ~MapPainterBatchQt() override;
+ ~BatchMapPainterQt() override;
bool paint(const Projection& projection,
const MapParameter& parameter,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-qt/meson.build
^
|
@@ -20,6 +20,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, qt5GuiDep, qt5SvgDep],
link_with: [osmscout, osmscoutmap],
+ version: libraryVersion,
install: true)
elif get_option('qtVersion') == 6
osmscoutmapqt = library('osmscout_map_qt',
@@ -28,6 +29,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, qt6GuiDep, qt6SvgDep],
link_with: [osmscout, osmscoutmap],
+ version: libraryVersion,
install: true)
endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-qt/src/osmscoutmapqt/MapPainterQt.cpp
^
|
@@ -523,8 +523,7 @@
}
hnd.direction=(hnd.transStart < hnd.transEnd) ? 1 : -1;
- origin.Set(coordRange.Get(hnd.transStart).GetX(),
- coordRange.Get(hnd.transStart).GetY());
+ origin=coordRange.Get(hnd.transStart);
}
bool MapPainterQt::FollowPath(FollowPathHandle &hnd,
@@ -553,8 +552,8 @@
double fracToGo=l/len;
if (fracToGo<=1.0) {
- origin.Set(x + deltaX*fracToGo,
- y + deltaY*fracToGo);
+ origin=Vertex2D(x + deltaX*fracToGo,
+ y + deltaY*fracToGo);
return true;
}
@@ -634,7 +633,7 @@
DrawSymbol(projection,
parameter,
symbol,
- 0,0,
+ Vertex2D::ZERO,
data.symbolScale);
loop=FollowPath(followPathHnd,
data.coordRange,
@@ -647,7 +646,7 @@
}
void MapPainterQt::DrawIcon(const IconStyle* style,
- double x, double y,
+ const Vertex2D& centerPos,
double width, double height)
{
const auto &it=images.find(style->GetIconName());
@@ -655,7 +654,8 @@
assert(it!=images.end());
assert(!it->second.isNull());
- painter->drawImage(QRectF(x-width/2, y-height/2, width, height),
+ painter->drawImage(QRectF(centerPos.GetX()-width/2, centerPos.GetY()-height/2,
+ width, height),
it->second,
QRectF(0, 0, it->second.width(), it->second.height()));
}
@@ -663,13 +663,13 @@
void MapPainterQt::DrawSymbol(const Projection& projection,
const MapParameter& /*parameter*/,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor)
{
SymbolRendererQt renderer(painter);
renderer.Render(projection,
symbol,
- Vertex2D(x, y),
+ screenPos,
scaleFactor);
}
@@ -881,7 +881,10 @@
const PathLabelData &label,
const LabelPath &labelPath)
{
- GetLayouter().RegisterContourLabel(projection, parameter, label, labelPath);
+ GetLayouter().RegisterContourLabel(projection,
+ parameter,
+ label,
+ labelPath);
}
void MapPainterQt::DrawLabels(const Projection& projection,
@@ -1073,19 +1076,19 @@
QtGlyph glyph;
glyph.glyph=std::move(orphanGlyph);
- glyph.position.Set(pos.x(), pos.y());
+ glyph.position=Vertex2D(pos.x(), pos.y());
result.push_back(std::move(glyph));
}
}
return result;
}
- MapPainterBatchQt::MapPainterBatchQt(size_t expectedCount):
- MapPainterBatch(expectedCount) {}
+ BatchMapPainterQt::BatchMapPainterQt(size_t expectedCount):
+ BatchMapPainter(expectedCount) {}
- MapPainterBatchQt::~MapPainterBatchQt(){}
+ BatchMapPainterQt::~BatchMapPainterQt(){}
- bool MapPainterBatchQt::paint(const Projection& projection,
+ bool BatchMapPainterQt::paint(const Projection& projection,
const MapParameter& parameter,
QPainter* qPainter)
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-svg/include/meson.build
^
|
@@ -5,4 +5,10 @@
'osmscoutmapsvg/MapPainterSVG.h'
]
-install_headers(osmscoutmapsvgHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapsvgHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapsvgHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-svg/include/osmscoutmapsvg/MapPainterSVG.h
^
|
@@ -193,11 +193,11 @@
void DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& style,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawPath(const Projection& projection,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-svg/meson.build
^
|
@@ -2,7 +2,7 @@
if get_option('default_library')=='shared'
cppArgs += ['-DOSMScoutMapSVG_EXPORTS']
-
+
if haveVisibility
cppArgs += ['-fvisibility=hidden']
endif
@@ -19,6 +19,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, pangoft2Dep],
link_with: [osmscoutmap, osmscout],
+ version: libraryVersion,
install: true)
-
-# TODO: Generate PKG_CONFIG file
+
+# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map-svg/src/osmscoutmapsvg/MapPainterSVG.cpp
^
|
@@ -198,8 +198,8 @@
result.back().glyph.font = font;
- result.back().position.SetX(((double)glyphInfo.geometry.x_offset/(double)PANGO_SCALE) + horizontalOffset);
- result.back().position.SetY((double)glyphInfo.geometry.y_offset/(double)PANGO_SCALE);
+ result.back().position=Vertex2D(((double)glyphInfo.geometry.x_offset/(double)PANGO_SCALE) + horizontalOffset,
+ (double)glyphInfo.geometry.y_offset/(double)PANGO_SCALE);
glyphInfo.geometry.x_offset = 0;
glyphInfo.geometry.y_offset = 0;
@@ -236,8 +236,8 @@
result.back().glyph.character = WStringToUTF8String(label.substr(ch,1));
- result.back().position.SetX(horizontalOffset);
- result.back().position.SetY(0);
+ result.back().position=Vertex2D(horizontalOffset,
+ 0.0);
horizontalOffset += (double)(height * MapPainterSVG::AverageCharacterWidth);
}
@@ -731,7 +731,10 @@
const PathLabelData &label,
const LabelPath &labelPath)
{
- labelLayouter.RegisterContourLabel(projection, parameter, label, labelPath);
+ labelLayouter.RegisterContourLabel(projection,
+ parameter,
+ label,
+ labelPath);
}
void MapPainterSVG::IconData(const Projection& projection,
@@ -777,7 +780,7 @@
void MapPainterSVG::DrawSymbol(const Projection& projection,
const MapParameter& /*parameter*/,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double /*scaleFactor*/)
{
ScreenBox boundingBox=symbol.GetBoundingBox(projection);
@@ -792,8 +795,8 @@
const auto *circle=dynamic_cast<const CirclePrimitive*>(primitivePtr);
if (polygon != nullptr) {
- FillStyleRef fillStyle=polygon->GetFillStyle();
- BorderStyleRef borderStyle=polygon->GetBorderStyle();
+ const FillStyleRef fillStyle=polygon->GetFillStyle();
+ const BorderStyleRef borderStyle=polygon->GetBorderStyle();
stream << " <polyline";
SetupFillAndStroke(fillStyle, borderStyle);
@@ -808,19 +811,19 @@
stream << " ";
}
- stream << (x+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX())
- << "," << (y+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
+ stream << (screenPos.GetX()+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX())
+ << "," << (screenPos.GetY()+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
}
stream << "\" />" << std::endl;
} else if (rectangle != nullptr) {
- FillStyleRef fillStyle=rectangle->GetFillStyle();
- BorderStyleRef borderStyle=rectangle->GetBorderStyle();
+ const FillStyleRef fillStyle=rectangle->GetFillStyle();
+ const BorderStyleRef borderStyle=rectangle->GetBorderStyle();
stream << " <rect";
- stream << " x=\"" << ((x+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX())-center.GetX())) << "\"";
- stream << " y=\"" << ((y+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY())-center.GetY())) << "\"";
+ stream << " x=\"" << ((screenPos.GetX()+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetX())-center.GetX())) << "\"";
+ stream << " y=\"" << ((screenPos.GetY()+projection.ConvertWidthToPixel(rectangle->GetTopLeft().GetY())-center.GetY())) << "\"";
stream << " width=\"" << (projection.ConvertWidthToPixel(rectangle->GetWidth())) << "\"";
stream << " height=\"" << (projection.ConvertWidthToPixel(rectangle->GetHeight())) << "\"";
@@ -828,12 +831,12 @@
stream << " />" << std::endl;
} else if (circle != nullptr) {
- FillStyleRef fillStyle=circle->GetFillStyle();
- BorderStyleRef borderStyle=circle->GetBorderStyle();
+ const FillStyleRef fillStyle=circle->GetFillStyle();
+ const BorderStyleRef borderStyle=circle->GetBorderStyle();
stream << " <circle";
- stream << " cx=\"" << (x+projection.ConvertWidthToPixel(circle->GetCenter().GetX())-center.GetX()) << "\"";
- stream << " cy=\"" << (y+projection.ConvertWidthToPixel(circle->GetCenter().GetY())-center.GetY()) << "\"";
+ stream << " cx=\"" << (screenPos.GetX()+projection.ConvertWidthToPixel(circle->GetCenter().GetX())-center.GetX()) << "\"";
+ stream << " cy=\"" << (screenPos.GetY()+projection.ConvertWidthToPixel(circle->GetCenter().GetY())-center.GetY()) << "\"";
stream << " r=\"" << (projection.ConvertWidthToPixel(circle->GetRadius())) << "\"";
SetupFillAndStroke(fillStyle, borderStyle);
@@ -843,10 +846,10 @@
}
void MapPainterSVG::DrawIcon(const IconStyle* style,
- double x, double y,
+ const Vertex2D& centerPos,
double width, double height)
{
- stream << " <use x=\"" << (x - width/2) << "\" y=\"" << (y - height/2) << "\" " <<
+ stream << " <use x=\"" << (centerPos.GetX() - width/2) << "\" y=\"" << (centerPos.GetY() - height/2) << "\" " <<
"width=\"" << width << "\" height=\"" << height << "\" " <<
"xlink:href=\"#icon_" << style->GetIconId() << "\" />\n";
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/CMakeLists.txt
^
|
@@ -2,8 +2,11 @@
include/osmscoutmap/MapImportExport.h
include/osmscoutmap/oss/Parser.h
include/osmscoutmap/oss/Scanner.h
+ include/osmscoutmap/BatchMapPainter.h
include/osmscoutmap/LabelLayouter.h
+ include/osmscoutmap/BatchMapPainter.h
include/osmscoutmap/MapPainter.h
+ include/osmscoutmap/MapPainterStatistics.h
include/osmscoutmap/MapParameter.h
include/osmscoutmap/MapData.h
include/osmscoutmap/MapService.h
@@ -25,6 +28,7 @@
src/osmscoutmap/oss/Scanner.cpp
src/osmscoutmap/LabelLayouter.cpp
src/osmscoutmap/MapPainter.cpp
+ src/osmscoutmap/MapPainterStatistics.cpp
src/osmscoutmap/MapParameter.cpp
src/osmscoutmap/MapData.cpp
src/osmscoutmap/MapService.cpp
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/meson.build
^
|
@@ -4,8 +4,10 @@
'osmscoutmap/MapImportExport.h',
'osmscoutmap/oss/Scanner.h',
'osmscoutmap/oss/Parser.h',
+ 'osmscoutmap/BatchMapPainter.h',
'osmscoutmap/LabelLayouter.h',
'osmscoutmap/MapPainter.h',
+ 'osmscoutmap/MapPainterStatistics.h',
'osmscoutmap/MapParameter.h',
'osmscoutmap/LabelProvider.h',
'osmscoutmap/LabelPath.h',
@@ -21,4 +23,10 @@
'osmscoutmap/SymbolRenderer.h'
]
-install_headers(osmscoutmapHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutmapHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutmapHeader)
+endif
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/BatchMapPainter.h
^
|
@@ -0,0 +1,103 @@
+#ifndef OSMSCOUT_MAP_BATCHAPPAINTER_H
+#define OSMSCOUT_MAP_BATCHMAPPAINTER_H
+
+/*
+ This source is part of the libosmscout-map library
+ Copyright (C) 2023 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <vector>
+
+#include <osmscoutmap/MapImportExport.h>
+
+#include <osmscout/projection/Projection.h>
+
+#include <osmscoutmap/MapData.h>
+#include <osmscoutmap/MapPainter.h>
+#include <osmscoutmap/MapParameter.h>
+
+namespace osmscout {
+
+ /**
+ * \ingroup Renderer
+ *
+ * Batch renderer helps to render map based on multiple databases
+ * - map data and corresponding MapPainter
+ */
+ template <class PainterType>
+ class BatchMapPainter {
+ protected:
+ std::vector<MapDataRef> data;
+ std::vector<PainterType> painters;
+
+ protected:
+
+ /**
+ * Render bach of multiple databases, step by step (\see RenderSteps).
+ * All painters should have initialised its (backend specific) state.
+ *
+ * @param projection
+ * @param parameter
+ * @return false on error, true otherwise
+ */
+ bool BatchPaintInternal(const Projection& projection,
+ const MapParameter& parameter)
+ {
+ bool success=true;
+ for (auto step=static_cast<size_t>(osmscout::RenderSteps::FirstStep);
+ step<=static_cast<size_t>(osmscout::RenderSteps::LastStep);
+ ++step){
+
+ for (size_t i=0;i<data.size(); ++i){
+ const MapData &d=*(data[i]);
+ auto renderStep=static_cast<RenderSteps>(step);
+ if (!painters[i]->Draw(projection,
+ parameter,
+ d,
+ renderStep,
+ renderStep)) {
+ success=false;
+ }
+ }
+ }
+ return success;
+ }
+
+ public:
+ explicit BatchMapPainter(size_t expectedCount)
+ {
+ data.reserve(expectedCount);
+ painters.reserve(expectedCount);
+ }
+
+ virtual ~BatchMapPainter() = default;
+
+ void AddData(const MapDataRef &d, PainterType &painter)
+ {
+ data.push_back(d);
+ painters.push_back(painter);
+ }
+ };
+
+ /**
+ * \defgroup Renderer Map rendering
+ *
+ * Classes and methods related to rendering of maps.
+ */
+}
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/LabelLayouter.h
^
|
@@ -667,14 +667,14 @@
p->DrawSymbol(projection,
parameter,
*(el.labelData.iconStyle->GetSymbol()),
- el.x + el.labelData.iconWidth/2,
- el.y + el.labelData.iconHeight/2,
+ Vertex2D(el.x + el.labelData.iconWidth/2,
+ el.y + el.labelData.iconHeight/2),
1.0);
} else if (el.labelData.type==LabelData::Icon){
p->DrawIcon(el.labelData.iconStyle.get(),
- el.x + el.labelData.iconWidth/2,
- el.y + el.labelData.iconHeight/2,
+ Vertex2D(el.x + el.labelData.iconWidth/2,
+ el.y + el.labelData.iconHeight/2),
el.labelData.iconWidth,
el.labelData.iconHeight);
@@ -916,7 +916,8 @@
maxY = std::max(maxY, y[i]);
}
// setup glyph top-left position and dimension after rotation
- glyphCopy.trPosition.Set(minX+glyphCopy.position.GetX(), minY+glyphCopy.position.GetY());
+ glyphCopy.trPosition=Vertex2D(minX+glyphCopy.position.GetX(),
+ minY+glyphCopy.position.GetY());
glyphCopy.trWidth = maxX - minX;
glyphCopy.trHeight = maxY - minY;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/LabelPath.h
^
|
@@ -21,10 +21,11 @@
*/
#include <osmscoutmap/MapImportExport.h>
-#include <osmscout/Pixel.h>
#include <vector>
+#include <osmscout/Pixel.h>
+
namespace osmscout {
struct Segment
{
@@ -52,7 +53,7 @@
public:
explicit LabelPath(double minSegmentLength=5);
virtual ~LabelPath();
- void AddPoint(double x,double y);
+ void AddPoint(const Vertex2D& point);
double GetLength() const {
return length+endDistance;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/MapPainter.h
^
|
@@ -40,9 +40,10 @@
#include <osmscoutmap/MapData.h>
+#include <osmscout/projection/Projection.h>
+
#include <osmscout/util/Breaker.h>
#include <osmscout/util/Geometry.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/util/Transformation.h>
#include <osmscout/system/Compiler.h>
@@ -55,8 +56,10 @@
enum RenderSteps : size_t
{
FirstStep = 0,
- Initialize = 0, //!< Setup internal state of renderer for executing next steps with current projection and parameters
- DumpStatistics = 1, //!< Prints details for debugging, if debug flag (performance, data) is set in renderer parameter
+ Initialize = 0, //!< Setup internal state of renderer for executing next steps with current projection
+ //!< and parameters
+ DumpStatistics = 1, //!< Prints details for debugging, if debug flag (performance, data) is set in renderer
+ //!< parameter
CalculatePaths = 2, //!< Calculate the paths to draw based on the given ways
CalculateWayShields = 3, //!< Calculate the label shields on the ways
ProcessAreas = 4, //!< Process (complex) areas for rendering
@@ -95,29 +98,12 @@
using StepMethod = void (MapPainter::*)(const Projection &, const MapParameter &, const MapData &);
public:
-
- /**
- * Structure used for internal statistic collection
- */
- struct OSMSCOUT_MAP_API DataStatistic
- {
- TypeInfoRef type; //!< Type
- size_t objectCount=0; //!< Sum of nodeCount, wayCount, areaCont
- size_t nodeCount=0; //!< Number of Node objects
- size_t wayCount=0; //!< Number of Way objects
- size_t areaCount=0; //!< Number of Area objects
- size_t coordCount=0; //!< Number of coordinates
- size_t labelCount=0; //!< Number of labels
- size_t iconCount=0; //!< Number of icons
-
- DataStatistic() = default;
- };
-
/**
* Data structure for holding temporary data about ways
*/
- struct OSMSCOUT_MAP_API WayData
+ class OSMSCOUT_MAP_API WayData
{
+ public:
const FeatureValueBuffer *buffer; //!< Features of the line segment
int8_t layer; //!< Layer this way is in
LineStyleRef lineStyle; //!< Line style
@@ -125,8 +111,10 @@
size_t wayPriority; //!< Priority of way (from style sheet)
CoordBufferRange coordRange; //!< Range of coordinates in transformation buffer
double lineWidth; //!< Line width
- bool startIsClosed; //!< The end of the way is closed, it does not lead to another way or area
- bool endIsClosed; //!< The end of the way is closed, it does not lead to another way or area
+ bool startIsClosed; //!< The end of the way is closed, it does not lead to another
+ //!< way or area
+ bool endIsClosed; //!< The end of the way is closed, it does not lead to another
+ //!< way or area
/**
* We then draw lines in order of layer (Smaller layers first)
@@ -179,7 +167,8 @@
{
ObjectFileRef ref;
TypeInfoRef type;
- const FeatureValueBuffer *buffer; //!< Features of the line segment, can be NULL in case of border only areas
+ const FeatureValueBuffer *buffer; //!< Features of the line segment, can be NULL in case of border
+ //!< only areas
FillStyleRef fillStyle; //!< Fill style
BorderStyleRef borderStyle; //!< Border style
GeoBox boundingBox; //!< Bounding box of the area
@@ -213,7 +202,8 @@
Internal coordinate transformation data structures
*/
//@{
- TransBuffer transBuffer; //!< Internal buffer for coordinate transformation from geo coordinates to display coordinates
+ TransBuffer transBuffer; //!< Internal buffer for coordinate transformation from geo
+ //!< coordinates to display coordinates
CoordBuffer coordBuffer; //!< Coordinate buffer
//@}
@@ -239,6 +229,7 @@
std::vector<TextStyleRef> textStyles; //!< Temporary storage for StyleConfig return value
std::vector<LineStyleRef> lineStyles; //!< Temporary storage for StyleConfig return value
+ std::vector<PathSymbolStyleRef> symbolStyles; //!< Temporary storage for StyleConfig return value
/** L
Precalculations
@@ -281,15 +272,6 @@
private:
/**
- Debugging
- */
- //@{
- void DumpDataStatistics(const Projection& projection,
- const MapParameter& parameter,
- const MapData& data) const;
- //@}
-
- /**
Private draw algorithm implementation routines.
*/
//@{
@@ -348,7 +330,7 @@
void RegisterPointWayLabel(const Projection& projection,
const MapParameter& parameter,
const PathShieldStyleRef& style,
- const std::string& text,
+ const std::string_view& text,
const std::vector<Point>& nodes);
void LayoutPointLabels(const Projection& projection,
@@ -356,9 +338,8 @@
const FeatureValueBuffer& buffer,
const IconStyleRef& iconStyle,
const std::vector<TextStyleRef>& textStyles,
- double x, double y,
- double objectWidth=0,
- double objectHeight=0);
+ const Vertex2D& screenPos,
+ const ScreenBox& objectBox);
bool DrawWayDecoration(const StyleConfig& styleConfig,
const Projection& projection,
@@ -379,7 +360,7 @@
const MapParameter& parameter,
const WayPathData& data,
const PathTextStyleRef &pathTextStyle,
- const std::string &textLabel);
+ const std::string_view &textLabel);
bool DrawAreaBorderLabel(const StyleConfig& styleConfig,
const Projection& projection,
@@ -611,7 +592,7 @@
Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center).
*/
virtual void DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) = 0;
/**
@@ -620,7 +601,7 @@
virtual void DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x, double y,
+ const Vertex2D& screenPos,
double scaleFactor=1.0) = 0;
/**
@@ -669,7 +650,7 @@
//@}
- std::vector<OffsetRel> ParseLaneTurns(const LanesFeatureValue&) const;
+ std::vector<OffsetRel> ParseLaneTurns(const LanesFeatureValue& feature) const;
public:
explicit MapPainter(const StyleConfigRef& styleConfig);
@@ -687,66 +668,6 @@
};
/**
- * \ingroup Renderer
- *
- * Batch renderer helps to render map based on multiple databases
- * - map data and corresponding MapPainter
- */
- template <class PainterType>
- class MapPainterBatch {
- protected:
- std::vector<MapDataRef> data;
- std::vector<PainterType> painters;
-
- protected:
-
- /**
- * Render bach of multiple databases, step by step (\see RenderSteps).
- * All painters should have initialised its (backend specific) state.
- *
- * @param projection
- * @param parameter
- * @return false on error, true otherwise
- */
- bool batchPaintInternal(const Projection& projection,
- const MapParameter& parameter)
- {
- bool success=true;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/MapPainterNoOp.h
^
|
@@ -64,14 +64,13 @@
const MapData& data) override;
void DrawIcon(const IconStyle* style,
- double centerX, double centerY,
+ const Vertex2D& centerPos,
double width, double height) override;
void DrawSymbol(const Projection& projection,
const MapParameter& parameter,
const Symbol& symbol,
- double x,
- double y,
+ const Vertex2D& screenPos,
double scaleFactor) override;
void DrawPath(const Projection& projection,
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/MapPainterStatistics.h
^
|
@@ -0,0 +1,95 @@
+#ifndef OSMSCOUT_MAP_MAPPAINTERSTATISTICS_H
+#define OSMSCOUT_MAP_MAPPAINTERSTATISTICS_H
+
+/*
+ This source is part of the libosmscout-map library
+ Copyright (C) 2023 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutmap/MapImportExport.h>
+
+#include <osmscout/TypeConfig.h>
+
+#include <osmscout/projection/Projection.h>
+
+#include <osmscoutmap/MapParameter.h>
+#include <osmscoutmap/MapData.h>
+#include <osmscoutmap/StyleConfig.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_MAP_API MapPainterStatistics
+ {
+ private:
+ /**
+ * Structure used for internal statistic collection
+ */
+ struct OSMSCOUT_MAP_API DataStatistic
+ {
+ TypeInfoRef type; //!< Type
+ size_t objectCount=0; //!< Sum of nodeCount, wayCount, areaCont
+ size_t nodeCount =0; //!< Number of Node objects
+ size_t wayCount =0; //!< Number of Way objects
+ size_t areaCount =0; //!< Number of Area objects
+ size_t coordCount =0; //!< Number of coordinates
+ size_t labelCount =0; //!< Number of labels
+ size_t iconCount =0; //!< Number of icons
+
+ DataStatistic() = default;
+ };
+
+ private:
+ void DumpDataStatistics(const std::list<DataStatistic>& statistics);
+
+ std::list<DataStatistic> MapToSortedList(const std::unordered_map<TypeInfoRef,DataStatistic>& statistics);
+
+ void DumpDataStatistics(const StyleConfig& styleConfig,
+ const Projection& projection,
+ const MapParameter& parameter,
+ const MapData& data);
+
+ void CalculateStatistics(const Projection& projection,
+ const MapParameter& parameter,
+ const StyleConfig& styleConfig,
+ const NodeRef& node,
+ DataStatistic& statistic);
+
+ void CalculateStatistics(const Projection& projection,
+ const MapParameter& parameter,
+ const StyleConfig& styleConfig,
+ const WayRef& way,
+ DataStatistic& statistic);
+
+ void CalculateStatistics(const Projection& projection,
+ const MapParameter& parameter,
+ const StyleConfig& styleConfig,
+ const AreaRef& area,
+ DataStatistic& statistic);
+
+ void DumpStatisticWarnings(const MapParameter& parameter,
+ const std::unordered_map<TypeInfoRef,DataStatistic>& statistics);
+
+ public:
+ MapPainterStatistics() = default;
+
+ void DumpMapPainterStatistics(const StyleConfig& styleConfig,
+ const Projection& projection,
+ const MapParameter& parameter,
+ const MapData& data);
+ };
+}
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/StyleDescription.h
^
|
@@ -65,8 +65,10 @@
virtual void SetLabelValue(int attribute, const LabelProviderRef& value);
};
- // Probem under Mac OS X
- #undef TYPE_BOOL
+#if defined(TYPE_BOOL)
+ // Probem under Mac OS X
+ #undef TYPE_BOOL
+#endif
/**
* \ingroup Stylesheet
@@ -114,17 +116,17 @@
public:
virtual ~StyleAttributeDescriptor() = default;
- inline std::string GetName() const
+ std::string GetName() const
{
return name;
}
- inline StyleAttributeType GetType() const
+ StyleAttributeType GetType() const
{
return type;
}
- inline int GetAttribute() const
+ int GetAttribute() const
{
return attribute;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/Styles.h
^
|
@@ -27,8 +27,11 @@
#include <osmscoutmap/MapImportExport.h>
#include <osmscout/Pixel.h>
+
+#include <osmscout/projection/Projection.h>
+
#include <osmscout/util/Color.h>
-#include <osmscout/util/Projection.h>
+#include <osmscout/util/LaneTurn.h>
#include <osmscout/util/ScreenBox.h>
#include <osmscoutmap/StyleDescription.h>
@@ -61,8 +64,8 @@
extern bool IsLaneOffset(OffsetRel rel);
- extern OffsetRel ParseForwardTurnStringToOffset(const std::string& turn);
- extern OffsetRel ParseBackwardTurnStringToOffset(const std::string& turn);
+ extern OffsetRel ParseForwardTurnStringToOffset(LaneTurn turn);
+ extern OffsetRel ParseBackwardTurnStringToOffset(LaneTurn turn);
/**
* \ingroup Stylesheet
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/meson.build
^
|
@@ -19,6 +19,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep],
link_with: [osmscout],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/src/meson.build
^
|
@@ -3,6 +3,7 @@
'src/osmscoutmap/oss/Parser.cpp',
'src/osmscoutmap/LabelLayouter.cpp',
'src/osmscoutmap/MapPainter.cpp',
+ 'src/osmscoutmap/MapPainterStatistics.cpp',
'src/osmscoutmap/MapParameter.cpp',
'src/osmscoutmap/LabelProvider.cpp',
'src/osmscoutmap/LabelPath.cpp',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/LabelPath.cpp
^
|
@@ -34,20 +34,21 @@
{
}
- void LabelPath::AddPoint(double x,double y)
+ void LabelPath::AddPoint(const Vertex2D& point)
{
if (segments.empty()){
- end.Set(x,y);
+ end=point;
Segment s={end,0,0,0};
segments.push_back(s);
}else{
- end.Set(x,y);
+ end=point;
Segment last=segments.back();
- double endDistance = last.start.DistanceTo(Vertex2D(x,y)); // QVector2D(last.start).distanceToPoint(QVector2D(x,y));
+ double endDistance = last.start.DistanceTo(point); // QVector2D(last.start).distanceToPoint(QVector2D(x,y));
if (endDistance>minSegmentLength){
length+=endDistance;
last.length=endDistance;
- last.angle=std::atan2(last.start.GetY()-y,x-last.start.GetX());
+ last.angle=std::atan2(last.start.GetY()-point.GetY(),
+ point.GetX()-last.start.GetX());
segments[segments.size()-1]=last;
// fill offsetIndex
@@ -66,10 +67,10 @@
if (segments.empty()){
return Vertex2D();
}
- Segment relevantSetment= SegmentBefore(offset);
- Vertex2D p=relevantSetment.start;
- double mul = (offset-relevantSetment.offset);
- Vertex2D add(std::cos(relevantSetment.angle) * mul, -std::sin(relevantSetment.angle) * mul);
+ Segment relevantSegment= SegmentBefore(offset);
+ Vertex2D p =relevantSegment.start;
+ double mul = (offset-relevantSegment.offset);
+ Vertex2D add(std::cos(relevantSegment.angle)*mul,-std::sin(relevantSegment.angle)*mul);
return Vertex2D(p.GetX() + add.GetX(), p.GetY() + add.GetY());
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/MapPainter.cpp
^
|
@@ -22,7 +22,6 @@
#include <cstdint>
#include <algorithm>
-#include <iostream>
#include <limits>
#include <osmscout/system/Math.h>
@@ -33,6 +32,8 @@
#include <osmscout/util/Tiling.h>
#include <osmscout/util/Geometry.h>
+#include <osmscoutmap/MapPainterStatistics.h>
+
namespace osmscout {
#ifdef OSMSCOUT_DEBUG_GROUNDTILES
@@ -49,7 +50,7 @@
std::set<GeoCoord> intersections;
- for (size_t i=0; i<nodes.size()-1; i++) {
+ for (size_t i=0; i<nodes.size()-1; ++i) {
size_t cellXStart=(size_t)((nodes[i].GetLon()+180.0)/gridSizeHoriz);
size_t cellYStart=(size_t)((nodes[i].GetLat()+90.0)/gridSizeVert);
@@ -60,7 +61,7 @@
double lower=std::min(cellYStart,cellYEnd)*gridSizeVert-90.0;
double upper=(std::max(cellYStart,cellYEnd)+1)*gridSizeVert-90.0;
- for (size_t xIndex=cellXStart+1; xIndex<=cellXEnd; xIndex++) {
+ for (size_t xIndex=cellXStart+1; xIndex<=cellXEnd; ++xIndex) {
GeoCoord intersection;
double xCoord=xIndex*gridSizeHoriz-180.0;
@@ -79,7 +80,7 @@
double lower=std::min(cellXStart,cellXEnd)*gridSizeHoriz-180.0;
double upper=(std::max(cellXStart,cellXEnd)+1)*gridSizeHoriz-180.0;
- for (size_t yIndex=cellYStart+1; yIndex<=cellYEnd; yIndex++) {
+ for (size_t yIndex=cellYStart+1; yIndex<=cellYEnd; ++yIndex) {
GeoCoord intersection;
double yCoord=yIndex*gridSizeVert-90.0;
@@ -101,7 +102,7 @@
/**
* Return if a > b, a should be drawn before b
*/
- static bool AreaSorter(const MapPainter::AreaData& a, const MapPainter::AreaData& b)
+ [[nodiscard]] static bool AreaSorter(const MapPainter::AreaData& a, const MapPainter::AreaData& b)
{
if (a.fillStyle && b.fillStyle) {
if (a.fillStyle->GetFillColor().IsSolid() && !b.fillStyle->GetFillColor().IsSolid()) {
@@ -146,8 +147,8 @@
/**
* Sort labels for the same object by position
*/
- static inline bool LabelLayoutDataSorter(const LabelData& a,
- const LabelData& b)
+ [[nodiscard]] static inline bool LabelLayoutDataSorter(const LabelData& a,
+ const LabelData& b)
{
return a.position<b.position;
}
@@ -177,7 +178,7 @@
seaFill=std::make_shared<FillStyle>();
seaFill->SetFillColor(Color(181.0/255,208.0/255,208.0/255));
- TextStyleRef textStyle=std::make_shared<TextStyle>();
+ auto textStyle=std::make_shared<TextStyle>();
textStyle->SetStyle(TextStyle::normal);
textStyle->SetPriority(0);
@@ -219,211 +220,6 @@
log.Debug() << "MapPainter::~MapPainter()";
}
- static void CalculateStatistics(const Projection& projection,
- const MapParameter& parameter,
- const StyleConfig& styleConfig,
- const NodeRef& node,
- MapPainter::DataStatistic& statistic)
- {
- statistic.nodeCount++;
- statistic.coordCount++;
-
- if (parameter.IsDebugData()) {
- IconStyleRef iconStyle=styleConfig.GetNodeIconStyle(node->GetFeatureValueBuffer(),
- projection);
-
- if (iconStyle) {
- statistic.iconCount++;
- }
-
- statistic.labelCount+=styleConfig.GetNodeTextStyleCount(node->GetFeatureValueBuffer(),
- projection);
-
- }
- }
-
- static void CalculateStatistics(const Projection& projection,
- const MapParameter& parameter,
- const StyleConfig& styleConfig,
- const WayRef& way,
- MapPainter::DataStatistic& statistic)
- {
- statistic.wayCount++;
- statistic.coordCount+=way->nodes.size();
-
- if (parameter.IsDebugData()) {
- PathShieldStyleRef shieldStyle=styleConfig.GetWayPathShieldStyle(way->GetFeatureValueBuffer(),
- projection);
- PathTextStyleRef pathTextStyle=styleConfig.GetWayPathTextStyle(way->GetFeatureValueBuffer(),
- projection);
-
- if (shieldStyle) {
- statistic.labelCount++;
- }
-
- if (pathTextStyle) {
- statistic.labelCount++;
- }
- }
- }
-
- static void CalculateStatistics(const Projection& projection,
- const MapParameter& parameter,
- const StyleConfig& styleConfig,
- const AreaRef& area,
- MapPainter::DataStatistic& statistic)
- {
- statistic.areaCount++;
-
- for (const auto& ring : area->rings) {
- statistic.coordCount+=ring.nodes.size();
-
- if (parameter.IsDebugData() && ring.IsMaster()) {
- IconStyleRef iconStyle=styleConfig.GetAreaIconStyle(area->GetType(),
- ring.GetFeatureValueBuffer(),
- projection);
-
- if (iconStyle) {
- statistic.iconCount++;
- }
-
- statistic.labelCount+=styleConfig.GetAreaTextStyleCount(area->GetType(),
- ring.GetFeatureValueBuffer(),
- projection);
- }
- }
- }
-
- static void DumpStatisticWarnings(const MapParameter& parameter,
- const std::unordered_map<TypeInfoRef,MapPainter::DataStatistic>& statistics)
- {
- for (const auto& [type, statistic] : statistics) {
- if (type) {
- if (parameter.GetWarningObjectCountLimit()>0 &&
- statistic.objectCount>parameter.GetWarningObjectCountLimit()) {
- log.Warn() << "Type : " << type->GetName() << " has " << statistic.objectCount << " objects (performance limit: " << parameter.GetWarningObjectCountLimit() << ")";
- }
-
- if (parameter.GetWarningCoordCountLimit()>0 &&
- statistic.coordCount>parameter.GetWarningCoordCountLimit()) {
- log.Warn() << "Type : " << type->GetName() << " has " << statistic.coordCount << " coords (performance limit: " << parameter.GetWarningCoordCountLimit() << ")";
- }
- }
- }
- }
-
- static std::list<MapPainter::DataStatistic> MapToSortedList(const std::unordered_map<TypeInfoRef,MapPainter::DataStatistic>& statistics)
- {
- std::list<MapPainter::DataStatistic> statisticList;
-
- for (const auto& [type, statistic] : statistics) {
- statisticList.push_back(statistic);
- }
-
- statisticList.sort([](const MapPainter::DataStatistic& a,
- const MapPainter::DataStatistic& b)->bool {return a.objectCount>b.objectCount;});
-
- return statisticList;
- }
-
- static void DumpDataStatistics(const std::list<MapPainter::DataStatistic>& statistics)
- {
- log.Info() << "Type|ObjectCount|NodeCount|WayCount|AreaCount|Nodes|Labels|Icons";
- for (const auto& entry : statistics) {
- log.Info() << entry.type->GetName() << " "
- << entry.objectCount << " "
- << entry.nodeCount << " " << entry.wayCount << " " << entry.areaCount << " "
- << entry.coordCount << " "
- << entry.labelCount << " "
- << entry.iconCount;
- }
- }
-
- void MapPainter::DumpDataStatistics(const Projection& projection,
- const MapParameter& parameter,
- const MapData& data) const
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/MapPainterNoOp.cpp
^
|
@@ -79,7 +79,7 @@
}
void MapPainterNoOp::DrawIcon(const IconStyle* /*style*/,
- double /*centerX*/, double /*centerY*/,
+ const Vertex2D& /*centerPos*/,
double /*width*/, double /*height*/)
{
// no code
@@ -89,8 +89,7 @@
void MapPainterNoOp::DrawSymbol(const Projection& /*projection*/,
const MapParameter& /*parameter*/,
const Symbol& /*symbol*/,
- double /*x*/,
- double /*y*/,
+ const Vertex2D& /*screenPos*/,
double /*scaleFactor*/)
{
// no code
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/MapPainterStatistics.cpp
^
|
@@ -0,0 +1,264 @@
+/*
+ This source is part of the libosmscout-map library
+ Copyright (C) 2023 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutmap/MapPainterStatistics.h>
+
+#include <osmscout/TypeInfoSet.h>
+
+#include <osmscout/util/Logger.h>
+
+namespace osmscout {
+
+ std::list<MapPainterStatistics::DataStatistic> MapPainterStatistics::MapToSortedList(
+ const std::unordered_map<TypeInfoRef,DataStatistic>& statistics)
+ {
+ std::list<DataStatistic> statisticList;
+
+ for (const auto& [type, statistic] : statistics) {
+ statisticList.push_back(statistic);
+ }
+
+ statisticList.sort([](const DataStatistic& a,
+ const DataStatistic& b)->bool {return a.objectCount>b.objectCount;});
+
+ return statisticList;
+ }
+
+ void MapPainterStatistics::DumpMapPainterStatistics(const StyleConfig& styleConfig,
+ const Projection& projection,
+ const MapParameter& parameter,
+ const MapData& data)
+ {
+ if (parameter.IsDebugPerformance()) {
+ log.Info()
+ << "Data: "
+ << data.nodes.size()
+ << "+" << data.poiNodes.size()
+ << " " << data.ways.size()
+ << " " << data.areas.size();
+ }
+
+ if (parameter.GetWarningCoordCountLimit()==0 &&
+ parameter.GetWarningObjectCountLimit()==0 &&
+ !parameter.IsDebugData()) {
+ return;
+ }
+
+ DumpDataStatistics(styleConfig,
+ projection,
+ parameter,
+ data);
+ }
+
+ void MapPainterStatistics::DumpDataStatistics(const std::list<DataStatistic>& statistics)
+ {
+ log.Info() << "Type|ObjectCount|NodeCount|WayCount|AreaCount|Nodes|Labels|Icons";
+ for (const auto& entry : statistics) {
+ log.Info() << entry.type->GetName() << " "
+ << entry.objectCount << " "
+ << entry.nodeCount << " " << entry.wayCount << " " << entry.areaCount << " "
+ << entry.coordCount << " "
+ << entry.labelCount << " "
+ << entry.iconCount;
+ }
+ }
+
+ void MapPainterStatistics::DumpDataStatistics(const StyleConfig& styleConfig,
+ const Projection& projection,
+ const MapParameter& parameter,
+ const MapData& data)
+ {
+ std::unordered_map<TypeInfoRef,DataStatistic> statistics;
+ TypeInfoSet types;
+
+ // Now analyse the actual data
+
+ for (const auto& node : data.nodes) {
+ DataStatistic& entry=statistics[node->GetType()];
+
+ CalculateStatistics(projection,
+ parameter,
+ styleConfig,
+ node,
+ entry);
+ }
+
+ for (const auto& node : data.poiNodes) {
+ DataStatistic& entry=statistics[node->GetType()];
+
+ CalculateStatistics(projection,
+ parameter,
+ styleConfig,
+ node,
+ entry);
+ }
+
+ for (const auto& way : data.ways) {
+ DataStatistic& entry=statistics[way->GetType()];
+
+ CalculateStatistics(projection,
+ parameter,
+ styleConfig,
+ way,
+ entry);
+ }
+
+ for (const auto& way : data.poiWays) {
+ DataStatistic& entry=statistics[way->GetType()];
+
+ CalculateStatistics(projection,
+ parameter,
+ styleConfig,
+ way,
+ entry);
+ }
+
+ for (const auto& area : data.areas) {
+ DataStatistic& entry=statistics[area->GetType()];
+
+ CalculateStatistics(projection,
+ parameter,
+ styleConfig,
+ area,
+ entry);
+ }
+
+ for (const auto& area : data.poiAreas) {
+ DataStatistic& entry=statistics[area->GetType()];
+
+ CalculateStatistics(projection,
+ parameter,
+ styleConfig,
+ area,
+ entry);
+ }
+
+ for (auto& [type, statistic] : statistics) {
+ statistic.objectCount=statistic.nodeCount+statistic.wayCount+statistic.areaCount;
+ }
+
+ DumpStatisticWarnings(parameter,
+ statistics);
+
+ if (parameter.IsDebugData()) {
+ for (auto& [type, statistic] : statistics) {
+ statistic.type=type;
+ }
+
+ DumpDataStatistics(MapToSortedList(statistics));
+ }
+ }
+
+ void MapPainterStatistics::CalculateStatistics(const Projection& projection,
+ const MapParameter& parameter,
+ const StyleConfig& styleConfig,
+ const NodeRef& node,
+ DataStatistic& statistic)
+ {
+ ++statistic.nodeCount;
+ ++statistic.coordCount;
+
+ if (parameter.IsDebugData()) {
+ IconStyleRef iconStyle=styleConfig.GetNodeIconStyle(node->GetFeatureValueBuffer(),
+ projection);
+
+ if (iconStyle) {
+ ++statistic.iconCount;
+ }
+
+ statistic.labelCount+=styleConfig.GetNodeTextStyleCount(node->GetFeatureValueBuffer(),
+ projection);
+
+ }
+ }
+
+ void MapPainterStatistics::CalculateStatistics(const Projection& projection,
+ const MapParameter& parameter,
+ const StyleConfig& styleConfig,
+ const WayRef& way,
+ DataStatistic& statistic)
+ {
+ ++statistic.wayCount;
+ statistic.coordCount+=way->nodes.size();
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/MapService.cpp
^
|
@@ -814,9 +814,7 @@
StopClock cacheRetrievalTime;
- GeoBox boundingBox;
-
- projection.GetDimensions(boundingBox);
+ GeoBox boundingBox(projection.GetDimensions());
cache.GetTilesForBoundingBox(projection.GetMagnification(),
boundingBox,
@@ -1367,9 +1365,7 @@
bool MapService::GetGroundTiles(const Projection& projection,
std::list<GroundTile>& tiles) const
{
- GeoBox boundingBox;
-
- projection.GetDimensions(boundingBox);
+ GeoBox boundingBox(projection.GetDimensions());
return GetGroundTiles(boundingBox,
projection.GetMagnification(),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/Styles.cpp
^
|
@@ -38,50 +38,50 @@
rel==OffsetRel::laneBackwardRight;
}
- OffsetRel ParseForwardTurnStringToOffset(const std::string& turn)
+ OffsetRel ParseForwardTurnStringToOffset(LaneTurn turn)
{
- if (turn=="left" || turn=="merge_to_left" || turn=="slight_left" || turn=="sharp_left") {
+ if (turn==LaneTurn::Left || turn==LaneTurn::MergeToLeft || turn==LaneTurn::SlightLeft || turn==LaneTurn::SharpLeft) {
return OffsetRel::laneForwardLeft;
}
- if (turn=="through;left" || turn=="through;slight_left" || turn=="through;sharp_left") {
+ if (turn==LaneTurn::Through_Left || turn==LaneTurn::Through_SlightLeft || turn==LaneTurn::Through_SharpLeft) {
return OffsetRel::laneForwardThroughLeft;
}
- if (turn=="through") {
+ if (turn==LaneTurn::Through) {
return OffsetRel::laneForwardThrough;
}
- if (turn=="through;right" || turn=="through;slight_right" || turn=="through;sharp_right") {
+ if (turn==LaneTurn::Through_Right || turn==LaneTurn::Through_SlightRight || turn==LaneTurn::Through_SharpRight) {
return OffsetRel::laneForwardThroughRight;
}
- if (turn=="right" || turn=="merge_to_right" || turn=="slight_right" || turn=="sharp_right") {
+ if (turn==LaneTurn::Right || turn==LaneTurn::MergeToRight || turn==LaneTurn::SlightRight || turn==LaneTurn::SharpRight) {
return OffsetRel::laneForwardRight;
}
return OffsetRel::base;
}
- OffsetRel ParseBackwardTurnStringToOffset(const std::string& turn)
+ OffsetRel ParseBackwardTurnStringToOffset(LaneTurn turn)
{
- if (turn=="left" || turn=="merge_to_left" || turn=="slight_left" || turn=="sharp_left") {
+ if (turn==LaneTurn::Left || turn==LaneTurn::MergeToLeft || turn==LaneTurn::SlightLeft || turn==LaneTurn::SharpLeft) {
return OffsetRel::laneBackwardLeft;
}
- if (turn=="through;left" || turn=="through;slight_left" || turn=="through;sharp_left") {
+ if (turn==LaneTurn::Through_Left || turn==LaneTurn::Through_SlightLeft || turn==LaneTurn::Through_SharpLeft) {
return OffsetRel::laneBackwardThroughLeft;
}
- if (turn=="through") {
+ if (turn==LaneTurn::Through) {
return OffsetRel::laneBackwardThrough;
}
- if (turn=="through;right" || turn=="through;slight_right" || turn=="through;sharp_right") {
+ if (turn==LaneTurn::Through_Right || turn==LaneTurn::Through_SlightRight || turn==LaneTurn::Through_SharpRight) {
return OffsetRel::laneBackwardThroughRight;
}
- if (turn=="right" || turn=="merge_to_right" || turn=="slight_right" || turn=="sharp_right") {
+ if (turn==LaneTurn::Right || turn==LaneTurn::MergeToRight || turn==LaneTurn::SlightRight || turn==LaneTurn::SharpRight) {
return OffsetRel::laneBackwardRight;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-test/include/meson.build
^
|
@@ -8,4 +8,10 @@
'osmscout-test/PreprocessOLT.h'
]
-install_headers(osmscouttestHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscouttestHeader,
+ preserve_path: true)
+else
+ install_headers(osmscouttestHeader)
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout-test/meson.build
^
|
@@ -19,6 +19,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep],
link_with: [osmscout, osmscoutimport],
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/CMakeLists.txt
^
|
@@ -54,9 +54,46 @@
include/osmscout/WayDataFile.h
include/osmscout/CoreFeatures.h)
+set(HEADER_FILES_NAVIGATION
+ include/osmscout/navigation/Agents.h
+ include/osmscout/navigation/ArrivalEstimateAgent.h
+ include/osmscout/navigation/DataAgent.h
+ include/osmscout/navigation/PositionAgent.h
+ include/osmscout/navigation/RouteStateAgent.h
+ include/osmscout/navigation/Engine.h
+ include/osmscout/navigation/Navigation.h
+ include/osmscout/navigation/BearingAgent.h
+ include/osmscout/navigation/RouteInstructionAgent.h
+ include/osmscout/navigation/SpeedAgent.h
+ include/osmscout/navigation/VoiceInstructionAgent.h
+ include/osmscout/navigation/LaneAgent.h)
+
set(HEADER_FILES_OST
- include/osmscout/ost/Parser.h
- include/osmscout/ost/Scanner.h)
+ include/osmscout/ost/Parser.h
+ include/osmscout/ost/Scanner.h)
+
+set(HEADER_FILES_PROJECTION
+ include/osmscout/projection/Earth.h
+ include/osmscout/projection/MercatorProjection.h
+ include/osmscout/projection/Projection.h
+ include/osmscout/projection/TileProjection.h)
+
+set(HEADER_FILES_ROUTING
+ include/osmscout/routing/RouteData.h
+ include/osmscout/routing/RouteDescription.h
+ include/osmscout/routing/RouteNode.h
+ include/osmscout/routing/RouteNodeDataFile.h
+ include/osmscout/routing/RoutePostprocessor.h
+ include/osmscout/routing/RoutingDB.h
+ include/osmscout/routing/RoutingProfile.h
+ include/osmscout/routing/RoutingService.h
+ include/osmscout/routing/AbstractRoutingService.h
+ include/osmscout/routing/SimpleRoutingService.h
+ include/osmscout/routing/MultiDBRoutingService.h
+ include/osmscout/routing/DBFileOffset.h
+ include/osmscout/routing/TurnRestriction.h
+ include/osmscout/routing/MultiDBRoutingState.h
+ include/osmscout/routing/RouteDescriptionPostprocessor.h)
set(HEADER_FILES_SYSTEM
include/osmscout/system/Assert.h
@@ -79,6 +116,7 @@
include/osmscout/util/FileScanner.h
include/osmscout/util/FileWriter.h
include/osmscout/util/HTMLWriter.h
+ include/osmscout/util/LaneTurn.h
include/osmscout/util/Locale.h
include/osmscout/util/GeoBox.h
include/osmscout/util/Geometry.h
@@ -89,11 +127,11 @@
include/osmscout/util/Number.h
include/osmscout/util/NumberSet.h
include/osmscout/util/ObjectPool.h
+ include/osmscout/util/OpeningHours.h
include/osmscout/util/Parsing.h
include/osmscout/util/PolygonCenter.h
include/osmscout/util/ProcessingQueue.h
include/osmscout/util/Progress.h
- include/osmscout/util/Projection.h
include/osmscout/util/ScreenBox.h
include/osmscout/util/ScopeGuard.h
include/osmscout/util/StopClock.h
@@ -111,40 +149,13 @@
include/osmscout/util/utf8helper_charmap.h
)
-set(HEADER_FILES_ROUTING
- include/osmscout/routing/RouteData.h
- include/osmscout/routing/RouteDescription.h
- include/osmscout/routing/RouteNode.h
- include/osmscout/routing/RouteNodeDataFile.h
- include/osmscout/routing/RoutePostprocessor.h
- include/osmscout/routing/RoutingDB.h
- include/osmscout/routing/RoutingProfile.h
- include/osmscout/routing/RoutingService.h
- include/osmscout/routing/AbstractRoutingService.h
- include/osmscout/routing/SimpleRoutingService.h
- include/osmscout/routing/MultiDBRoutingService.h
- include/osmscout/routing/DBFileOffset.h
- include/osmscout/routing/TurnRestriction.h
- include/osmscout/routing/MultiDBRoutingState.h
- include/osmscout/routing/RouteDescriptionPostprocessor.h)
-
-set(HEADER_FILES_NAVIGATION
- include/osmscout/navigation/Agents.h
- include/osmscout/navigation/ArrivalEstimateAgent.h
- include/osmscout/navigation/DataAgent.h
- include/osmscout/navigation/PositionAgent.h
- include/osmscout/navigation/RouteStateAgent.h
- include/osmscout/navigation/Engine.h
- include/osmscout/navigation/Navigation.h
- include/osmscout/navigation/BearingAgent.h
- include/osmscout/navigation/RouteInstructionAgent.h
- include/osmscout/navigation/SpeedAgent.h
- include/osmscout/navigation/VoiceInstructionAgent.h
- include/osmscout/navigation/LaneAgent.h)
-
set(SOURCE_FILES
src/osmscout/ost/Parser.cpp
src/osmscout/ost/Scanner.cpp
+ src/osmscout/projection/Earth.cpp
+ src/osmscout/projection/MercatorProjection.cpp
+ src/osmscout/projection/Projection.cpp
+ src/osmscout/projection/TileProjection.cpp
src/osmscout/system/SSEMath.cpp
src/osmscout/util/Bearing.cpp
src/osmscout/util/Breaker.cpp
@@ -156,6 +167,7 @@
src/osmscout/util/FileScanner.cpp
src/osmscout/util/FileWriter.cpp
src/osmscout/util/HTMLWriter.cpp
+ src/osmscout/util/LaneTurn.cpp
src/osmscout/util/Locale.cpp
src/osmscout/util/GeoBox.cpp
src/osmscout/util/Geometry.cpp
@@ -165,10 +177,10 @@
src/osmscout/util/NodeUseMap.cpp
src/osmscout/util/Number.cpp
src/osmscout/util/NumberSet.cpp
+ src/osmscout/util/OpeningHours.cpp
src/osmscout/util/Parsing.cpp
src/osmscout/util/PolygonCenter.cpp
src/osmscout/util/Progress.cpp
- src/osmscout/util/Projection.cpp
src/osmscout/util/ScreenBox.cpp
src/osmscout/util/StopClock.cpp
src/osmscout/util/String.cpp
@@ -268,6 +280,7 @@
set(HEADER_FILES
${HEADER_FILES_ROOT}
${HEADER_FILES_OST}
+ ${HEADER_FILES_PROJECTION}
${HEADER_FILES_SYSTEM}
${HEADER_FILES_UTIL}
${HEADER_FILES_ROUTING}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/meson.build
^
|
@@ -4,6 +4,10 @@
'osmscout/CoreImportExport.h',
'osmscout/ost/Parser.h',
'osmscout/ost/Scanner.h',
+ 'osmscout/projection/Earth.h',
+ 'osmscout/projection/MercatorProjection.h',
+ 'osmscout/projection/Projection.h',
+ 'osmscout/projection/TileProjection.h',
'osmscout/system/Assert.h',
'osmscout/system/Compiler.h',
'osmscout/system/Math.h',
@@ -22,6 +26,7 @@
'osmscout/util/FileScanner.h',
'osmscout/util/FileWriter.h',
'osmscout/util/HTMLWriter.h',
+ 'osmscout/util/LaneTurn.h',
'osmscout/util/Locale.h',
'osmscout/util/GeoBox.h',
'osmscout/util/Geometry.h',
@@ -32,11 +37,11 @@
'osmscout/util/Number.h',
'osmscout/util/NumberSet.h',
'osmscout/util/ObjectPool.h',
+ 'osmscout/util/OpeningHours.h',
'osmscout/util/Parsing.h',
'osmscout/util/PolygonCenter.h',
'osmscout/util/ProcessingQueue.h',
'osmscout/util/Progress.h',
- 'osmscout/util/Projection.h',
'osmscout/util/ScopeGuard.h',
'osmscout/util/ScreenBox.h',
'osmscout/util/StopClock.h',
@@ -133,4 +138,9 @@
osmscoutHeader += ['osmscout/TextSearchIndex.h']
endif
-install_headers(osmscoutHeader)
+if meson.version().version_compare('>=0.63.0')
+ install_headers(osmscoutHeader,
+ preserve_path: true)
+else
+ install_headers(osmscoutHeader)
+endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/Database.h
^
|
@@ -84,10 +84,10 @@
private:
unsigned long areaAreaIndexCacheSize=5000;
- unsigned long nodeDataCacheSize=5000;
- unsigned long wayDataCacheSize=40000;
- unsigned long areaDataCacheSize=5000;
- unsigned long routeDataCacheSize=1500;
+ unsigned long nodeDataCacheSize=5'000;
+ unsigned long wayDataCacheSize=40'000;
+ unsigned long areaDataCacheSize=5'000;
+ unsigned long routeDataCacheSize=1'500;
bool routerDataMMap=true;
bool nodesDataMMap=true;
@@ -276,7 +276,7 @@
public:
friend Database;
- inline std::list<AreaRegionSearchResultEntry> GetAreaResults() const
+ std::list<AreaRegionSearchResultEntry> GetAreaResults() const
{
return areaResults;
}
@@ -356,12 +356,12 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=dataFile->GetByOffset(offsets.begin(), offsets.end(), offsets.size(), objects);
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving " << objects.size() << " " << typeName << " by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving " << objects.size() << " " << typeName << " by offset took " << runningTime.ResultString();
}
return result;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/GeoCoord.h
^
|
@@ -77,6 +77,11 @@
public:
using GeoCoordBuffer = std::array<std::byte,7>;
+ static constexpr int MinLatitude = -90;
+ static constexpr int MaxLatitude = 90;
+ static constexpr int MinLongitude = -180;
+ static constexpr int MaxLongitude = 180;
+
public:
/**
* The default constructor creates an uninitialized instance (for performance reasons).
@@ -195,6 +200,15 @@
}
/**
+ * Return true if latitude is in range <-90,+90> and longitude in range <-180,+180>
+ */
+ bool IsValid() const
+ {
+ return lat >= MinLatitude && lat <= MaxLatitude &&
+ lon >= MinLongitude && lon <= MaxLongitude;
+ }
+
+ /**
* Parse a textual representation of a geo coordinate from a string
* to an GeoCoord instance.
*
@@ -205,6 +219,7 @@
* coordinate may have one of these formats:
* DDD[.DDDDD]
* DD°[D[.DDD]'[D[.DDD]"]]
+ * DD°[D[.DDD]
*
* The means:
* * You first define the latitude, then the longitude value
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/ObjectRef.h
^
|
@@ -52,15 +52,36 @@
public:
ObjectOSMRef() = default;
ObjectOSMRef(const ObjectOSMRef& ref) = default;
+ ObjectOSMRef(ObjectOSMRef&& ref) = default;
ObjectOSMRef(OSMId id,
- OSMRefType type)
+ OSMRefType type)
: id(id),
type(type)
{
// no code
}
+ ~ObjectOSMRef() = default;
+
+ ObjectOSMRef& operator=(const ObjectOSMRef& other) = default;
+ ObjectOSMRef& operator=(ObjectOSMRef&& other) = default;
+
+ bool operator<(const ObjectOSMRef& reference) const
+ {
+ return std::tie(type, id) < std::tie(reference.type, reference.id);
+ }
+
+ bool operator==(const ObjectOSMRef& reference) const
+ {
+ return type==reference.type && id==reference.id;
+ }
+
+ bool operator!=(const ObjectOSMRef& reference) const
+ {
+ return type!=reference.type || id!=reference.id;
+ }
+
void Set(const OSMId& id,
const OSMRefType& type)
{
@@ -110,20 +131,6 @@
{
return type==osmRefRelation;
}
- bool operator<(const ObjectOSMRef& reference) const
- {
- return std::tie(type, id) < std::tie(reference.type, reference.id);
- }
-
- bool operator==(const ObjectOSMRef& reference) const
- {
- return type==reference.type && id==reference.id;
- }
-
- bool operator!=(const ObjectOSMRef& reference) const
- {
- return type!=reference.type || id!=reference.id;
- }
const char* GetTypeName() const;
};
@@ -149,17 +156,38 @@
public:
ObjectFileRef() = default;
ObjectFileRef(const ObjectFileRef& ref) = default;
+ ObjectFileRef(ObjectFileRef&& ref) = default;
ObjectFileRef(FileOffset offset,
- RefType type)
+ RefType type)
: offset(offset),
type(type)
{
// no code
}
+ ~ObjectFileRef() = default;
+
+ ObjectFileRef& operator=(const ObjectFileRef& other) = default;
+ ObjectFileRef& operator=(ObjectFileRef&& other) = default;
+
+ bool operator<(const ObjectFileRef& reference) const
+ {
+ return std::tie(type, offset) < std::tie(reference.type, reference.offset);
+ }
+
+ bool operator==(const ObjectFileRef& reference) const
+ {
+ return type==reference.type && offset==reference.offset;
+ }
+
+ bool operator!=(const ObjectFileRef& reference) const
+ {
+ return type!=reference.type || offset!=reference.offset;
+ }
+
void Set(const FileOffset& offset,
- const RefType& type)
+ const RefType& type)
{
this->offset=offset;
this->type=type;
@@ -208,21 +236,6 @@
return type==refArea;
}
- bool operator<(const ObjectFileRef& reference) const
- {
- return std::tie(type, offset) < std::tie(reference.type, reference.offset);
- }
-
- bool operator==(const ObjectFileRef& reference) const
- {
- return type==reference.type && offset==reference.offset;
- }
-
- bool operator!=(const ObjectFileRef& reference) const
- {
- return type!=reference.type || offset!=reference.offset;
- }
-
const char* GetTypeName() const;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/Pixel.h
^
|
@@ -104,6 +104,8 @@
std::array<double,2> coords;
public:
+ static const Vertex2D ZERO;
+
/**
* The default constructor creates an uninitialized instance (for performance reasons).
*/
@@ -122,23 +124,6 @@
Vertex2D& operator=(const Vertex2D& other) = default;
Vertex2D& operator=(Vertex2D&& other) = default;
- void SetX(double x)
- {
- coords[0]=x;
- }
-
- void SetY(double y)
- {
- coords[1]=y;
- }
-
- void Set(double x,
- double y)
- {
- coords[0]=x;
- coords[1]=y;
- }
-
double GetX() const
{
return coords[0];
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/TypeConfig.h
^
|
@@ -1037,7 +1037,7 @@
using FeatureValueBufferRef = std::shared_ptr<FeatureValueBuffer>;
- static const uint32_t FILE_FORMAT_VERSION = 24;
+ static const uint32_t FILE_FORMAT_VERSION = 25;
static const uint32_t FILE_FORMAT_MIN_VERSION = 19;
// Forward declaration
@@ -1104,6 +1104,7 @@
FeatureRef featureEmbankment;
FeatureRef featureRoundabout;
FeatureRef featureLanes;
+ FeatureRef featureOpeningHours;
public:
// Internal use (only available during preprocessing)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/TypeFeatures.h
^
|
@@ -28,6 +28,7 @@
#include <osmscout/TypeFeature.h>
#include <osmscout/util/Color.h>
+#include <osmscout/util/LaneTurn.h>
namespace osmscout {
@@ -1319,23 +1320,23 @@
class OSMSCOUT_API EleFeatureValue : public FeatureValue
{
private:
- uint32_t ele=0;
+ int16_t ele=0;
public:
EleFeatureValue() = default;
- explicit EleFeatureValue(uint32_t ele)
+ explicit EleFeatureValue(int16_t ele)
: ele(ele)
{
// no code
}
- void SetEle(uint32_t ele)
+ void SetEle(int16_t ele)
{
this->ele=ele;
}
- uint32_t GetEle() const
+ int16_t GetEle() const
{
return ele;
}
@@ -1883,8 +1884,8 @@
private:
uint8_t lanes=0; //!< First two bits reserved, 3 bit for number of lanes in each direction
- std::string turnForward;
- std::string turnBackward;
+ std::vector<LaneTurn> turnForward;
+ std::vector<LaneTurn> turnBackward;
std::string destinationForward;
std::string destinationBackward;
@@ -1921,19 +1922,19 @@
uint8_t GetLanes() const;
- void SetTurnLanes(const std::string& turnForward,
- const std::string& turnBawckard)
+ void SetTurnLanes(const std::vector<LaneTurn>& turnForward,
+ const std::vector<LaneTurn>& turnBackward)
{
this->turnForward=turnForward;
- this->turnBackward=turnBawckard;
+ this->turnBackward=turnBackward;
}
- std::string GetTurnForward() const
+ std::vector<LaneTurn> GetTurnForward() const
{
return turnForward;
}
- std::string GetTurnBackward() const
+ std::vector<LaneTurn> GetTurnBackward() const
{
return turnBackward;
}
@@ -1949,10 +1950,10 @@
}
void SetDestinationLanes(const std::string& destinationForward,
- const std::string& destinationBawckard)
+ const std::string& destinationBackward)
{
this->destinationForward=destinationForward;
- this->destinationBackward=destinationBawckard;
+ this->destinationBackward=destinationBackward;
}
std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
@@ -2307,6 +2308,76 @@
void Initialize(TagRegistry& tagRegistry) override;
std::string GetName() const override;
+
+ size_t GetValueAlignment() const override;
+ size_t GetValueSize() const override;
+ FeatureValue* AllocateValue(void* buffer) override;
+
+ void Parse(TagErrorReporter& reporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const override;
+ };
+
+ class OSMSCOUT_API OpeningHoursFeatureValue : public FeatureValue
+ {
+ private:
+ std::string value;
+
+ public:
+ OpeningHoursFeatureValue() = default;
+ OpeningHoursFeatureValue(const OpeningHoursFeatureValue& featureValue) = default;
+
+ explicit OpeningHoursFeatureValue(const std::string& value)
+ : value(value)
+ {
+ // no code
+ }
+
+ std::string GetValue() const
+ {
+ return value;
+ }
+
+ void SetValue(const std::string& value)
+ {
+ this->value=value;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return value;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ OpeningHoursFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API OpeningHoursFeature : public Feature
+ {
+ private:
+ TagId tagOpeningHours;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "opening hours" label */
+ static const char* const LABEL;
+
+ /** Index of the 'opening hours' label */
+ static const size_t LABEL_INDEX;
+
+ public:
+ OpeningHoursFeature();
+ void Initialize(TagRegistry& tagRegistry) override;
+
+ std::string GetName() const override;
size_t GetValueAlignment() const override;
size_t GetValueSize() const override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/Way.h
^
|
@@ -110,6 +110,10 @@
return featureValueBuffer;
}
+ bool IsValid() const {
+ return nodes.size()>=2;
+ }
+
bool IsCircular() const
{
return nodes[0].GetId()!=0 &&
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/navigation/LaneAgent.h
^
|
@@ -39,7 +39,7 @@
bool suggested{false};
int suggestedFrom{0};
int suggestedTo{0};
- std::vector<std::string> turns;
+ std::vector<LaneTurn> turns;
Lane() = default;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/navigation/SpeedAgent.h
^
|
@@ -52,7 +52,7 @@
Distance distance;
Timestamp::duration duration{Timestamp::duration::zero()};
- inline TrackSegment(const Distance &distance, const Timestamp::duration &duration):
+ TrackSegment(const Distance &distance, const Timestamp::duration &duration):
distance(distance), duration(duration)
{}
};
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/projection/Earth.h
^
|
@@ -0,0 +1,44 @@
+#ifndef OSMSCOUT_PROJECTION_EARTH_H
+#define OSMSCOUT_PROJECTION_EARTH_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/CoreImportExport.h>
+
+namespace osmscout {
+
+ /**
+ * Some general information regarding the earth
+ *
+ * To make the stack support other planets, too, one would have
+ * to define a interface base class, from which Earth inherits and
+ * implements the interface.
+ */
+ class OSMSCOUT_API Earth
+ {
+ public:
+ static const double radiusMeter;
+ //< Radius of the earth in meter
+ static const double extentMeter;
+ //< Extent of the earth in meter
+ };
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/projection/MercatorProjection.h
^
|
@@ -0,0 +1,185 @@
+#ifndef OSMSCOUT_UTIL_MERCATORPROJECTION_H
+#define OSMSCOUT_UTIL_MERCATORPROJECTION_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/CoreImportExport.h>
+
+#include <osmscout/projection/Projection.h>
+
+namespace osmscout {
+
+ /**
+ * Mercator projection that tries to render the resulting map in the same
+ * physical size on all devices. If the physical DPI of the device is
+ * correctly given, objects on any device has the same size. Bigger devices
+ * will show "more" map thus.
+ *
+ * Scale is calculated based on the assumption that the original OpenStreetMap
+ * tiles were designed for 96 DPI displays.
+ *
+ */
+ class OSMSCOUT_API MercatorProjection : public Projection
+ {
+ protected: // Because the OpenGLProjection inherits from this projection
+ bool valid=false; //!< projection is valid
+
+ double latOffset=0.0; //!< Absolute and untransformed screen position of lat coordinate
+ double angleSin=0.0;
+ double angleCos=0.0;
+ double angleNegSin=0.0;
+ double angleNegCos=0.0;
+
+ double scale=1.0;
+ double scaleGradtorad=0.0 ; //!< Precalculated scale*Gradtorad
+
+ double scaledLatDeriv=0.0; //!< precalculated derivation of "latToYPixel" function in projection
+ //!< center scaled by gradtorad * scale
+ bool useLinearInterpolation=false; //!< switch to enable linear interpolation of latitude to pixel computation
+
+ public:
+ static const double MaxLat;
+ static const double MinLat;
+ static const double MaxLon;
+ static const double MinLon;
+
+ MercatorProjection() = default;
+ MercatorProjection(const MercatorProjection&) = default;
+ MercatorProjection(MercatorProjection&&) = default;
+ MercatorProjection& operator=(const MercatorProjection&) = default;
+ MercatorProjection& operator=(MercatorProjection&&) = default;
+ ~MercatorProjection() override = default;
+
+ bool CanBatch() const override
+ {
+ return false;
+ }
+
+ bool IsValid() const override
+ {
+ return valid;
+ }
+
+ bool IsValidFor(const GeoCoord& coord) const override
+ {
+ return coord.GetLat() >= MinLat && coord.GetLat() <= MaxLat &&
+ coord.GetLon() >= MinLon && coord.GetLon() <= MaxLon;
+ }
+
+ bool Set(const GeoCoord& coord,
+ const Magnification& magnification,
+ size_t width,size_t height)
+ {
+ return Set(coord,0.0,magnification,GetDPI(),width,height);
+ }
+
+ bool Set(const GeoCoord& coord,
+ double angle,
+ const Magnification& magnification,
+ size_t width, size_t height)
+ {
+ return Set(coord,angle,magnification,GetDPI(),width,height);
+ }
+
+ bool Set(const GeoCoord& coord,
+ const Magnification& magnification,
+ double dpi,
+ size_t width, size_t height)
+ {
+ return Set(coord,0.0,magnification,dpi,width,height);
+ }
+
+ /**
+ * Setup projection parameters.
+ *
+ * Return true on success,
+ * false if arguments are not valid for Mercator projection,
+ * projection parameters are unchanged in such case.
+ *
+ * Angle is in radians ([0..2*PI[)
+ *
+ * Note that coord (center) have to be valid coordinate
+ * in Mercator projection. But it is possible setup dimensions
+ * (width and height) that projection will cover area bigger
+ * than the one valid for Mercator projection. Bounding box
+ * is adjusted then to be valid for projection.
+ *
+ * In code:
+ *
+ * projection.GetDimensions(bbox);
+ * projection.GeoToPixel(bbox.GetMinCoord(),x,y)
+ *
+ * may be x >= 0
+ */
+ bool Set(const GeoCoord& coord,
+ double angle,
+ const Magnification& magnification,
+ double dpi,
+ size_t width, size_t height);
+
+ bool PixelToGeo(double x, double y,
+ GeoCoord& coord) const override;
+
+ bool GeoToPixel(const GeoCoord& coord,
+ Vertex2D& pixel) const override;
+
+ bool Move(double horizPixel,
+ double vertPixel);
+
+ bool MoveUp(double pixel)
+ {
+ return Move(0,pixel);
+ }
+
+ bool MoveDown(double pixel)
+ {
+ return Move(0,-pixel);
+ }
+
+ bool MoveLeft(double pixel)
+ {
+ return Move(-pixel,0);
+ }
+
+ bool MoveRight(double pixel)
+ {
+ return Move(pixel,0);
+ }
+
+ [[nodiscard]] bool IsLinearInterpolationEnabled() const
+ {
+ return useLinearInterpolation;
+ }
+
+ /**
+ * Switch to enable/disable linear interpolation of latitude to pixel computation.
+ * It speedup GeoToPixel calculation with fractional error on small render area.
+ */
+ void SetLinearInterpolationUsage(bool useLinearInterpolation)
+ {
+ this->useLinearInterpolation=useLinearInterpolation;
+ }
+
+ protected:
+ void GeoToPixel(const BatchTransformer& transformData) const override;
+ };
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/projection/Projection.h
^
|
@@ -0,0 +1,345 @@
+#ifndef OSMSCOUT_UTIL_PROJECTION_H
+#define OSMSCOUT_UTIL_PROJECTION_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/CoreImportExport.h>
+
+#include <osmscout/GeoCoord.h>
+#include <osmscout/Pixel.h>
+#include <osmscout/Point.h>
+
+#include <osmscout/util/GeoBox.h>
+#include <osmscout/util/Magnification.h>
+#include <osmscout/util/ScreenBox.h>
+
+#include <osmscout/system/SSEMathPublic.h>
+
+namespace osmscout {
+
+ /**
+ * \ingroup Geometry
+ *
+ * The Projection class is an abstract base class for multiple projection implementations.
+ *
+ * The Projection class allows transformation of geo coordinates to screen/image coordinates and
+ * screen/image coordinates back to geo coordinates.
+ */
+ class OSMSCOUT_API Projection
+ {
+ protected:
+ GeoCoord center; //!< Coordinate of the center of the displayed area
+ double angle=0.0; //!< Display rotation angle in radians, canvas clockwise
+ Magnification magnification; //!< Current magnification
+ double dpi=0.0; //!< Screen DPI
+ size_t width=0; //!< Width of image
+ size_t height=0; //!< Height of image
+
+ GeoBox boundingBox; //!< Bounding box of the current projection on the ground
+
+ double pixelSize=0.0; //!< Size of a pixel in meter
+ double meterInPixel=0.0; //!< Number of on screen pixel for one meter on the ground
+ double meterInMM=0.0; //!< Number of on screen millimeters for one meter on the ground
+
+ public:
+
+ /**
+ * This class is used to hide internal complexity concerned with batching GeoToPixel calls
+ */
+ class BatchTransformer CLASS_FINAL
+ {
+ public:
+ // this should be private, but that would exclude future projection
+ // implementors. I don't know a nice way to handle this
+ const Projection& projection;
+#ifdef OSMSCOUT_HAVE_SSE2
+ int count=0;
+ ALIGN16_BEG double lon[2] ALIGN16_END;
+ ALIGN16_BEG double lat[2] ALIGN16_END;
+ double* xPointer[2]={nullptr,nullptr};
+ double* yPointer[2]={nullptr,nullptr};
+#endif
+
+ public:
+ explicit BatchTransformer(const Projection& projection)
+ : projection(projection)
+ {
+ }
+
+ BatchTransformer(const BatchTransformer& other) = delete;
+ BatchTransformer(BatchTransformer&& other) = delete;
+
+ ~BatchTransformer()
+ {
+ Flush();
+ }
+
+ BatchTransformer& operator=(const BatchTransformer& other) = delete;
+ BatchTransformer& operator=(BatchTransformer&& other) = delete;
+
+ void GeoToPixel(const GeoCoord& coord,
+ double& x,
+ double& y)
+ {
+#ifdef OSMSCOUT_HAVE_SSE2
+ if (projection.CanBatch()) {
+ this->lon[count]=coord.GetLon();
+ this->lat[count]=coord.GetLat();
+ xPointer[count]=&x;
+ yPointer[count]=&y;
+ count++;
+
+ if (count==2) {
+ count=0;
+ projection.GeoToPixel(*this);
+ }
+ }
+ else {
+ Vertex2D pixel;
+ projection.GeoToPixel(coord,
+ pixel);
+ x=pixel.GetX();
+ y=pixel.GetY();
+ }
+#else
+ Vertex2D pixel;
+ projection.GeoToPixel(coord,
+ pixel);
+ x=pixel.GetX();
+ y=pixel.GetY();
+#endif
+ }
+
+ void GeoToPixel(const Point& coord,
+ double& x,
+ double& y)
+ {
+#ifdef OSMSCOUT_HAVE_SSE2
+ if (projection.CanBatch()) {
+ this->lon[count]=coord.GetCoord().GetLon();
+ this->lat[count]=coord.GetCoord().GetLat();
+ xPointer[count]=&x;
+ yPointer[count]=&y;
+ count++;
+
+ if (count==2) {
+ count=0;
+ projection.GeoToPixel(*this);
+ }
+ }
+ else {
+ Vertex2D pixel;
+ projection.GeoToPixel(coord.GetCoord(),
+ pixel);
+ x=pixel.GetX();
+ y=pixel.GetY();
+ }
+#else
+ Vertex2D pixel;
+ projection.GeoToPixel(coord.GetCoord(),
+ pixel);
+ x=pixel.GetX();
+ y=pixel.GetY();
+#endif
+ }
+
+ void Flush()
+ {
+#ifdef OSMSCOUT_HAVE_SSE2
+ if (count!=0) {
+ count=0;
+ Vertex2D pixel;
+ projection.GeoToPixel(GeoCoord(lat[0],
+ lon[0]),
+ pixel);
+
+ *xPointer[0]=pixel.GetX();
+ *yPointer[0]=pixel.GetY();
+ }
+#endif
+ }
+ };
+
+ Projection() = default;
+ Projection(const Projection&) = default;
+ Projection(Projection&&) = default;
+ Projection& operator=(const Projection&) = default;
+ Projection& operator=(Projection&&) = default;
+ virtual ~Projection() = default;
+
+ virtual bool CanBatch() const = 0;
+ virtual bool IsValid() const = 0;
+
+ /**
+ * Return true if given coordinate is valid for this projection
+ */
+ virtual bool IsValidFor(const GeoCoord& coord) const = 0;
+
+ [[nodiscard]] GeoCoord GetCenter() const
+ {
+ return center;
+ }
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/projection/TileProjection.h
^
|
@@ -0,0 +1,137 @@
+#ifndef OSMSCOUT_UTIL_TILEPROJECTION_H
+#define OSMSCOUT_UTIL_TILEPROJECTION_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/CoreImportExport.h>
+
+#include <osmscout/projection/Projection.h>
+
+#include <osmscout/util/Tiling.h>
+
+namespace osmscout {
+
+ /**
+ * Mercator projection as used by the OpenStreetMap tile rendering code.
+ *
+ * The TileProjection simplifies the general Mercator projection code to
+ * make sure that there are no effects based on rounding errors or similar.
+ */
+ class OSMSCOUT_API TileProjection : public Projection
+ {
+ private:
+ bool valid=false; //!< projection is valid
+
+ double lonOffset=0.0;
+ double latOffset=0.0;
+ double scale=1.0;
+ double scaleGradtorad=0.0; //!< Precalculated scale*Gradtorad
+
+ double scaledLatDeriv=0.0; //!< precalculated derivation of "latToYPixel" function in projection
+ //!< center scaled by gradtorad * scale
+ bool useLinearInterpolation=false; //!< switch to enable linear interpolation of latitude to pixel computation
+
+#ifdef OSMSCOUT_HAVE_SSE2
+ //some extra vars for special sse needs
+ v2df sse2LonOffset;
+ v2df sse2LatOffset;
+ v2df sse2Scale;
+ v2df sse2ScaleGradtorad;
+ v2df sse2Height;
+#endif
+
+ protected:
+ virtual bool SetInternal(const GeoBox& boundingBox,
+ const Magnification& magnification,
+ double dpi,
+ size_t width,size_t height);
+
+ public:
+ TileProjection() = default;
+ TileProjection(const TileProjection&) = default;
+ TileProjection(TileProjection&&) = default;
+ TileProjection& operator=(const TileProjection&) = default;
+ TileProjection& operator=(TileProjection&&) = default;
+ ~TileProjection() override = default;
+
+ bool CanBatch() const override
+ {
+ return true;
+ }
+
+ bool IsValid() const override
+ {
+ return valid;
+ }
+
+ bool IsValidFor(const GeoCoord& coord) const override
+ {
+ return coord.GetLat() >= -85.0511 && coord.GetLat() <= +85.0511 &&
+ coord.GetLon() >= -180.0 && coord.GetLon() <= +180.0;
+ }
+
+ bool Set(const OSMTileId& tile,
+ const Magnification& magnification,
+ size_t width, size_t height)
+ {
+ return Set(tile,
+ magnification,
+ GetDPI(),
+ width,
+ height);
+ }
+
+ bool Set(const OSMTileId& tile,
+ const Magnification& magnification,
+ double dpi,
+ size_t width, size_t height);
+
+ bool Set(const OSMTileIdBox& tileBox,
+ const Magnification& magnification,
+ double dpi,
+ size_t width, size_t height);
+
+ bool PixelToGeo(double x, double y,
+ GeoCoord& coord) const override;
+
+ bool GeoToPixel(const GeoCoord& coord,
+ Vertex2D& pixel) const override;
+
+ [[nodiscard]] bool IsLinearInterpolationEnabled() const
+ {
+ return useLinearInterpolation;
+ }
+
+ /**
+ * Switch to enable/disable linear interpolation of latitude to pixel computation.
+ * It speedup GeoToPixel calculation with fractional error on small render area.
+ */
+ void SetLinearInterpolationUsage(bool b)
+ {
+ useLinearInterpolation = b;
+ }
+
+ protected:
+
+ void GeoToPixel(const BatchTransformer& transformData) const override;
+ };
+}
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/AbstractRoutingService.h
^
|
@@ -248,9 +248,8 @@
virtual bool GetAreasByOffset(const std::set<DBFileOffset> &areaOffsets,
std::unordered_map<DBFileOffset,AreaRef> &areaMap) = 0;
- void ResolveRNodeChainToList(DBId finalRouteNode,
+ void ResolveRNodeChainToList(const RNode &finalRouteNode,
const ClosedSet& closedSet,
- const ClosedSet& closedRestrictedSet,
std::list<VNode>& nodes);
virtual bool ResolveRouteDataJunctions(RouteData& route) = 0;
@@ -341,8 +340,7 @@
RouteNodeRef ¤tRouteNode,
OpenList &openList,
OpenMap &openMap,
- const ClosedSet &closedSet,
- const ClosedSet &closedRestrictedSet);
+ const ClosedSet &closedSet);
virtual bool WalkPaths(const RoutingState& state,
RNodeRef ¤t,
@@ -350,7 +348,6 @@
OpenList &openList,
OpenMap &openMap,
ClosedSet &closedSet,
- ClosedSet &closedRestrictedSet,
RoutingResult &result,
const RoutingParameter& parameter,
const GeoCoord &targetCoord,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RouteDescription.h
^
|
@@ -32,6 +32,7 @@
#include <osmscout/GeoCoord.h>
#include <osmscout/routing/DBFileOffset.h>
#include <osmscout/util/Distance.h>
+#include <osmscout/util/LaneTurn.h>
#include <osmscout/util/Time.h>
namespace osmscout {
@@ -593,19 +594,14 @@
* turns in lanes from left one (drivers view)
* vector size may be less than laneCount, even empty
*
- * usual variants:
- * left, slight_left, merge_to_left,
- * through;left, through;slight_left, through;sharp_left,
- * through,
- * through;right, through;slight_right, through;sharp_right,
- * right, slight_right, merge_to_right
+ * @see LanesFeatureValue::LaneTurn
*/
- std::vector<std::string> laneTurns;
+ std::vector<LaneTurn> laneTurns;
public:
LaneDescription(bool oneway,
uint8_t laneCount,
- const std::vector<std::string> &laneTurns);
+ const std::vector<LaneTurn> &laneTurns);
std::string GetDebugString() const override;
@@ -619,7 +615,7 @@
return laneCount;
}
- const std::vector<std::string>& GetLaneTurns() const
+ const std::vector<LaneTurn>& GetLaneTurns() const
{
return laneTurns;
}
@@ -769,7 +765,7 @@
DescriptionRef GetDescription(const char* name) const;
void SetDistance(Distance distance);
- void SetTime(const Timestamp::duration &time);
+ void SetTime(const Timestamp::duration &duration);
void SetLocation(const GeoCoord &coord);
void AddDescription(const char* name,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RouteNode.h
^
|
@@ -100,7 +100,6 @@
Id id; //!< id of the targeting route node
uint8_t objectIndex; //!< The index of the way to use from this route node to the target route node
uint8_t flags; //!< Certain flags
- //uint8_t bearing; //!< Encoded initial and final bearing of this path
bool IsRestricted(Vehicle vehicle) const
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RoutePostprocessor.h
^
|
@@ -239,6 +239,7 @@
ObjectFileRef ref;
size_t node;
Bearing bearing;
+ bool canBeUsedAsExit;
};
private:
@@ -274,9 +275,16 @@
bool HandleDirectionChange(const RoutePostprocessor& postprocessor,
const std::list<RouteDescription::Node>::iterator& node,
const std::list<RouteDescription::Node>::const_iterator& end);
+ std::vector<NodeExit> CollectNodeWays(const RoutePostprocessor& postprocessor,
+ RouteDescription::Node& node,
+ bool exitsOnly);
+
// just ways are supported as exits
- std::vector<NodeExit> CollectNodeExits(const RoutePostprocessor& postprocessor,
- RouteDescription::Node& node);
+ inline std::vector<NodeExit> CollectNodeExits(const RoutePostprocessor& postprocessor,
+ RouteDescription::Node& node)
+ {
+ return CollectNodeWays(postprocessor, node, true);
+ }
public:
bool Process(const RoutePostprocessor& postprocessor,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RoutingProfile.h
^
|
@@ -84,7 +84,7 @@
void SetupValues()
{
double speedVal=0;
- for (size_t i=0; i<5; i++){
+ for (size_t i=0; i<5; ++i){
if (std::isnan(speed[i])){
speed[i]=speedVal;
} else {
@@ -117,7 +117,7 @@
class OSMSCOUT_API RoutingProfile
{
public:
- virtual ~RoutingProfile();
+ virtual ~RoutingProfile() = default;
virtual Vehicle GetVehicle() const = 0;
virtual Distance GetCostLimitDistance() const = 0;
@@ -286,13 +286,13 @@
bool CanUseBackward(const Way& way) const override;
Duration GetTime(const Area& area,
- const Distance &distance) const override
+ const Distance& distance) const override
{
return GetTime2(area,distance);
}
Duration GetTime(const Way& way,
- const Distance &distance) const override
+ const Distance& distance) const override
{
return GetTime2(way,distance);
}
@@ -488,15 +488,15 @@
double GetCosts(const Area& area,
const Distance &distance) const override
{
- auto time=GetTime2(area,distance);
- return std::chrono::duration_cast<HourDuration>(time).count();
+ auto duration=GetTime2(area,distance);
+ return std::chrono::duration_cast<HourDuration>(duration).count();
}
double GetCosts(const Way& way,
const Distance &distance) const override
{
- auto time=GetTime2(way,distance);
- return std::chrono::duration_cast<HourDuration>(time).count();
+ auto duration=GetTime2(way,distance);
+ return std::chrono::duration_cast<HourDuration>(duration).count();
}
double GetCosts(const Distance &distance) const override
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RoutingService.h
^
|
@@ -219,16 +219,22 @@
*/
struct RNode
{
- DBId id; //!< The file offset of the current route node
- RouteNodeRef node; //!< The current route node
- DBId prev; //!< The file offset of the previous route node
- ObjectFileRef object; //!< The object (way/area) visited from the current route node
-
- double currentCost=0; //!< The cost of the current up to the current node
- double estimateCost=0; //!< The estimated cost from here to the target
- double overallCost=0; //!< The overall costs (currentCost+estimateCost)
+ DBId id; //!< The file offset of the current route node
+ RouteNodeRef node; //!< The current route node
+ DBId prev; //!< The file offset of the previous route node
+ bool prevRestricted=false; //!< previous node is restricted
+ ObjectFileRef object; //!< The object (way/area) visited from the current route node
+
+ double currentCost=0; //!< The cost of the current up to the current node
+ double estimateCost=0; //!< The estimated cost from here to the target
+ double overallCost=0; //!< The overall costs (currentCost+estimateCost)
- bool access=true; //!< Flags to signal, if we had access ("access restrictions") to this node
+ bool restricted=true; //!< Flag to signal, if access to this node is restricted ("access restrictions")
+
+ /** Flag signaling that we may leave restricted area, because it was start of route.
+ * Flag is disabled when we leave to non-restricted way.
+ */
+ bool leaveRestricted=false;
RNode() = default;
@@ -245,10 +251,12 @@
RNode(const DBId& id,
const RouteNodeRef& node,
const ObjectFileRef& object,
- const DBId& prev)
+ const DBId& prev,
+ bool prevRestricted)
: id(id),
node(node),
prev(prev),
+ prevRestricted(prevRestricted),
object(object)
{
// no code
@@ -270,7 +278,7 @@
struct RNodeCostCompare
{
bool operator()(const RNodeRef& a,
- const RNodeRef& b) const
+ const RNodeRef& b) const
{
if (a->overallCost==b->overallCost) {
return a->id<b->id;
@@ -290,12 +298,21 @@
*
* From the VNode list from the last routing node back to the start
* the route is recalculated by following the previousNode chain.
+ *
+ * Some routing nodes may be accessed from two different ways
+ * - one without any access restriction (!currentRestricted)
+ * and second with restriction (currentRestricted)
+ *
+ * Restricted way (access=destination) is a way that may be used just
+ * in case when start or target is on this way (area of ways).
*/
struct VNode
{
- DBId currentNode; //!< FileOffset of this route node
- DBId previousNode; //!< FileOffset of the previous route node
- ObjectFileRef object; //!< The object (way/area) visited from the current route node
+ DBId currentNode; //!< FileOffset of this route node
+ bool currentRestricted=false; //!< Current node is accessed from restricted way
+ DBId previousNode; //!< FileOffset of the previous route node
+ bool previousRestricted=false; //!< Previous node was accessed from restricted way
+ ObjectFileRef object; //!< The object (way/area) visited from the current route node
/**
* Equality operator
@@ -307,7 +324,7 @@
*/
bool operator==(const VNode& other) const
{
- return currentNode==other.currentNode;
+ return currentNode==other.currentNode && currentRestricted==other.currentRestricted;
}
/**
@@ -317,8 +334,8 @@
* @param currentNode
* Offset of the node to search for
*/
- explicit VNode(const DBId& currentNode)
- : currentNode(currentNode)
+ explicit VNode(const DBId& currentNode, bool currentRestricted)
+ : currentNode(currentNode), currentRestricted(currentRestricted)
{
// no code
}
@@ -334,10 +351,14 @@
* FileOffset of the previous route node visited
*/
VNode(const DBId& currentNode,
+ bool currentRestricted,
const ObjectFileRef& object,
- const DBId& previousNode)
+ const DBId& previousNode,
+ bool previousRestricted)
: currentNode(currentNode),
+ currentRestricted(currentRestricted),
previousNode(previousNode),
+ previousRestricted(previousRestricted),
object(object)
{
// no code
@@ -353,7 +374,8 @@
size_t operator()(const VNode& node) const
{
return std::hash<Id>()(node.currentNode.id) ^
- std::hash<DatabaseId>()(node.currentNode.database);
+ std::hash<DatabaseId>()(node.currentNode.database) ^
+ std::hash<bool>()(node.currentRestricted);
}
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/system/Math.h
^
|
@@ -22,4 +22,8 @@
#include <cmath>
+namespace osmscout {
+ static const double gradtorad=2*M_PI/360.0;
+}
+
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/FileScanner.h
^
|
@@ -206,6 +206,11 @@
void Close();
void CloseFailsafe();
+ uint32_t GetFileFormatVersion() const
+ {
+ return fileFormatVersion;
+ }
+
bool IsOpen() const
{
return file!=nullptr;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/GeoBox.h
^
|
@@ -62,6 +62,16 @@
GeoBox(const GeoCoord& coordA,
const GeoCoord& coordB);
+ bool operator==(const GeoBox& other) const {
+ return GetMinCoord()==other.GetMinCoord() &&
+ GetMaxCoord()== other.GetMaxCoord();
+ }
+
+ bool operator!=(const GeoBox& other) const {
+ return GetMinCoord()!=other.GetMinCoord() ||
+ GetMaxCoord()!= other.GetMaxCoord();
+ }
+
/**
* Invalidate the bounding Box
*/
@@ -99,8 +109,9 @@
* @return
* True, if there is intersection, else false.
*/
- template<typename P> bool Includes(const P& coord,
- bool openInterval=true) const
+ template<typename P>
+ bool Includes(const P& coord,
+ bool openInterval=true) const
{
if (!valid){
return false;
@@ -131,7 +142,7 @@
*
*/
bool Intersects(const GeoBox& other,
- bool openInterval=true) const
+ bool openInterval=true) const
{
if (!valid || !other.valid) {
return false;
@@ -158,6 +169,12 @@
GeoBox Intersection(const GeoBox& other) const;
/**
+ * Create new GeoBox to is cropped to the bounds of the passed geo box
+ * @param other
+ */
+ GeoBox CropTo(const GeoBox& other) const;
+
+ /**
* Returns true, if the GeoBox instance is valid. This means there were
* values assigned to the box. While being valid, the rectangle spanned by
* the coordinate might still be degraded.
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/LaneTurn.h
^
|
@@ -0,0 +1,71 @@
+#ifndef OSMSCOUT_UTIL_LANE_TURN_H
+#define OSMSCOUT_UTIL_LANE_TURN_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <cstddef>
+#include <string>
+
+#include <osmscout/CoreImportExport.h>
+
+namespace osmscout {
+
+ /**
+ * \defgroup LaneTurn lane turn helpers
+ *
+ * Collection of utilities for dealing with route lane turn variants.
+ */
+
+ /**
+ * \ingroup LaneTurn
+ *
+ * Common lane turn variants.
+ *
+ * Note: Numeric values of variants are used for database serialization,
+ * do not change them without increasing database format version.
+ * Just append new variants to the end.
+ *
+ * Note: There is no need to export Enums
+ */
+ enum class LaneTurn: std::uint8_t {
+ Null = 0,
+ None = 1,
+ Left = 2,
+ MergeToLeft = 3,
+ SlightLeft = 4,
+ SharpLeft = 5,
+ Through_Left = 6,
+ Through_SlightLeft = 7,
+ Through_SharpLeft = 8,
+ Through = 9,
+ Through_Right = 10,
+ Through_SlightRight = 11,
+ Through_SharpRight = 12,
+ Right = 13,
+ MergeToRight = 14,
+ SlightRight = 15,
+ SharpRight = 16,
+ Unknown = 17,
+ };
+
+ std::string OSMSCOUT_API LaneTurnString(LaneTurn turn);
+}
+
+#endif //OSMSCOUT_UTIL_LANE_TURN_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/OpeningHours.h
^
|
@@ -0,0 +1,101 @@
+#ifndef OSMSCOUT_OPENINGHOURS_H
+#define OSMSCOUT_OPENINGHOURS_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/CoreImportExport.h>
+
+#include <cstdint>
+#include <vector>
+#include <string>
+#include <optional>
+
+namespace osmscout {
+
+ /** Utility for parsing simple OpenStreetMap opening hours.
+ * see https://wiki.openstreetmap.org/wiki/Key:opening_hours
+ */
+ class OSMSCOUT_API OpeningHours
+ {
+ public:
+ /** Day of the week in the Gregorian calendar.
+ * And special entries for holidays.
+ */
+ enum class WeekDay
+ {
+ Monday = 0,
+ Tuesday,
+ Wednesday,
+ Thursday,
+ Friday,
+ Saturday,
+ Sunday,
+ PublicHoliday,
+ SchoolHoliday
+ };
+
+ struct DayTime
+ {
+ uint8_t hour=0; //!< 24 hour hour format. May be bigger than 24, when opened even after midnight (26 = 2 hours after midnight next day).
+ uint8_t minute=0;
+ };
+
+ struct TimeInterval
+ {
+ DayTime from;
+ DayTime to;
+ };
+
+ struct Rule
+ {
+ WeekDay day=WeekDay::Monday;
+ std::vector<TimeInterval> intervals; //!< Closed when empty
+ };
+
+ private:
+ std::vector<Rule> rules;
+
+ public:
+ explicit OpeningHours(std::vector<Rule> rules);
+ OpeningHours(const OpeningHours&) = default;
+ OpeningHours(OpeningHours&&) = default;
+
+ ~OpeningHours() = default;
+
+ OpeningHours& operator=(const OpeningHours&) = default;
+ OpeningHours& operator=(OpeningHours&&) = default;
+
+ std::vector<Rule> GetRules() const
+ {
+ return rules;
+ }
+
+ /** Parse OSM opening hours string
+ *
+ * @param str
+ * @param explicitClosedDays explicitly add empty rule for week days when is closed
+ * @return
+ */
+ static std::optional<OpeningHours> Parse(const std::string &str, bool explicitClosedDays=false);
+ };
+
+}
+
+#endif //OSMSCOUT_OPENINGHOURS_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/ScreenBox.h
^
|
@@ -41,6 +41,7 @@
Vertex2D maxCoord=Vertex2D(0.0,0.0);
public:
+ static const ScreenBox EMPTY;
/**
* The default constructor creates an invalid instance.
*/
@@ -52,33 +53,38 @@
ScreenBox(const ScreenBox& other) = default;
/**
+ * Initialize the GeoBox based on the given coordinates. The two Coordinates
+ * together span a rectangular (in coordinates, not on the sphere) area.
+ */
+ ScreenBox(const Vertex2D& coordA,
+ const Vertex2D& coordB);
+
+ /**
* Assign the value of other
*/
ScreenBox& operator=(const ScreenBox& other) = default;
/**
- * Initialize the GeoBox based on the given coordinates. The two Coordinates
- * together span a rectangular (in coordinates, not on the sphere) area.
+ * Compare two values
*/
- ScreenBox(const Vertex2D& coordA,
- const Vertex2D& coordB);
+ bool operator==(const ScreenBox& other) const;
- double GetMinX() const
+ [[nodiscard]] double GetMinX() const
{
return minCoord.GetX();
}
- double GetMinY() const
+ [[nodiscard]] double GetMinY() const
{
return minCoord.GetY();
}
- double GetMaxX() const
+ [[nodiscard]] double GetMaxX() const
{
return maxCoord.GetX();
}
- double GetMaxY() const
+ [[nodiscard]] double GetMaxY() const
{
return maxCoord.GetY();
}
@@ -86,7 +92,7 @@
/**
* Returns the width of the bounding box (maxLon-minLon).
*/
- double GetWidth() const
+ [[nodiscard]] double GetWidth() const
{
return maxCoord.GetX()-minCoord.GetX();
}
@@ -94,7 +100,7 @@
/**
* Returns the height of the bounding box (maxLat-minLat).
*/
- double GetHeight() const
+ [[nodiscard]] double GetHeight() const
{
return maxCoord.GetY()-minCoord.GetY();
}
@@ -103,13 +109,29 @@
* Returns the center coordinates of the box
* @return the center coordinates
*/
- Vertex2D GetCenter() const
+ [[nodiscard]] Vertex2D GetCenter() const
{
return {(minCoord.GetX()+maxCoord.GetX())/2,
(minCoord.GetY()+maxCoord.GetY())/2};
}
- ScreenBox Merge(const ScreenBox& other) const;
+ [[nodiscard]] bool Intersects(const ScreenBox& other) const;
+ [[nodiscard]] bool Intersects(const ScreenBox& other,
+ bool openInterval) const;
+
+ /**
+ * Resize the rectangle in all dimension using the given amount.
+ * If pixel is >=0 the resulting area will be bigger, else smaller.
+ *
+ * It is checked that pixel>=width/2 and pixel >=height/2
+ *
+ * The size delta will be 2*pixel in width and in height!
+ *
+ * @param offset the amount to change the coordinates.
+ * @return the resulting ScreenBox
+ */
+ [[nodiscard]] ScreenBox Resize(double offset) const;
+ [[nodiscard]] ScreenBox Merge(const ScreenBox& other) const;
};
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/StopClock.h
^
|
@@ -57,10 +57,10 @@
std::string ResultString() const;
- friend OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClock& clock);
+ friend OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClock& stopClock);
};
- extern OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClock& clock);
+ extern OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClock& stopClock);
/**
* Copy of the StopClock implementation but using a high_resolution timer
@@ -85,10 +85,10 @@
std::string ResultString() const;
- friend OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClockNano& clock);
+ friend OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClockNano& stopClock);
};
- extern OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClockNano& clock);
+ extern OSMSCOUT_API std::ostream& operator<<(std::ostream& stream, const StopClockNano& stopClock);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/String.h
^
|
@@ -316,7 +316,7 @@
*
* \note when stringList is empty, result is empty list
* \note separator must not be empty
- * \note when string ends with separator, last (empty) element is omited
+ * \note when string ends with separator, last (empty) element is omitted
* \note when maxSize is negative, list will contains all elements
*/
extern OSMSCOUT_API std::list<std::string> SplitString(const std::string& stringList,
@@ -332,7 +332,7 @@
* Returns the first entry in the list
*
* \note stringList must not be empty
- * \note at least one devider must be given
+ * \note at least one divider must be given
*/
extern OSMSCOUT_API std::string GetFirstInStringList(const std::string& stringList,
const std::string& divider);
@@ -540,6 +540,11 @@
extern OSMSCOUT_API std::string TimestampToISO8601TimeString(const Timestamp ×tamp);
extern OSMSCOUT_API std::string DurationString(const Duration &duration);
+
+ /**
+ * Trim trimmedChar from begin and end of str.
+ */
+ extern OSMSCOUT_API std::string Trim(const std::string &str, char trimmedChar=' ');
}
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/Transformation.h
^
|
@@ -24,9 +24,10 @@
#include <osmscout/CoreImportExport.h>
+#include <osmscout/projection/Projection.h>
+
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Logger.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/system/Assert.h>
#include <osmscout/system/Math.h>
@@ -353,12 +354,11 @@
/**
* Push coordinate to the buffer.
*
- * @param x
- * @param y
+ * @param coord
* @return position (index) of the new coordinate coordinate in the buffer
* @note x and y have to be valid, NaN is not allowed
*/
- size_t PushCoord(double x, double y);
+ size_t PushCoord(const Vertex2D& coord);
/**
* Generate parallel way to way stored in this buffer on range orgStart, orgEnd (inclusive)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/meson.build
^
|
@@ -29,6 +29,7 @@
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, openmpDep, iconvDep, marisaDep],
link_args: link_args,
+ version: libraryVersion,
install: true)
# TODO: Generate PKG_CONFIG file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/meson.build
^
|
@@ -2,6 +2,10 @@
osmscoutSrc = [
'src/osmscout/ost/Parser.cpp',
'src/osmscout/ost/Scanner.cpp',
+ 'src/osmscout/projection/Earth.cpp',
+ 'src/osmscout/projection/MercatorProjection.cpp',
+ 'src/osmscout/projection/Projection.cpp',
+ 'src/osmscout/projection/TileProjection.cpp',
'src/osmscout/system/SSEMath.cpp',
'src/osmscout/util/Breaker.cpp',
'src/osmscout/util/Bearing.cpp',
@@ -14,6 +18,7 @@
'src/osmscout/util/FileScanner.cpp',
'src/osmscout/util/FileWriter.cpp',
'src/osmscout/util/HTMLWriter.cpp',
+ 'src/osmscout/util/LaneTurn.cpp',
'src/osmscout/util/Locale.cpp',
'src/osmscout/util/GeoBox.cpp',
'src/osmscout/util/Geometry.cpp',
@@ -23,10 +28,10 @@
'src/osmscout/util/NodeUseMap.cpp',
'src/osmscout/util/Number.cpp',
'src/osmscout/util/NumberSet.cpp',
+ 'src/osmscout/util/OpeningHours.cpp',
'src/osmscout/util/Parsing.cpp',
'src/osmscout/util/PolygonCenter.cpp',
'src/osmscout/util/Progress.cpp',
- 'src/osmscout/util/Projection.cpp',
'src/osmscout/util/ScreenBox.cpp',
'src/osmscout/util/StopClock.cpp',
'src/osmscout/util/String.cpp',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/Database.cpp
^
|
@@ -717,14 +717,14 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=nodeDataFile->GetByOffset(offset,node);
- time.Stop();
+ runningTime.Stop();
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving 1 node by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving 1 node by offset took " << runningTime.ResultString();
}
return result;
@@ -739,14 +739,14 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=nodeDataFile->GetByOffset(offsets.begin(),offsets.end(),offsets.size(),nodes);
- time.Stop();
+ runningTime.Stop();
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << runningTime.ResultString();
}
return result;
@@ -762,7 +762,7 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=nodeDataFile->GetByOffset(offsets.begin(),
offsets.end(),
@@ -770,10 +770,10 @@
boundingBox,
nodes);
- time.Stop();
+ runningTime.Stop();
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << runningTime.ResultString();
}
return result;
@@ -788,14 +788,14 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=nodeDataFile->GetByOffset(offsets.begin(),offsets.end(),offsets.size(),nodes);
- time.Stop();
+ runningTime.Stop();
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << runningTime.ResultString();
}
return result;
@@ -810,14 +810,14 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=nodeDataFile->GetByOffset(offsets.begin(),offsets.end(),offsets.size(),nodes);
- time.Stop();
+ runningTime.Stop();
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving " << nodes.size() << " nodes by offset took " << runningTime.ResultString();
}
return result;
@@ -832,17 +832,17 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=nodeDataFile->GetByOffset(offsets.begin(),
offsets.end(),
offsets.size(),
dataMap);
- time.Stop();
+ runningTime.Stop();
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving " << dataMap.size() << " nodes by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving " << dataMap.size() << " nodes by offset took " << runningTime.ResultString();
}
return result;
@@ -857,14 +857,14 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=areaDataFile->GetByOffset(offset,area);
- time.Stop();
+ runningTime.Stop();
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving 1 area by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving 1 area by offset took " << runningTime.ResultString();
}
return result;
@@ -905,12 +905,12 @@
return false;
}
- StopClock time;
+ StopClock runningTime;
bool result=wayDataFile->GetByOffset(offset,way);
- if (time.GetMilliseconds()>100) {
- log.Warn() << "Retrieving 1 way by offset took " << time.ResultString();
+ if (runningTime.GetMilliseconds()>100) {
+ log.Warn() << "Retrieving 1 way by offset took " << runningTime.ResultString();
}
return result;
@@ -1066,7 +1066,7 @@
Distance distance=Distance::Max();
GeoCoord closestPoint;
- for (size_t i=1; i<way->nodes.size(); i++) {
+ for (size_t i=1; i<way->nodes.size(); ++i) {
Distance currentDistance;
GeoCoord a;
GeoCoord b;
@@ -1165,7 +1165,7 @@
break;
}
- for (size_t i=0; i<ring.nodes.size(); i++) {
+ for (size_t i=0; i<ring.nodes.size(); ++i) {
Distance currentDistance;
GeoCoord a;
GeoCoord b;
@@ -1302,7 +1302,7 @@
Distance distance=Distance::Max();
GeoCoord closestPoint;
- for (size_t i=1; i<way->nodes.size(); i++) {
+ for (size_t i=1; i<way->nodes.size(); ++i) {
Distance currentDistance;
GeoCoord a;
GeoCoord b;
@@ -1397,7 +1397,7 @@
break;
}
- for (size_t i=0; i<ring.nodes.size(); i++) {
+ for (size_t i=0; i<ring.nodes.size(); ++i) {
Distance currentDistance;
GeoCoord a;
GeoCoord b;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/GeoCoord.cpp
^
|
@@ -163,8 +163,11 @@
currentPos += 2;
}
- // try pattern:
+ currentPos=EatWhitespace(text, currentPos);
+
+ // try patterns:
// DD°[D[.DDD]'[D[.DDD]"]]
+ // DD°[D[.DDD]
// parse minutes
if (currentPos<text.length() &&
text[currentPos]>='0' &&
@@ -173,9 +176,9 @@
if (!ScanNumber(text,currentPos,minutes,2)){
return false;
}
+ value+=(minutes/60.0);
if (currentPos<text.length() &&
text[currentPos]=='\''){
- value+=(minutes/60.0);
currentPos+=1;
// parse seconds
@@ -194,9 +197,6 @@
return false;
}
}
-
- }else{
- return false;
}
}
}
@@ -217,8 +217,7 @@
bool lonPos=true;
bool lonDirectionGiven=false;
- currentPos=EatWhitespace(text,
- currentPos);
+ currentPos=EatWhitespace(text, currentPos);
if (currentPos>=text.length()) {
return false;
@@ -249,22 +248,22 @@
currentPos++;
}
- currentPos=EatWhitespace(text,
- currentPos);
+ currentPos=EatWhitespace(text, currentPos);
if (currentPos>=text.length()) {
return false;
}
- if (!ScanCoordinate(text,
- currentPos,
- latitude,
- 2)) {
+ if (!ScanCoordinate(text, currentPos, latitude, 3)) {
return false;
}
- currentPos=EatWhitespace(text,
- currentPos);
+ currentPos=EatWhitespace(text, currentPos);
+ // optional ','
+ if (currentPos<text.length() && text[currentPos]==',') {
+ currentPos++;
+ }
+ currentPos=EatWhitespace(text, currentPos);
if (currentPos>=text.length()) {
return false;
@@ -289,8 +288,7 @@
currentPos++;
}
- currentPos=EatWhitespace(text,
- currentPos);
+ currentPos=EatWhitespace(text, currentPos);
if (currentPos>=text.length()) {
return false;
@@ -325,22 +323,17 @@
currentPos++;
}
- currentPos=EatWhitespace(text,
- currentPos);
+ currentPos=EatWhitespace(text, currentPos);
if (currentPos>=text.length()) {
return false;
}
- if (!ScanCoordinate(text,
- currentPos,
- longitude,
- 3)) {
+ if (!ScanCoordinate(text, currentPos, longitude, 3)) {
return false;
}
- currentPos=EatWhitespace(text,
- currentPos);
+ currentPos=EatWhitespace(text, currentPos);
if (currentPos<text.length()) {
if (text[currentPos]=='E') {
@@ -367,14 +360,12 @@
longitude=-longitude;
}
- currentPos=EatWhitespace(text,
- currentPos);
+ currentPos=EatWhitespace(text, currentPos);
if (currentPos>=text.length()) {
- coord.Set(latitude,
- longitude);
+ coord.Set(latitude, longitude);
- return true;
+ return coord.IsValid();
}
return false;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/LocationService.cpp
^
|
@@ -20,11 +20,12 @@
#include <osmscout/LocationService.h>
#include <algorithm>
+#include <functional>
+#include <iostream>
#include <osmscout/util/Logger.h>
#include <osmscout/util/String.h>
#include <osmscout/TypeFeatures.h>
-#include <iostream>
namespace osmscout {
@@ -711,14 +712,21 @@
}
};
- public:
- std::list<TokenSearch> patterns;
- std::list<Result> matches;
- std::list<Result> partialMatches;
+ private:
+ std::vector<TokenSearch> patterns;
+ BreakerRef breaker;
+ std::function<void(const Result&)> matchCallback;
+ std::function<void(const Result&)> partialMatchCallback;
public:
AdminRegionSearchVisitor(const StringMatcherFactoryRef& matcherFactory,
- const std::list<TokenStringRef>& patterns)
+ const std::list<TokenStringRef>& patterns,
+ BreakerRef breaker,
+ const std::function<void(const Result&)>& matchCallback,
+ const std::function<void(const Result&)>& partialMatchCallback):
+ breaker(breaker),
+ matchCallback(matchCallback),
+ partialMatchCallback(partialMatchCallback)
{
for (const auto& pattern : patterns) {
this->patterns.emplace_back(pattern,
@@ -735,16 +743,15 @@
if (matchResult==StringMatcher::match) {
osmscout::log.Debug() << "Match of pattern " << pattern.tokenString->text << " against region " << type << " '" << name << "'";
- matches.emplace_back(pattern.tokenString,
+ matchCallback(Result(pattern.tokenString,
std::make_shared<AdminRegion>(region),
- name);
-
+ name));
}
else if (matchResult==StringMatcher::partialMatch) {
osmscout::log.Debug() << "Partial match of pattern " << pattern.tokenString->text << " against region " << type << " '" << name << "'";
- partialMatches.emplace_back(pattern.tokenString,
+ partialMatchCallback(Result(pattern.tokenString,
std::make_shared<AdminRegion>(region),
- name);
+ name));
}
return matchResult;
};
@@ -773,6 +780,10 @@
}
}
+ if (breaker && breaker->IsAborted()){
+ osmscout::log.Debug() << "Search aborted";
+ return stop;
+ }
return visitChildren;
}
};
@@ -1941,24 +1952,7 @@
CleanupSearchPatterns(regionSearchPatterns);
- // Search for region name
-
- AdminRegionSearchVisitor adminRegionVisitor(parameter.stringMatcherFactory,
- regionSearchPatterns);
-
- StopClock adminRegionVisitTime;
-
- locationIndex->VisitAdminRegions(adminRegionVisitor);
-
- adminRegionVisitTime.Stop();
-
- osmscout::log.Debug() << "Admin Region visit: " << adminRegionVisitTime.ResultString();
- if (searchParameter.IsAborted()){
- osmscout::log.Debug() << "Search aborted";
- return true;
- }
-
- for (const auto& regionMatch : adminRegionVisitor.matches) {
+ auto RegionMatch = [&](const AdminRegionSearchVisitor::Result& regionMatch){
osmscout::log.Debug() << "Found region match '" << regionMatch.adminRegion->name << "' (" << regionMatch.adminRegion->object.GetName() << ") for pattern '" << regionMatch.tokenString->text << "'";
std::list<std::string> locationTokens=BuildStringListFromSubToken(regionMatch.tokenString,
tokens);
@@ -1982,7 +1976,7 @@
breaker);
if (searchParameter.IsAborted()){
osmscout::log.Debug() << "Search aborted";
- return true;
+ return;
}
}
@@ -1996,7 +1990,7 @@
breaker);
if (searchParameter.IsAborted()){
osmscout::log.Debug() << "Search aborted";
- return true;
+ return;
}
}
@@ -2009,10 +2003,10 @@
result);
}
}
- }
+ };
- if (!parameter.adminRegionOnlyMatch) {
- for (const auto& regionMatch : adminRegionVisitor.partialMatches) {
+ auto RegionPartialMatch = [&](const AdminRegionSearchVisitor::Result& regionMatch){
+ if (!parameter.adminRegionOnlyMatch) {
osmscout::log.Debug() << "Found region candidate '" << regionMatch.adminRegion->name << "' (" << regionMatch.adminRegion->object.GetName() << ") for pattern '" << regionMatch.tokenString->text << "'";
std::list<std::string> locationTokens=BuildStringListFromSubToken(regionMatch.tokenString,
tokens);
@@ -2036,7 +2030,7 @@
breaker);
if (searchParameter.IsAborted()){
osmscout::log.Debug() << "Search aborted";
- return true;
+ return;
}
}
@@ -2050,7 +2044,7 @@
breaker);
if (searchParameter.IsAborted()){
osmscout::log.Debug() << "Search aborted";
- return true;
+ return;
}
}
@@ -2064,6 +2058,26 @@
}
}
}
+ };
+
+ // Search for region name
+
+ AdminRegionSearchVisitor adminRegionVisitor(parameter.stringMatcherFactory,
+ regionSearchPatterns,
+ breaker,
+ RegionMatch,
+ RegionPartialMatch);
+
+ StopClock adminRegionVisitTime;
+
+ locationIndex->VisitAdminRegions(adminRegionVisitor);
+
+ adminRegionVisitTime.Stop();
+
+ osmscout::log.Debug() << "Admin Region visit: " << adminRegionVisitTime.ResultString();
+ if (searchParameter.IsAborted()){
+ osmscout::log.Debug() << "Search aborted";
+ return true;
}
return true;
@@ -2104,24 +2118,7 @@
return true;
}
- // Build Region search patterns
-
- std::list<TokenStringRef> regionSearchPatterns;
-
- regionSearchPatterns.push_back(std::make_shared<TokenString>(searchParameter.GetAdminRegionSearchString()));
-
- // Search for region name
-
- AdminRegionSearchVisitor adminRegionVisitor(searchParameter.GetStringMatcherFactory(),
- regionSearchPatterns);
-
- locationIndex->VisitAdminRegions(adminRegionVisitor);
- if (searchParameter.IsAborted()){
- osmscout::log.Debug() << "Search aborted";
- return true;
- }
-
- for (const auto& regionMatch : adminRegionVisitor.matches) {
+ auto RegionMatch = [&](const AdminRegionSearchVisitor::Result& regionMatch){
osmscout::log.Debug() << "Found region match '" << regionMatch.adminRegion->name << "' for pattern '" << regionMatch.tokenString->text << "'";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/OptimizeAreasLowZoom.cpp
^
|
@@ -24,10 +24,11 @@
#include <osmscout/system/Assert.h>
#include <osmscout/system/Math.h>
+#include <osmscout/projection/Projection.h>
+
#include <osmscout/util/File.h>
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Logger.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/util/StopClock.h>
#include <osmscout/util/String.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/OptimizeWaysLowZoom.cpp
^
|
@@ -24,10 +24,11 @@
#include <osmscout/system/Assert.h>
#include <osmscout/system/Math.h>
+#include <osmscout/projection/Projection.h>
+
#include <osmscout/util/File.h>
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Logger.h>
-#include <osmscout/util/Projection.h>
#include <osmscout/util/StopClock.h>
#include <osmscout/util/String.h>
@@ -160,11 +161,11 @@
return;
}
- uint32_t minxc=(uint32_t)floor((boundingBox.GetMinLon()+180.0)/typeData.cellWidth);
- uint32_t maxxc=(uint32_t)floor((boundingBox.GetMaxLon()+180.0)/typeData.cellWidth);
+ uint32_t minxc=(uint32_t)floor((boundingBox.GetMinLon()+double(GeoCoord::MaxLongitude))/typeData.cellWidth);
+ uint32_t maxxc=(uint32_t)floor((boundingBox.GetMaxLon()+double(GeoCoord::MaxLongitude))/typeData.cellWidth);
- uint32_t minyc=(uint32_t)floor((boundingBox.GetMinLat()+90.0)/typeData.cellHeight);
- uint32_t maxyc=(uint32_t)floor((boundingBox.GetMaxLat()+90.0)/typeData.cellHeight);
+ uint32_t minyc=(uint32_t)floor((boundingBox.GetMinLat()+double(GeoCoord::MaxLatitude))/typeData.cellHeight);
+ uint32_t maxyc=(uint32_t)floor((boundingBox.GetMaxLat()+double(GeoCoord::MaxLatitude))/typeData.cellHeight);
minxc=std::max(minxc,typeData.cellXStart);
maxxc=std::min(maxxc,typeData.cellXEnd);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/Pixel.cpp
^
|
@@ -32,6 +32,8 @@
return stream.str();
}
+ const Vertex2D Vertex2D::ZERO(0.0,0.0);
+
Vertex2D operator-(const Vertex2D &a, const Vertex2D &b)
{
return Vertex2D(a.GetX()-b.GetX(),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/TypeConfig.cpp
^
|
@@ -703,6 +703,9 @@
RegisterFeature(std::make_shared<FromToFeature>());
RegisterFeature(std::make_shared<ColorFeature>());
+ featureOpeningHours=std::make_shared<OpeningHoursFeature>();
+ RegisterFeature(featureOpeningHours);
+
// Make sure, that this is always registered first.
// It assures that id 0 is always reserved for typeIgnore
typeInfoIgnore=std::make_shared<TypeInfo>("");
@@ -882,7 +885,7 @@
}
// Something that has a name and is a POI automatically gets the
- // postal code, location, address, website and phone features, too.
+ // postal code, location, address, website, phone and opening hours features, too.
if (typeInfo->HasFeature(NameFeature::NAME) &&
typeInfo->GetIndexAsPOI()) {
if (!typeInfo->HasFeature(PostalCodeFeature::NAME)) {
@@ -900,6 +903,9 @@
if (!typeInfo->HasFeature(PhoneFeature::NAME)) {
typeInfo->AddFeature(featurePhone);
}
+ if (!typeInfo->HasFeature(OpeningHoursFeature::NAME) && fileFormatVersion >= 25) {
+ typeInfo->AddFeature(featureOpeningHours);
+ }
}
typeInfo->SetIndex(types.size());
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/TypeFeatures.cpp
^
|
@@ -2051,11 +2051,11 @@
}
void ClockwiseDirectionFeature::Parse(TagErrorReporter& /*errorReporter*/,
- const TagRegistry& /*tagRegistry*/,
- const FeatureInstance& feature,
- const ObjectOSMRef& /*object*/,
- const TagMap& tags,
- FeatureValueBuffer& buffer) const
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
{
auto junction=tags.find(tagDirection);
@@ -2067,7 +2067,11 @@
void EleFeatureValue::Read(FileScanner& scanner)
{
- ele=scanner.ReadUInt32Number();
+ if (scanner.GetFileFormatVersion() < 25) {
+ ele = scanner.ReadUInt32Number();
+ } else {
+ ele = scanner.ReadInt16Number();
+ }
}
void EleFeatureValue::Write(FileWriter& writer)
@@ -2187,7 +2191,7 @@
size_t count=0;
// We expect that float values use '.' as separator, but many values use ',' instead.
- // Try try fix this if string looks reasonable
+ // Try to fix this if string looks reasonable
for (size_t i=0; i<eleString.length() && count<=1; i++) {
if (eleString[i]==',') {
pos=i;
@@ -2208,23 +2212,19 @@
eleString.erase(eleString.length()-1);
}
- // Trim possible trailing spaces
- while (eleString.length()>0 &&
- eleString[eleString.length()-1]==' ') {
- eleString.erase(eleString.length()-1);
- }
+ eleString=Trim(eleString);
}
if (!StringToNumber(eleString,e)) {
errorReporter.ReportTag(object,tags,std::string("Ele tag value '")+ele->second+"' is no double!");
}
- else if (e<0 || e>std::numeric_limits<uint32_t>::max()) {
+ else if (e<std::numeric_limits<int16_t>::min() || e>std::numeric_limits<int16_t>::max()) {
errorReporter.ReportTag(object,tags,std::string("Ele tag value '")+ele->second+"' value is too small or too big!");
}
else {
auto* value=static_cast<EleFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
- value->SetEle((uint32_t)floor(e+0.5));
+ value->SetEle(int16_t(floor(e+0.5)));
}
}
@@ -2749,13 +2749,76 @@
}
}
+ namespace {
+ std::vector<LaneTurn> ParseLaneTurns(const std::string &turnStr) {
+ auto turns=SplitString(turnStr, "|");
+ std::vector<LaneTurn> result;
+ for (const std::string &turn: turns) {
+ if (turn=="none" || turn=="") {
+ result.push_back(LaneTurn::None);
+ } else if (turn=="left") {
+ result.push_back(LaneTurn::Left);
+ } else if (turn=="merge_to_left") {
+ result.push_back(LaneTurn::MergeToLeft);
+ } else if (turn=="slight_left") {
+ result.push_back(LaneTurn::SlightLeft);
+ } else if (turn=="sharp_left") {
+ result.push_back(LaneTurn::SharpLeft);
+ } else if (turn=="through;left" || turn=="left;through") {
+ result.push_back(LaneTurn::Through_Left);
+ } else if (turn=="through;slight_left" || turn=="slight_left;through") {
+ result.push_back(LaneTurn::Through_SlightLeft);
+ } else if (turn=="through;sharp_left" || turn=="sharp_left;through") {
+ result.push_back(LaneTurn::Through_SharpLeft);
+ } else if (turn=="through") {
+ result.push_back(LaneTurn::Through);
+ } else if (turn=="through;right" || turn=="right;through") {
+ result.push_back(LaneTurn::Through_Right);
+ } else if (turn=="through;slight_right" || turn=="slight_right;through") {
+ result.push_back(LaneTurn::Through_SlightRight);
+ } else if (turn=="through;sharp_right" || turn=="sharp_right;through") {
+ result.push_back(LaneTurn::Through_SharpRight);
+ } else if (turn=="right") {
+ result.push_back(LaneTurn::Right);
+ } else if (turn=="merge_to_right") {
+ result.push_back(LaneTurn::MergeToRight);
+ } else if (turn=="slight_right") {
+ result.push_back(LaneTurn::SlightRight);
+ } else if (turn=="sharp_right") {
+ result.push_back(LaneTurn::SharpRight);
+ } else {
+ // errorReporter.ReportTag(object,tags,std::string("Lane turn '")+turn+"' is unknown!");
+ result.push_back(LaneTurn::Unknown);
+ }
+ }
+ return result;
+ };
+ }
+
void LanesFeatureValue::Read(FileScanner& scanner)
{
lanes=scanner.ReadUInt8();
+ auto StrToTurns = [](const std::string &str) {
+ std::vector<LaneTurn> res;
+ for (char ch: str) {
+ if (ch > char(LaneTurn::Unknown)) {
+ res.push_back(LaneTurn::Unknown);
+ } else {
+ res.push_back(LaneTurn(ch));
+ }
+ }
+ return res;
+ };
+
if ((lanes & 0x01u)!=0) {
- turnForward=scanner.ReadString();
- turnBackward=scanner.ReadString();
+ if (scanner.GetFileFormatVersion()>=25) {
+ turnForward = StrToTurns(scanner.ReadString());
+ turnBackward = StrToTurns(scanner.ReadString());
+ } else {
+ turnForward = ParseLaneTurns(scanner.ReadString());
+ turnBackward = ParseLaneTurns(scanner.ReadString());
+ }
destinationForward=scanner.ReadString();
destinationBackward=scanner.ReadString();
}
@@ -2775,9 +2838,18 @@
writer.Write(lanes);
+ auto TurnsToStr = [](const std::vector<LaneTurn> &turns) {
+ std::string res;
+ res.reserve(turns.size());
+ for (LaneTurn t: turns) {
+ res.push_back(char(t));
+ }
+ return res;
+ };
+
if ((lanes & 0x01u)!=0) {
- writer.Write(turnForward);
- writer.Write(turnBackward);
+ writer.Write(TurnsToStr(turnForward));
+ writer.Write(TurnsToStr(turnBackward));
writer.Write(destinationForward);
writer.Write(destinationBackward);
}
@@ -3009,7 +3081,7 @@
}
if (additionalInfos) {
- value->SetTurnLanes(turnForward,turnBackward);
+ value->SetTurnLanes(ParseLaneTurns(turnForward),ParseLaneTurns(turnBackward));
value->SetDestinationLanes(destinationForward,destinationBackward);
}
}
@@ -3357,4 +3429,88 @@
value->SetColor(color);
}
}
+
+ void OpeningHoursFeatureValue::Read(FileScanner& scanner)
+ {
+ value=scanner.ReadString();
+ }
+
+ void OpeningHoursFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(value);
+ }
+
+ OpeningHoursFeatureValue& OpeningHoursFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const OpeningHoursFeatureValue&>(other);
+
+ value=otherValue.value;
+ }
+
+ return *this;
+ }
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/WaterIndex.cpp
^
|
@@ -270,10 +270,10 @@
idx-=waterIndexMinMag;
- cx1=(uint32_t)floor((boundingBox.GetMinLon()+180.0)/levels[idx].cellWidth);
- cx2=(uint32_t)floor((boundingBox.GetMaxLon()+180.0)/levels[idx].cellWidth);
- cy1=(uint32_t)floor((boundingBox.GetMinLat()+90.0)/levels[idx].cellHeight);
- cy2=(uint32_t)floor((boundingBox.GetMaxLat()+90.0)/levels[idx].cellHeight);
+ cx1=(uint32_t)floor((boundingBox.GetMinLon()+double(GeoCoord::MaxLongitude))/levels[idx].cellWidth);
+ cx2=(uint32_t)floor((boundingBox.GetMaxLon()+double(GeoCoord::MaxLongitude))/levels[idx].cellWidth);
+ cy1=(uint32_t)floor((boundingBox.GetMinLat()+double(GeoCoord::MaxLatitude))/levels[idx].cellHeight);
+ cy2=(uint32_t)floor((boundingBox.GetMaxLat()+double(GeoCoord::MaxLatitude))/levels[idx].cellHeight);
const Level &level=levels[idx];
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/projection/Earth.cpp
^
|
@@ -0,0 +1,37 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/projection/Earth.h>
+
+#include <osmscout/system/Math.h>
+
+namespace osmscout {
+
+ /*
+ * For the calculations here see:
+ * http://en.wikipedia.org/wiki/Mercator_projection
+ * http://en.wikipedia.org/wiki/Web_Mercator
+ * http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
+ */
+
+ //< Radius of the earth in meter
+ const double Earth::radiusMeter=6'378'137.0;
+ //< Extent of the earth in meter
+ const double Earth::extentMeter=2*M_PI*Earth::radiusMeter;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/projection/MercatorProjection.cpp
^
|
@@ -0,0 +1,249 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/projection/MercatorProjection.h>
+
+#include <algorithm>
+
+#include <osmscout/projection/Earth.h>
+
+#include <osmscout/system/Assert.h>
+#include <osmscout/system/Math.h>
+
+#ifdef OSMSCOUT_HAVE_SSE2
+#include <osmscout/system/SSEMath.h>
+#endif
+
+namespace osmscout {
+
+ /*
+ * For the calculations here see:
+ * http://en.wikipedia.org/wiki/Mercator_projection
+ * http://en.wikipedia.org/wiki/Web_Mercator
+ * http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
+ */
+
+ //< DPI of a classical OSM tile
+ static const double tileDPI=96.0;
+
+ const double MercatorProjection::MaxLat = +85.0511;
+ const double MercatorProjection::MinLat = -85.0511;
+ const double MercatorProjection::MaxLon = +180.0;
+ const double MercatorProjection::MinLon = -180.0;
+
+ bool MercatorProjection::Set(const GeoCoord& coord,
+ double angle,
+ const Magnification& magnification,
+ double dpi,
+ size_t width, size_t height)
+ {
+ if (valid &&
+ this->center==coord &&
+ this->angle==angle &&
+ this->magnification==magnification &&
+ this->dpi==dpi &&
+ this->width==width &&
+ this->height==height) {
+ return true;
+ }
+ if (!IsValidFor(coord)){
+ return false;
+ }
+
+ valid=true;
+
+ // Make a copy of the context information
+ this->center=coord;
+ this->angle=angle;
+ this->magnification=magnification;
+ this->dpi=dpi;
+ this->width=width;
+ this->height=height;
+
+ if (angle!=0.0) {
+ angleSin=std::sin(angle);
+ angleCos=std::cos(angle);
+ angleNegSin=-angleSin;
+ angleNegCos=angleCos;
+ }
+ else {
+ angleSin=0;
+ angleNegSin=0;
+ angleCos=1;
+ angleNegCos=1;
+ }
+
+ // Width in meter of a tile of the given magnification at the equator
+ double equatorTileWidth=Earth::extentMeter/magnification.GetMagnification();
+
+ // Resolution (meter/pixel) of a pixel in a classical 256 pixel tile for the given zoom level at the equator
+ double equatorTileResolution=equatorTileWidth/256.0;
+
+ // Modified resolution (meter/pixel) at the equator based on our actual DPI instead of the standard tile DPI
+ double equatorCorrectedEquatorTileResolution=equatorTileResolution*tileDPI/dpi;
+
+ // Width of the visible area at the equator
+ double groundWidthEquatorMeter=width*equatorCorrectedEquatorTileResolution;
+
+ // Width of the visible area in meter
+ double groundWidthVisibleMeter=groundWidthEquatorMeter*std::cos(center.GetLat()*gradtorad);
+
+ // Resulting projection scale factor
+ scale=width/(2*M_PI*groundWidthEquatorMeter/Earth::extentMeter);
+ scaleGradtorad=scale*gradtorad;
+
+ // Size of one pixel in meter
+ pixelSize=groundWidthVisibleMeter/width;
+
+ // How many pixel are one meter?
+ meterInPixel=1.0/pixelSize;
+
+ // 1 meter on the ground is how many millimeter on display?
+ meterInMM=meterInPixel*25.4/dpi;
+
+ // Absolute Y mercator coordinate for latitude
+ latOffset=std::atanh(std::sin(coord.GetLat()*gradtorad));
+
+ GeoCoord topLeft;
+
+ PixelToGeo(0.0,0.0,topLeft);
+
+ GeoCoord topRight;
+
+ PixelToGeo((double)width,0.0,topRight);
+
+ GeoCoord bottomLeft;
+
+ PixelToGeo(0.0,(double)height,bottomLeft);
+
+ GeoCoord bottomRight;
+
+ PixelToGeo((double)width,(double)height,bottomRight);
+
+ // evaluate bounding box, crop bounding box to valid Mercator area
+
+ boundingBox=GeoBox(topLeft,bottomRight);
+ boundingBox.CropTo(GeoBox(GeoCoord(MinLat,MinLon),
+ GeoCoord(MaxLat,MaxLon)));
+
+ // derivation of "latToYPixel" function in projection center
+ double latDeriv = 1.0 / std::sin( (2 * this->center.GetLat() * gradtorad + M_PI) / 2);
+ scaledLatDeriv = latDeriv * gradtorad * scale;
+
+ return true;
+ }
+
+ bool MercatorProjection::PixelToGeo(double x, double y,
+ GeoCoord& coord) const
+ {
+ assert(valid);
+
+ // Transform to center-based coordinate
+ x-=width/2.0;
+ y=height/2.0-y;
+
+ if (angle!=0.0) {
+ double xn=x*angleCos-y*angleSin;
+ double yn=x*angleSin+y*angleCos;
+
+ x=xn;
+ y=yn;
+ }
+
+ // Transform to absolute geo coordinate
+ coord.Set(std::atan(std::sinh(y/scale+latOffset))/gradtorad,
+ this->center.GetLon()+x/scaleGradtorad);
+
+ return IsValidFor(coord);
+ }
+
+ bool MercatorProjection::GeoToPixel(const GeoCoord& coord,
+ Vertex2D& pixel) const
+ {
+ assert(valid);
+
+ // Screen coordinate relative to center of image
+ double x=(coord.GetLon()-this->center.GetLon())*scaleGradtorad;
+ double y;
+
+ if (useLinearInterpolation) {
+ y=(coord.GetLat()-this->center.GetLat())*scaledLatDeriv;
+ }
+ else {
+ // Mercator is defined just for latitude +-85.0511
+ // For values outside this range is better to result projection border
+ // than some invalid coordinate, like INFINITY
+ double lat = std::min(std::max(coord.GetLat(), MinLat), MaxLat);
+ y=(std::atanh(std::sin(lat*gradtorad))-latOffset)*scale;
+ }
+
+ if (angle!=0.0) {
+ double xn=x*angleNegCos-y*angleNegSin;
+ double yn=x*angleNegSin+y*angleNegCos;
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/projection/Projection.cpp
^
|
@@ -0,0 +1,94 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "osmscout/projection/Projection.h"
+
+#include <algorithm>
+
+#include <osmscout/system/Assert.h>
+
+namespace osmscout {
+
+ bool Projection::BoundingBoxToPixel(const GeoBox& boundingBox,
+ ScreenBox& screenBox) const
+ {
+ assert(boundingBox.IsValid());
+
+ Vertex2D pixel;
+
+ if (!GeoToPixel(boundingBox.GetMinCoord(),
+ pixel)) {
+ return false;
+ }
+
+ double xMin=pixel.GetX();
+ double xMax=pixel.GetX();
+ double yMin=pixel.GetY();
+ double yMax=pixel.GetY();
+
+ if (!GeoToPixel(boundingBox.GetMaxCoord(),
+ pixel)) {
+ return false;
+ }
+
+ xMin=std::min(xMin,
+ pixel.GetX());
+ xMax=std::max(xMax,
+ pixel.GetX());
+ yMin=std::min(yMin,
+ pixel.GetY());
+ yMax=std::max(yMax,
+ pixel.GetY());
+
+ if (!GeoToPixel(GeoCoord(boundingBox.GetMinLat(),
+ boundingBox.GetMaxLon()),
+ pixel)) {
+ return false;
+ }
+
+ xMin=std::min(xMin,
+ pixel.GetX());
+ xMax=std::max(xMax,
+ pixel.GetX());
+ yMin=std::min(yMin,
+ pixel.GetY());
+ yMax=std::max(yMax,
+ pixel.GetY());
+
+ if (!GeoToPixel(GeoCoord(boundingBox.GetMaxLat(),
+ boundingBox.GetMinLon()),
+ pixel)) {
+ return false;
+ }
+
+ xMin=std::min(xMin,
+ pixel.GetX());
+ xMax=std::max(xMax,
+ pixel.GetX());
+ yMin=std::min(yMin,
+ pixel.GetY());
+ yMax=std::max(yMax,
+ pixel.GetY());
+
+ screenBox=ScreenBox(Vertex2D(xMin,yMin),
+ Vertex2D(xMax,yMax));
+
+ return true;
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/projection/TileProjection.cpp
^
|
@@ -0,0 +1,177 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/projection/TileProjection.h>
+
+#include <osmscout/projection/Earth.h>
+
+#include <osmscout/system/Assert.h>
+#include <osmscout/system/Math.h>
+
+#ifdef OSMSCOUT_HAVE_SSE2
+#include <osmscout/system/SSEMath.h>
+#endif
+
+#include <osmscout/util/Tiling.h>
+
+namespace osmscout {
+
+#ifdef OSMSCOUT_HAVE_SSE2
+ static const ALIGN16_BEG double sseGradtorad[] ALIGN16_END = {2*M_PI/360, 2*M_PI/360};
+#endif
+
+ bool TileProjection::SetInternal(const GeoBox& boundingBox,
+ const Magnification& magnification,
+ double dpi,
+ size_t width,size_t height)
+ {
+ if (valid &&
+ this->boundingBox==boundingBox &&
+ this->magnification==magnification &&
+ this->dpi==dpi &&
+ this->width==width &&
+ this->height==height) {
+ return true;
+ }
+
+ valid=true;
+
+ // Make a copy of the context information
+ this->magnification=magnification;
+ this->dpi=dpi;
+ this->width=width;
+ this->height=height;
+
+ this->boundingBox=boundingBox;
+ this->center=this->boundingBox.GetCenter();
+
+ scale=width/(gradtorad*(boundingBox.GetMaxLon()-boundingBox.GetMinLon()));
+ scaleGradtorad = scale * gradtorad;
+
+ lonOffset=boundingBox.GetMinLon()*scaleGradtorad;
+ latOffset=scale*std::atanh(std::sin(boundingBox.GetMinLat()*gradtorad));
+
+ pixelSize=Earth::extentMeter/magnification.GetMagnification()/width;
+ meterInPixel=1/pixelSize;
+ meterInMM=meterInPixel*25.4/pixelSize;
+
+ // derivation of "latToYPixel" function in projection center
+ double latDeriv = 1.0 / std::sin( (2 * this->center.GetLat() * gradtorad + M_PI) / 2);
+ scaledLatDeriv = latDeriv * gradtorad * scale;
+
+#ifdef OSMSCOUT_HAVE_SSE2
+ sse2LonOffset = _mm_set1_pd(lonOffset);
+ sse2LatOffset = _mm_set1_pd(latOffset);
+ sse2Scale = _mm_set1_pd(scale);
+ sse2ScaleGradtorad = _mm_set1_pd(scaleGradtorad);
+ sse2Height = _mm_set1_pd(double(height));
+#endif
+
+ return true;
+}
+
+ bool TileProjection::Set(const OSMTileId& tile,
+ const Magnification& magnification,
+ double dpi,
+ size_t width, size_t height)
+ {
+ GeoBox boundingBox(tile.GetBoundingBox(magnification));
+
+ return SetInternal(boundingBox,
+ magnification,
+ dpi,
+ width,height);
+ }
+
+ bool TileProjection::Set(const OSMTileIdBox& tileBox,
+ const Magnification& magnification,
+ double dpi,
+ size_t width,size_t height)
+ {
+ GeoBox boundingBox(tileBox.GetBoundingBox(magnification));
+
+ return SetInternal(boundingBox,
+ magnification,
+ dpi,
+ width,height);
+ }
+
+ bool TileProjection::PixelToGeo(double x, double y,
+ GeoCoord& coord) const
+ {
+ coord.Set(std::atan(std::sinh((height-y+latOffset)/scale))/gradtorad,
+ (x+lonOffset)/(scale*gradtorad));
+
+ return IsValidFor(coord);
+ }
+
+ #ifdef OSMSCOUT_HAVE_SSE2
+
+ bool TileProjection::GeoToPixel(const GeoCoord& coord,
+ Vertex2D& pixel) const
+ {
+ double x=coord.GetLon()*scaleGradtorad-lonOffset;
+ double y=height-(scale*atanh_sin_pd(coord.GetLat()*gradtorad)-latOffset);
+ pixel=Vertex2D(x,y);
+ return IsValidFor(coord);
+ }
+
+ //this basically transforms 2 coordinates in 1 call
+ void TileProjection::GeoToPixel(const BatchTransformer& transformData) const
+ {
+ v2df x = _mm_sub_pd(_mm_mul_pd( ARRAY2V2DF(transformData.lon), sse2ScaleGradtorad), sse2LonOffset);
+ __m128d test = ARRAY2V2DF(transformData.lat);
+ v2df y = _mm_sub_pd(sse2Height,
+ _mm_sub_pd(_mm_mul_pd(sse2Scale,
+ atanh_sin_pd( _mm_mul_pd( test, ARRAY2V2DF(sseGradtorad)))),
+ sse2LatOffset));
+
+ //store results:
+ _mm_storel_pd (transformData.xPointer[0], x);
+ _mm_storeh_pd (transformData.xPointer[1], x);
+ _mm_storel_pd (transformData.yPointer[0], y);
+ _mm_storeh_pd (transformData.yPointer[1], y);
+ }
+
+ #else
+ bool TileProjection::GeoToPixel(const GeoCoord& coord,
+ Vertex2D& pixel) const
+ {
+ double x=coord.GetLon()*scaleGradtorad-lonOffset;
+ double y;
+
+ if (useLinearInterpolation) {
+ y=(height/2.0)-((coord.GetLat()-this->center.GetLat())*scaledLatDeriv);
+ }
+ else {
+ y=height-(scale*std::atanh(std::sin(coord.GetLat()*gradtorad))-latOffset);
+ }
+
+ pixel=Vertex2D(x,y);
+
+ return IsValidFor(coord);
+ }
+
+ void TileProjection::GeoToPixel(const BatchTransformer& /*transformData*/) const
+ {
+ assert(false); //should not be called
+ }
+
+ #endif
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/AbstractRoutingService.cpp
^
|
@@ -90,41 +90,20 @@
}
template <class RoutingState>
- void AbstractRoutingService<RoutingState>::ResolveRNodeChainToList(DBId finalRouteNode,
+ void AbstractRoutingService<RoutingState>::ResolveRNodeChainToList(const RNode &finalRouteNode,
const ClosedSet& closedSet,
- const ClosedSet& closedRestrictedSet,
std::list<VNode>& nodes)
{
- bool restricted=false;
- auto current=closedSet.find(VNode(finalRouteNode));
-
- if (current==closedSet.end()){
- current=closedRestrictedSet.find(VNode(finalRouteNode));
- assert(current!=closedSet.end());
- restricted=true;
- }
+ auto current=closedSet.find(VNode(finalRouteNode.id, finalRouteNode.restricted));
+ assert(current!=closedSet.end());
while (current->previousNode.IsValid()) {
if constexpr (debugRouting) {
std::cout << "Chain item " << current->currentNode << " -> " << current->previousNode << std::endl;
}
ClosedSet::const_iterator prev;
- if (!restricted){
- prev=closedSet.find(VNode(current->previousNode));
- if (prev==closedSet.end()){
- prev=closedRestrictedSet.find(VNode(current->previousNode));
- assert(prev!=closedRestrictedSet.end());
- restricted=true;
- }
- }else{
- prev=closedRestrictedSet.find(VNode(current->previousNode));
- if (prev==closedRestrictedSet.end()){
- prev=closedSet.find(VNode(current->previousNode));
- assert(prev!=closedSet.end());
- restricted=false;
- }
- }
-
+ prev=closedSet.find(VNode(current->previousNode, current->previousRestricted));
+ assert(prev!=closedSet.end());
nodes.push_back(*current);
@@ -383,6 +362,9 @@
forwardRNode)) {
return false;
}
+ if (forwardRNode) {
+ forwardRNode->leaveRestricted=true;
+ }
if (backwardRouteNode &&
!GetRNode(state,
@@ -395,6 +377,9 @@
backwardRNode)) {
return false;
}
+ if (backwardRNode) {
+ backwardRNode->leaveRestricted=true;
+ }
return true;
}
@@ -564,18 +549,14 @@
RouteNodeRef ¤tRouteNode,
OpenList &openList,
OpenMap &openMap,
- const ClosedSet &closedSet,
- const ClosedSet &closedRestrictedSet)
+ const ClosedSet &closedSet)
{
// add twin nodes to nextNode from other databases to open list
std::vector<DBId> twins=GetNodeTwins(state,
current->id.database,
currentRouteNode->GetId());
for (const auto& twin : twins) {
- if ((current->access &&
- closedSet.find(VNode(twin))!=closedSet.end()) ||
- (!current->access &&
- closedRestrictedSet.find(VNode(twin))!=closedRestrictedSet.end())){
+ if (closedSet.find(VNode(twin, current->restricted))!=closedSet.end()) {
if constexpr (debugRouting) {
std::cout << "Twin node " << twin << " is closed already, ignore it" << std::endl;
}
@@ -590,12 +571,13 @@
// this is cheaper path to twin
rn->prev=current->id;
+ rn->prevRestricted=current->restricted;
//rn->object=node->objects.begin()->object, /*TODO: how to find correct way from other DB?*/
rn->currentCost=current->currentCost;
rn->estimateCost=current->estimateCost;
rn->overallCost=current->overallCost;
- rn->access=current->access;
+ rn->restricted=current->restricted;
openList.erase(twinIt->second);
@@ -616,12 +598,13 @@
node,
//node->objects.begin()->object, /*TODO: how to find correct way from other DB?*/
ObjectFileRef(), // TODO: have to be valid Object here?
- /*prev*/current->id);
+ /*prev*/current->id,
+ current->restricted);
rn->currentCost=current->currentCost;
rn->estimateCost=current->estimateCost;
rn->overallCost=current->overallCost;
- rn->access=current->access;
+ rn->restricted=current->restricted;
std::pair<OpenListRef,bool> insertResult=openList.insert(rn);
openMap[rn->id]=insertResult.first;
@@ -641,7 +624,6 @@
OpenList &openList,
OpenMap &openMap,
ClosedSet &closedSet,
- ClosedSet &closedRestrictedSet,
RoutingResult &result,
const RoutingParameter& parameter,
const GeoCoord &targetCoord,
@@ -686,8 +668,9 @@
continue;
}
- if (!current->access &&
- !path.IsRestricted(vehicle)) {
+ if (current->restricted &&
+ !path.IsRestricted(vehicle) &&
+ !current->leaveRestricted) {
if constexpr (debugRouting) {
std::cout << " Skipping route";
std::cout << " to " << path.id;
@@ -717,10 +700,7 @@
continue;
}
- if ((current->access &&
- closedSet.find(VNode(DBId(dbId,path.id)))!=closedSet.end()) ||
- (!current->access &&
- closedRestrictedSet.find(VNode(DBId(dbId,path.id)))!=closedRestrictedSet.end())) {
+ if (closedSet.find(VNode(DBId(dbId,path.id), path.IsRestricted(vehicle)))!=closedSet.end()) {
if constexpr (debugRouting) {
std::cout << " Skipping route";
std::cout << " to " << dbId << " / " << path.id;
@@ -738,7 +718,7 @@
for (const auto& exclude : currentRouteNode->excludes) {
if (exclude.source==current->object &&
- currentRouteNode->objects[exclude.targetIndex].object==currentRouteNode->objects[path.objectIndex].object) {
+ currentRouteNode->objects[currentRouteNode->paths[exclude.targetIndex].objectIndex].object==currentRouteNode->objects[path.objectIndex].object) {
if constexpr (debugRouting) {
std::cout << " Skipping route";
std::cout << " to " << dbId << " / " << path.id;
@@ -831,12 +811,18 @@
RNodeRef node=*openEntry->second;
node->prev=current->id;
+ node->prevRestricted=current->restricted;
node->object=currentRouteNode->objects[path.objectIndex].object;
node->currentCost=currentCost;
node->estimateCost=estimateCost;
node->overallCost=overallCost;
- node->access=!currentRouteNode->paths[i].IsRestricted(vehicle);
+ node->restricted=currentRouteNode->paths[i].IsRestricted(vehicle);
+ if (node->restricted &&
+ current->leaveRestricted) {
+ // allow to leave restricted area
+ node->leaveRestricted=true;
+ }
if constexpr (debugRouting) {
std::cout << " Updating route " << current->id << " via " << node->object.GetTypeName() << " "
@@ -853,12 +839,18 @@
RNodeRef node=std::make_shared<RNode>(DBId(dbId,path.id),
nextNode,
currentRouteNode->objects[path.objectIndex].object,
- current->id);
+ current->id,
+ current->restricted);
node->currentCost=currentCost;
node->estimateCost=estimateCost;
node->overallCost=overallCost;
- node->access=!path.IsRestricted(vehicle);
+ node->restricted=path.IsRestricted(vehicle);
+ if (node->restricted &&
+ current->leaveRestricted) {
+ // allow to leave restricted area
+ node->leaveRestricted=true;
+ }
if constexpr (debugRouting) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/RouteDescription.cpp
^
|
@@ -478,7 +478,7 @@
RouteDescription::LaneDescription::LaneDescription(bool oneway,
uint8_t laneCount,
- const std::vector<std::string> &laneTurns)
+ const std::vector<LaneTurn> &laneTurns)
: oneway(oneway), laneCount(laneCount), laneTurns(laneTurns)
{}
@@ -492,13 +492,9 @@
if (!laneTurns.empty()){
ss << " :";
}
- for_each(laneTurns.begin(), laneTurns.end(), [&ss] (const std::string& s) {
+ for_each(laneTurns.begin(), laneTurns.end(), [&ss] (const LaneTurn& turn) {
ss << " ";
- if (s.empty()){
- ss << "<unspecified>";
- } else {
- ss << s;
- }
+ ss << LaneTurnString(turn);
});
return ss.str();
@@ -562,9 +558,9 @@
}
- void RouteDescription::Node::SetTime(const Timestamp::duration &time)
+ void RouteDescription::Node::SetTime(const Timestamp::duration &duration)
{
- this->time=time;
+ this->time=duration;
}
void RouteDescription::Node::AddDescription(const char* name,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/RoutePostprocessor.cpp
^
|
@@ -638,8 +638,9 @@
}
std::vector<RoutePostprocessor::InstructionPostprocessor::NodeExit>
- RoutePostprocessor::InstructionPostprocessor::CollectNodeExits(const RoutePostprocessor& postprocessor,
- RouteDescription::Node& node)
+ RoutePostprocessor::InstructionPostprocessor::CollectNodeWays(const RoutePostprocessor& postprocessor,
+ RouteDescription::Node& node,
+ bool exitsOnly)
{
std::vector<NodeExit> exits;
if (!node.GetPathObject().IsWay()) {
@@ -653,11 +654,17 @@
WayRef way=postprocessor.GetWay(DBFileOffset(node.GetDatabaseId(), obj.GetFileOffset()));
for (size_t ni=0; ni<way->nodes.size(); ++ni) {
if (way->nodes[ni].IsIdentical(nodePoint)) {
- if (ni>0 && postprocessor.CanUseBackward(node.GetDatabaseId(), nodePoint.GetId(), obj)) {
- exits.push_back({obj, ni-1, GetSphericalBearingInitial(nodePoint.GetCoord(), way->nodes[ni-1].GetCoord())});
+ if (ni>0) {
+ bool canBeUsedAsExit = postprocessor.CanUseBackward(node.GetDatabaseId(), nodePoint.GetId(), obj);
+ if (!exitsOnly || canBeUsedAsExit) {
+ exits.push_back({obj, ni-1, GetSphericalBearingInitial(nodePoint.GetCoord(), way->nodes[ni-1].GetCoord()), canBeUsedAsExit});
+ }
}
- if (ni+1<way->nodes.size() && postprocessor.CanUseForward(node.GetDatabaseId(), nodePoint.GetId(), obj)) {
- exits.push_back({obj, ni+1, GetSphericalBearingInitial(nodePoint.GetCoord(), way->nodes[ni+1].GetCoord())});
+ if (ni+1<way->nodes.size()) {
+ bool canBeUsedAsExit = postprocessor.CanUseForward(node.GetDatabaseId(), nodePoint.GetId(), obj);
+ if (!exitsOnly || canBeUsedAsExit) {
+ exits.push_back({obj, ni + 1, GetSphericalBearingInitial(nodePoint.GetCoord(), way->nodes[ni + 1].GetCoord()), canBeUsedAsExit});
+ }
}
break;
}
@@ -694,8 +701,8 @@
RouteDescription::RoundaboutEnterDescriptionRef desc=std::make_shared<RouteDescription::RoundaboutEnterDescription>(roundaboutClockwise);
node.AddDescription(RouteDescription::ROUNDABOUT_ENTER_DESC,desc);
- // collect roundabout exits
- std::vector<NodeExit> exits=CollectNodeExits(postprocessor, node);
+ // collect roundabout exits (and even inputs, to be able find entering path when it is oneway)
+ std::vector<NodeExit> exits=CollectNodeWays(postprocessor, node, false);
// sort exists by its bearing
std::sort(exits.begin(), exits.end(), [&](const NodeExit &a, const NodeExit &b) {
if (roundaboutClockwise) {
@@ -709,13 +716,16 @@
for (size_t i=0;; ++i) {
NodeExit &exit=exits[i%exits.size()];
if (entered) {
- roundaboutCrossingCounter++;
- if (exit.ref==node.GetPathObject() && exit.node==node.GetTargetNodeIndex()) {
- break;
+ if (exit.canBeUsedAsExit) {
+ roundaboutCrossingCounter++;
+ if (exit.ref == node.GetPathObject() && exit.node == node.GetTargetNodeIndex()) {
+ break;
+ }
}
} else if (exit.ref==incomingPath && exit.node==incomingNode) {
entered=true;
}
+ assert(i<exits.size()*2);
}
RoutePostprocessor::InstructionPostprocessor::HandleRoundaboutLeave(node);
@@ -1617,9 +1627,9 @@
int allowedLaneFrom = -1;
int allowedLaneTo = -1; // inclusive
- auto LookupLanesTurns = [&](const std::set<std::string_view> &possibilities){
+ auto LookupLanesTurns = [&](const std::set<LaneTurn> &possibilities){
for (size_t i = 0; i < prevLanes->GetLaneTurns().size(); i++){
- std::string_view turn = prevLanes->GetLaneTurns()[i];
+ LaneTurn turn = prevLanes->GetLaneTurns()[i];
if (possibilities.find(turn) != possibilities.end()){
// it is possible to use this turn
if (allowedLaneFrom < 0) {
@@ -1636,17 +1646,29 @@
}
};
- static const std::set<std::string_view> leftPossibilities{
- "left"sv, "slight_left"sv, "through;left"sv, "through;slight_left"sv, "through;sharp_left"sv};
-
- static const std::set<std::string_view> straightPossibilities{
- "through;left"sv, "through;slight_left"sv, "through;sharp_left"sv,
- "through"sv,
- ""sv, // no-sign implicitly as through
- "through;right"sv, "through;slight_right"sv, "through;sharp_right"sv};
-
- static const std::set<std::string_view> rightPossibilities{
- "right"sv, "slight_right"sv, "through;right"sv, "through;slight_right"sv, "through;sharp_right"sv};
+ static const std::set<LaneTurn> leftPossibilities{
+ LaneTurn::Left,
+ LaneTurn::SlightLeft,
+ LaneTurn::Through_Left,
+ LaneTurn::Through_SlightLeft,
+ LaneTurn::Through_SharpLeft};
+
+ static const std::set<LaneTurn> straightPossibilities{
+ LaneTurn::Through_Left,
+ LaneTurn::Through_SlightRight,
+ LaneTurn::Through_SharpLeft,
+ LaneTurn::Through,
+ LaneTurn::None, // no-sign implicitly as through
+ LaneTurn::Through_Right,
+ LaneTurn::Through_SlightRight,
+ LaneTurn::Through_SharpRight};
+
+ static const std::set<LaneTurn> rightPossibilities{
+ LaneTurn::Right,
+ LaneTurn::SlightRight,
+ LaneTurn::Through_Right,
+ LaneTurn::Through_SlightRight,
+ LaneTurn::Through_SharpRight};
// after some direction change, we will evaluate allowed lanes in backBuffer
if (!prevLanes->GetLaneTurns().empty()){
@@ -2120,14 +2142,14 @@
bool oneway=accessValue!=nullptr && accessValue->IsOneway();
uint8_t laneCount;
- std::vector<std::string> laneTurns;
+ std::vector<LaneTurn> laneTurns;
LanesFeatureValue *lanesValue=lanesReader->second->GetValue(way->GetFeatureValueBuffer());
if (lanesValue!=nullptr) {
laneCount=std::max((uint8_t)1,forward ? lanesValue->GetForwardLanes() : lanesValue->GetBackwardLanes());
- std::string turns=forward ? lanesValue->GetTurnForward() : lanesValue->GetTurnBackward();;
- std::list<std::string> turnList=SplitString(turns, "|", laneCount);
- laneTurns.reserve(turnList.size());
- laneTurns.insert(laneTurns.begin(), turnList.begin(), turnList.end());
+ laneTurns=forward ? lanesValue->GetTurnForward() : lanesValue->GetTurnBackward();
+ while (laneTurns.size() < laneCount) {
+ laneTurns.push_back(LaneTurn::None);
+ }
} else {
// default lane count by object type
if (oneway) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/RoutingProfile.cpp
^
|
@@ -27,11 +27,6 @@
namespace osmscout {
- RoutingProfile::~RoutingProfile()
- {
- // no code
- }
-
AbstractRoutingProfile::AbstractRoutingProfile(const TypeConfigRef& typeConfig)
: typeConfig(typeConfig),
accessReader(*typeConfig),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/CmdLineParsing.cpp
^
|
@@ -313,11 +313,11 @@
return CmdLineParseResult("Lon value of argument '"+GetArgumentName()+"' is not in valid format");
}
- if (lat<-90.0 || lat>90.0) {
+ if (lat<double(GeoCoord::MinLatitude) || lat>double(GeoCoord::MaxLatitude)) {
return CmdLineParseResult("Lat value of argument '"+GetArgumentName()+"' is not in valid range [-90.0,90.0]");
}
- if (lon<-180.0 || lon>180.0) {
+ if (lon<double(GeoCoord::MinLongitude) || lon>double(GeoCoord::MaxLongitude)) {
return CmdLineParseResult("Lon value of argument '"+GetArgumentName()+"' is not in valid range [-180.0,180.0]");
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/FileScanner.cpp
^
|
@@ -134,39 +134,39 @@
throw IOException(filename,"Cannot seek to start of file");
}
#elif defined(HAVE__FSEEKI64) && defined(HAVE__FTELLI64)
- __int64 size;
+ __int64 fileSize;
if (_fseeki64(file,0L,SEEK_END)!=0) {
throw IOException(filename,"Cannot seek to end of file");
}
- size=_ftelli64(file);
+ fileSize=_ftelli64(file);
- if (size==-1) {
+ if (fileSize==-1) {
throw IOException(filename,"Cannot get size of file");
}
- this->size=(FileOffset)size;
+ this->size=(FileOffset)fileSize;
if (_fseeki64(file,0L,SEEK_SET)!=0) {
throw IOException(filename,"Cannot seek to start of file");
}
#else
- long size;
+ long fileSize;
if (fseek(file,0L,SEEK_END)!=0) {
log.Error() << "Cannot seek to end of file '" << filename << "' (" << strerror(errno) << ")";
throw IOException(filename,"Cannot seek to end of file");
}
- size=ftell(file);
+ fileSize=ftell(file);
- if (size==-1) {
+ if (fileSize==-1) {
log.Error() << "Cannot get size of file '" << filename << "' (" << strerror(errno) << ")";
throw IOException(filename,"Cannot get size of file");
}
- this->size=(FileOffset)size;
+ this->size=(FileOffset)fileSize;
if (fseek(file,0L,SEEK_SET)!=0) {
log.Error() << "Cannot seek to start of file '" << filename << "' (" << strerror(errno) << ")";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/GeoBox.cpp
^
|
@@ -106,6 +106,17 @@
return {cornerMin, cornerMax};
}
+ GeoBox GeoBox::CropTo(const GeoBox& other) const
+ {
+ GeoCoord cornerMin( GetMinLat()<other.GetMinLat() ? other.GetMinLat() : GetMinLat(),
+ GetMinLon()<other.GetMinLon() ? other.GetMinLon() : GetMinLon());
+
+ GeoCoord cornerMax( GetMaxLat()>other.GetMaxLat() ? other.GetMaxLat() : GetMaxLat(),
+ GetMaxLon()>other.GetMaxLon() ? other.GetMaxLon() : GetMaxLon());
+
+ return {cornerMin, cornerMax};
+ }
+
GeoCoord GeoBox::GetCenter() const
{
return {(minCoord.GetLat()+maxCoord.GetLat())/2,
@@ -147,5 +158,4 @@
return boundingBox;
}
-
}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/LaneTurn.cpp
^
|
@@ -0,0 +1,68 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/util/LaneTurn.h>
+
+#include <string>
+
+namespace osmscout {
+
+std::string LaneTurnString(LaneTurn turn)
+{
+ switch (turn) {
+ case LaneTurn::None:
+ return "none";
+ case LaneTurn::Left:
+ return "left";
+ case LaneTurn::MergeToLeft:
+ return "merge_to_left";
+ case LaneTurn::SlightLeft:
+ return "slight_left";
+ case LaneTurn::SharpLeft:
+ return "sharp_left";
+ case LaneTurn::Through_Left:
+ return "through;left";
+ case LaneTurn::Through_SlightLeft:
+ return "through;slight_left";
+ case LaneTurn::Through_SharpLeft:
+ return "through;sharp_left";
+ case LaneTurn::Through:
+ return "through";
+ case LaneTurn::Through_Right:
+ return "through;right";
+ case LaneTurn::Through_SlightRight:
+ return "through;slight_right";
+ case LaneTurn::Through_SharpRight:
+ return "through;sharp_right";
+ case LaneTurn::Right:
+ return "right";
+ case LaneTurn::MergeToRight:
+ return "merge_to_right";
+ case LaneTurn::SlightRight:
+ return "slight_right";
+ case LaneTurn::SharpRight:
+ return "sharp_right";
+ case LaneTurn::Unknown:
+ return "unknown";
+ default:
+ return "unknown";
+ }
+}
+
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/OpeningHours.cpp
^
|
@@ -0,0 +1,219 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/util/OpeningHours.h>
+#include <osmscout/util/String.h>
+#include <osmscout/util/Logger.h>
+
+#include <array>
+
+namespace osmscout {
+
+OpeningHours::OpeningHours(std::vector<Rule> rules):
+ rules(rules)
+{
+}
+
+namespace { // anonymous namespace
+
+std::optional<OpeningHours::WeekDay> ParseDay(const std::string &dayStr, bool holidays)
+{
+ if (dayStr=="Mo") {
+ return OpeningHours::WeekDay::Monday;
+ }
+ if (dayStr=="Tu") {
+ return OpeningHours::WeekDay::Tuesday;
+ }
+ if (dayStr=="We") {
+ return OpeningHours::WeekDay::Wednesday;
+ }
+ if (dayStr=="Th") {
+ return OpeningHours::WeekDay::Thursday;
+ }
+ if (dayStr=="Fr") {
+ return OpeningHours::WeekDay::Friday;
+ }
+ if (dayStr=="Sa") {
+ return OpeningHours::WeekDay::Saturday;
+ }
+ if (dayStr=="Su") {
+ return OpeningHours::WeekDay::Sunday;
+ }
+ if (dayStr=="PH" && holidays) {
+ return OpeningHours::WeekDay::PublicHoliday;
+ }
+ if (dayStr=="SH" && holidays) {
+ return OpeningHours::WeekDay::SchoolHoliday;
+ }
+
+ log.Warn() << "Unknown opening hours day: " << dayStr;
+ return std::nullopt;
+}
+
+// examples:
+// Mo-Su
+// Mo,Tu
+// Sa-Su,PH
+std::optional<std::vector<OpeningHours::WeekDay>> ParseDayDescription(const std::string &dayDescription)
+{
+ std::vector<OpeningHours::WeekDay> result;
+
+ // dayDescription is day set (Mo,Tu or Sa-Su,PH)
+ auto days=SplitString(dayDescription, ",");
+ for (auto const &dayStr:days) {
+
+ if (dayStr.find('-') != std::string::npos) {
+ // dayDescription is day interval (Mo-Su)
+ auto daysIntervalParts = SplitString(dayStr, "-", 2);
+ if (daysIntervalParts.size() != 2) {
+ log.Warn() << "Cannot parse day description: " << dayDescription;
+ return std::nullopt;
+ }
+ auto from=ParseDay(daysIntervalParts.front(), false);
+ auto to=ParseDay(daysIntervalParts.back(), false);
+ if (!from || !to) {
+ return std::nullopt;
+ }
+ for (int day=int(from.value()); day<=int(to.value()); day++) {
+ result.push_back(OpeningHours::WeekDay(day));
+ }
+ } else {
+ // single day
+ auto day = ParseDay(dayStr, true);
+ if (!day) {
+ return std::nullopt;
+ }
+ result.push_back(*day);
+ }
+ }
+
+ return result;
+}
+
+// example: 08:00
+std::optional<OpeningHours::DayTime> ParseTime(const std::string &timeStr)
+{
+ auto timesStr=SplitString(timeStr, ":", 2);
+ if (timesStr.size()!=2) {
+ log.Warn() << "Cannot parse time: " << timeStr;
+ return std::nullopt;
+ }
+ OpeningHours::DayTime result;
+ if (!StringToNumberUnsigned(timesStr.front(), result.hour)) {
+ log.Warn() << "Cannot parse time: " << timeStr;
+ return std::nullopt;
+ }
+ if (!StringToNumberUnsigned(timesStr.back(), result.minute)) {
+ log.Warn() << "Cannot parse time: " << timeStr;
+ return std::nullopt;
+ }
+ if (result.hour>48 || result.minute>59) {
+ log.Warn() << "Cannot parse time: " << timeStr;
+ return std::nullopt;
+ }
+ return result;
+}
+
+// example: 08:00-12:00
+std::optional<OpeningHours::TimeInterval> ParseTimeRange(const std::string &rangeStr)
+{
+ auto timesStr=SplitString(rangeStr, "-", 2);
+ if (timesStr.size()!=2) {
+ log.Warn() << "Cannot parse time interval: " << rangeStr;
+ return std::nullopt;
+ }
+ auto from=ParseTime(timesStr.front());
+ if (!from) {
+ return std::nullopt;
+ }
+ auto to=ParseTime(timesStr.back());
+ if (!to) {
+ return std::nullopt;
+ }
+ return OpeningHours::TimeInterval{*from, *to};
+}
+
+// example: 08:00-12:00,13:00-17:30
+std::optional<std::vector<OpeningHours::TimeInterval>> ParseTimeDescription(const std::string &timeDescription) {
+ std::vector<OpeningHours::TimeInterval> result;
+ if (timeDescription=="off") {
+ return result;
+ }
+ auto rangesStr=SplitString(timeDescription, ",");
+ for (const auto &rangeStr:rangesStr) {
+ auto range=ParseTimeRange(rangeStr);
+ if (!range) {
+ return std::nullopt;
+ }
+ result.push_back(*range);
+ }
+ return result;
+}
+}
+
+std::optional<OpeningHours> OpeningHours::Parse(const std::string &str, bool explicitClosedDays)
+{
+ constexpr int LastDayValue = int(WeekDay::SchoolHoliday);
+
+ if (str=="24/7") {
+ std::vector<Rule> rules;
+ std::vector<TimeInterval> wholeDay{{DayTime{0, 0}, DayTime{24, 0}}};
+ for (int day=int(WeekDay::Monday); day<=int(WeekDay::Sunday); day++) {
+ rules.push_back(Rule{WeekDay(day),wholeDay});
+ }
+ return std::make_optional<OpeningHours>(rules);
+ }
+
+ // to make sure that we have one rule per day (the last one), use array indexed by day
+ std::array<std::optional<std::vector<TimeInterval>>, LastDayValue+1> rules;
+ auto rulesStr = SplitString(str, ";");
+ for (std::string &ruleStr:rulesStr){
+ ruleStr=Trim(ruleStr);
+ auto ruleSplit=SplitString(ruleStr, " ", 2);
+ if (ruleSplit.size()!=2) {
+ log.Warn() << "Cannot parse opening hours rule: " << ruleStr;
+ return std::nullopt;
+ }
+ auto days=ParseDayDescription(ruleSplit.front());
+ if (!days) {
+ return std::nullopt;
+ }
+ auto timeIntervals=ParseTimeDescription(ruleSplit.back());
+ if (!timeIntervals) {
+ return std::nullopt;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/ScreenBox.cpp
^
|
@@ -21,6 +21,11 @@
namespace osmscout {
+ const ScreenBox ScreenBox::EMPTY(Vertex2D(0.0,
+ 0.0),
+ Vertex2D(0.0,
+ 0.0));
+
ScreenBox::ScreenBox(const Vertex2D& coordA,
const Vertex2D& coordB)
: minCoord(std::min(coordA.GetX(),coordB.GetX()),
@@ -31,6 +36,45 @@
// no code
}
+ bool ScreenBox::operator==(const ScreenBox& other) const
+ {
+ return minCoord==other.minCoord &&
+ maxCoord == other.maxCoord;
+ }
+
+ bool ScreenBox::Intersects(const ScreenBox& other) const
+ {
+ return Intersects(other,true);
+ }
+
+ bool ScreenBox::Intersects(const ScreenBox& other,
+ bool openInterval) const
+ {
+ if (openInterval) {
+ return !(other.GetMaxX()<minCoord.GetX() ||
+ other.GetMinX()>=maxCoord.GetX() ||
+ other.GetMaxY()<minCoord.GetY() ||
+ other.GetMinY()>=maxCoord.GetY());
+ }
+
+ return !(other.GetMaxX()<minCoord.GetX() ||
+ other.GetMinX()>maxCoord.GetX() ||
+ other.GetMaxY()<minCoord.GetY() ||
+ other.GetMinY()>maxCoord.GetY());
+ }
+
+ ScreenBox ScreenBox::Resize(double offset) const
+ {
+ // If the offset is negative its absolute value must not be > than width or height
+ assert(offset>-GetWidth());
+ assert(offset>-GetHeight());
+
+ return {Vertex2D(minCoord.GetX()-offset,
+ minCoord.GetY()-offset),
+ Vertex2D(maxCoord.GetX()+offset,
+ maxCoord.GetY()+offset)};
+ }
+
ScreenBox ScreenBox::Merge(const ScreenBox& other) const
{
return {Vertex2D(std::min(minCoord.GetX(),other.minCoord.GetX()),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/StopClock.cpp
^
|
@@ -49,9 +49,9 @@
return stop-start;
}
- std::ostream& operator<<(std::ostream& stream, const StopClock& clock)
+ std::ostream& operator<<(std::ostream& stream, const StopClock& stopClock)
{
- double deltaMilli=clock.GetMilliseconds();
+ double deltaMilli=stopClock.GetMilliseconds();
uint64_t seconds=(uint64_t)deltaMilli/1000;
uint64_t milliseconds=(uint64_t)deltaMilli-seconds*1000;
@@ -111,9 +111,9 @@
return std::chrono::duration_cast<NanoDouble>(stop-start).count();
}
- std::ostream& operator<<(std::ostream& stream, const StopClockNano& clock)
+ std::ostream& operator<<(std::ostream& stream, const StopClockNano& stopClock)
{
- double deltaNano=clock.GetNanoseconds();
+ double deltaNano=stopClock.GetNanoseconds();
stream << deltaNano;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/String.cpp
^
|
@@ -908,4 +908,17 @@
return stream.str();
}
+
+ std::string Trim(const std::string &str, char trimmedChar)
+ {
+ auto begin=str.begin();
+ auto end=str.end();
+ while (begin != end && *(end - 1) == trimmedChar) {
+ --end;
+ }
+ while (begin != end && *begin == trimmedChar) {
+ ++begin;
+ }
+ return std::string(begin, end);
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/Transformation.cpp
^
|
@@ -248,10 +248,10 @@
usedPoints=0;
}
- size_t CoordBuffer::PushCoord(double x, double y)
+ size_t CoordBuffer::PushCoord(const Vertex2D& coord)
{
- assert(!std::isnan(x));
- assert(!std::isnan(y));
+ assert(!std::isnan(coord.GetX()));
+ assert(!std::isnan(coord.GetY()));
if (usedPoints>=bufferSize) {
bufferSize=bufferSize*2;
@@ -267,7 +267,7 @@
buffer=newBuffer;
}
- buffer[usedPoints].Set(x,y);
+ buffer[usedPoints]=coord;
return usedPoints++;
}
@@ -292,8 +292,8 @@
oax=offset*oax;
oay=offset*oay;
- start=PushCoord(buffer[org.GetStart()].GetX()+oax,
- buffer[org.GetStart()].GetY()+oay);
+ start=PushCoord(Vertex2D(buffer[org.GetStart()].GetX()+oax,
+ buffer[org.GetStart()].GetY()+oay));
for (size_t i=org.GetStart()+1; i<org.GetEnd(); i++) {
Normalize(buffer[i-1].GetY()-buffer[i].GetY(),
@@ -324,19 +324,19 @@
double addX = det1/det2*(buffer[i].GetX()-buffer[i-1].GetX());
double addY = det1/det2*(buffer[i].GetY()-buffer[i-1].GetY());
if (std::abs(addX) < 2*std::abs(offset) && std::abs(addY) < 2*std::abs(offset)) {
- PushCoord(buffer[i].GetX() + oax + addX,
- buffer[i].GetY() + oay + addY);
+ PushCoord(Vertex2D(buffer[i].GetX() + oax + addX,
+ buffer[i].GetY() + oay + addY));
}else{
// cut the edge of too sharp angles
- PushCoord(buffer[i].GetX() + oax,
- buffer[i].GetY() + oay);
- PushCoord(buffer[i].GetX() + obx,
- buffer[i].GetY() + oby);
+ PushCoord(Vertex2D(buffer[i].GetX() + oax,
+ buffer[i].GetY() + oay));
+ PushCoord(Vertex2D(buffer[i].GetX() + obx,
+ buffer[i].GetY() + oby));
}
}
else {
- PushCoord(buffer[i].GetX()+oax,
- buffer[i].GetY()+oay);
+ PushCoord(Vertex2D(buffer[i].GetX()+oax,
+ buffer[i].GetY()+oay));
}
}
@@ -347,8 +347,8 @@
oax=offset*oax;
oay=offset*oay;
- end=PushCoord(buffer[org.GetEnd()].GetX()+oax,
- buffer[org.GetEnd()].GetY()+oay);
+ end=PushCoord(Vertex2D(buffer[org.GetEnd()].GetX()+oax,
+ buffer[org.GetEnd()].GetY()+oay));
return CoordBufferRange(*this,start,end);
}
@@ -706,8 +706,8 @@
for (size_t i=transBuffer.GetStart(); i<=transBuffer.GetEnd(); i++) {
if (transBuffer.points[i].draw) {
- end=coordBuffer.PushCoord(transBuffer.points[i].x,
- transBuffer.points[i].y);
+ end=coordBuffer.PushCoord(Vertex2D(transBuffer.points[i].x,
+ transBuffer.points[i].y));
if (isStart) {
start=end;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/meson.build
^
|
@@ -1,9 +1,11 @@
project('libosmscout',
'cpp',
- meson_version: '>=0.46.0',
+ version: 'latest',
+ meson_version: '>=0.63.0',
default_options: ['cpp_std=c++17', 'buildtype=debugoptimized', 'warning_level=3'],
- license: ['LGPL'],
- version: '1.1.1')
+ license: ['LGPL'])
+
+libraryVersion='1.1.1'
if build_machine.system()=='darwin'
add_languages(['objcpp'])
@@ -225,8 +227,6 @@
glmDep = dependency('glm', required: false, fallback: ['glm', 'glm_dep'])
glewDep = dependency('glew', required: false, fallback: ['glew', 'glew_dep'])
-# Workaround for dependency, else error under Ubuntu 14.04
-
if build_machine.system()=='darwin' or build_machine.system()=='linux'
glfwDep=dependency('glfw3', required: false)
else
@@ -324,12 +324,15 @@
buildStyleEditor=buildMapQt and buildClientQt and qt6SvgDep.found()
endif
+message('Meson version: @0@'.format(meson.version()))
+message('Project version: @0@'.format(meson.project_version()))
+message('Library version: @0@'.format(libraryVersion))
+message('Project license: @0@'.format(meson.project_license()))
message('Build OS: @0@'.format(build_machine.system()))
message('Host OS: @0@'.format(host_machine.system()))
message('Target OS: @0@'.format(target_machine.system()))
message('compiler id: @0@'.format(compiler.get_id()))
-# meson >= 0.49.0
-#message('compiler arg. syntax: @0@'.format(compiler.get_argument_syntax()))
+message('compiler arg. syntax: @0@'.format(compiler.get_argument_syntax()))
message('openmp support: @0@'.format(openmpDep.found()))
message('C++17 execution support: @0@'.format(stdExecutionAvailable))
message('libosmscout: @0@'.format(true))
@@ -379,7 +382,6 @@
endif
if buildMapIOSX
-# Does not yet work, because we are not able to active std11 support, fixed in meson trunk
subdir('libosmscout-map-iosx')
endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/stylesheets/map.ost
^
|
@@ -51,6 +51,7 @@
* Address
* Website
* Phone
+ * OpeningHours
ADDRESS:
Objects should be indexed as address
It automatically get the following features assigned:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/webpage/content/documentation/_index.md
^
|
@@ -1,7 +1,7 @@
---
-date: "2017-02-27T10:12:00+02:00"
+date: "2019-03-27T08:28:00+01:00"
title: "Documentation"
-description: "Documentration for libosmscout"
+description: "Documentation for libosmscout"
weight: 3
menu:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/webpage/content/documentation/contact.md
^
|
@@ -10,18 +10,28 @@
Weight: 100
---
-The best place to ask questions about Libosmscout is on its mailinglist.
+## Mailing list
-You can find instructions to subscribe to the mailinglist
+There exists a mailing list for libosmscout at sourceforge. The mailing list
+is low traffic, but you can still reach the main developers there.
+
+You can find instructions to subscribe to the mailing list
[here](https://lists.sourceforge.net/lists/listinfo/libosmscout-development).
Note that you must first subscribe to the list. If you send mails to the
-list befor beeing subscribed you either have to wait for the maintainer to pass
+list before being subscribed you either have to wait for the maintainer to pass
them through (which may take a while) or they will never appear on the list at
all.
-You can find a searchable archive of the mailinglist
+You can find a searchable archive of the mailing list
[here](https://sourceforge.net/p/libosmscout/mailman/libosmscout-development/).
+
+## Matrix
+
+There is a public matrix room at `#libosmscout.matrix.org`. While
+it is a chat room, answer may take some time.
+
+## Else
If everything else fails you can contact [Tim Teulings](mailto:tteuling@users.sf.net)
for more information.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/webpage/content/documentation/download.md
^
|
@@ -1,5 +1,5 @@
---
-date: "2016-05-29T19:40:58+02:00"
+date: "2023-03-27T08:16:58+01:00"
title: "Download source"
description: "Where to find the libosmscout sources"
weight: 1
@@ -15,9 +15,9 @@
There are currently no regular source snapshots in form of downloadable archives
or versioned tarballs. You have to download the library sources and the demo
applications manually by cloning the git repository and build everything yourself.
-The sources use CMake or Meson to setup the build.
+The sources use CMake or Meson to set up the build.
-You can browse the repository at https://github.com/Framstag/libosmscout.
+You can browse the repository at [GitHub](https://github.com/Framstag/libosmscout).
To clone the repository use
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/webpage/content/documentation/packages.md
^
|
@@ -1,5 +1,5 @@
---
-date: "2016-05-29T19:40:58+02:00"
+date: "2023-03-27T07:55:58+01:00"
title: "Packages"
description: "Where to find prebuild distribution packages"
weight: 4
@@ -9,8 +9,50 @@
Parent: "documentation"
Weight: 4
---
+
+## Distribution Packages
-There are currently no packages for any distributions. See however documentation
-regarding [docker images]({{< relref "/documentation/docker.md" >}}) as a potential
+There are currently no packages for any distributions. Managing
+distribution packages is a huge effort and there is currently no
+actual spoken out need for them.
+
+## Binary Builds
+
+There are currently no binary releases though this would
+be possible in principle.
+We think however that people that request
+binary builds likely actually want packages.
+
+## Source Packages
+
+We do however create source code-based releases. There are two releases:
+
+- A 'latest' release that gets build everytime something
+ is checked in into master. 'latest' thus represent the latest
+ approved developer snapshot.
+- We do make releases if there is a reasonable number of changes
+ that justify other project to integrate the new version.
+ These releases follow the [CHRONVER](https://chronver.org/)
+ versioning scheme.
+
+The releases are created based on the meson build.
+
+## Package Version
+
+In the meson build the checked-in package version is always 'latest'.
+The automatic builds will modify this version locally during
+release building.
+
+The cmake build will be adapted accordingly.
+
+## Library version
+
+Independently of the package version the **meson** build has a library
+version that uses SEMVER. We currently do not actively manage
+the semver version, but this is subject to change if required.
+
+## Docker Images
+
+See however documentation regarding [docker images]({{< relref "/documentation/docker.md" >}}) as a potential
way to easily get the code building on your system.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/webpage/content/documentation/source.md
^
|
@@ -1,7 +1,7 @@
---
-date: "2016-05-29T19:40:58+02:00"
+date: "2023-03-27T07:55:58+01:00"
title: "Building"
-description: "How to build libosmscout youself"
+description: "How to build libosmscout yourself"
weight: 3
menu:
@@ -35,24 +35,30 @@
Qt5 (optional)
: for the Qt5 backend.
+Qt6 (optional)
+: for the Qt6 backend. The meson build currently supports building
+ against Qt6, however due to changes in Qt6 the software builds
+ but some features are disabled.
+
freeglut (optional),
glu (optional)
: for the OpenGL demo
-Currently the library does compile without any external dependencies, however
+Currently, the library does compile without any external dependencies, however
since you need to be able to import OSM data to make any use of the library
you should at least have libxml2 or protobuf available.
## Supported Build systems, operating systems and compiler
-Libosmscout supports cmake and finally meson. It did support autotools, but this
-support was recently dropped.
+Libosmscout supports [cmake](https://cmake.org/) and [meson](https://mesonbuild.com/) for
+building the software.
-We plan to support cmake because of its wide-spread use and tools support and
+We support cmake because of its wide-spread use and tools support and
meson for its elegance.
-
-We also do support 32bit and also 64bit builds on all platforms, though 32bit builds
-are not actively tested and thus deprecated.
+
+We did support 32bit builds, but there is no CI build to prove this
+anymore. Also, the software, especially the import, very quickly needs
+mor ethan 4GB memory. We support 64bit builds on all platforms.
Support matrix:
@@ -118,22 +124,7 @@
<tr>
<td style="text-align: left">Windows</td>
-<td style="text-align: left">Visual Studio 2015</td>
-<td style="text-align: left">CMake</td>
-<td style="text-align: left">vcpkg</td>
-<td style="text-align: left"></td>
-</tr>
-
-<tr>
-<td style="text-align: left">Windows</td>
-<td style="text-align: left">Visual Studio 2015</td>
-<td style="text-align: left">Meson</td>
-<td style="text-align: left"></td>
-</tr>
-
-<tr>
-<td style="text-align: left">Windows</td>
-<td style="text-align: left">Visual Studio 2017</td>
+<td style="text-align: left">Visual Studio 2019</td>
<td style="text-align: left">CMake</td>
<td style="text-align: left">vcpkg</td>
<td style="text-align: left"></td>
@@ -141,7 +132,7 @@
<tr>
<td style="text-align: left">Windows</td>
-<td style="text-align: left">Visual Studio 2017</td>
+<td style="text-align: left">Visual Studio 2019</td>
<td style="text-align: left">Meson</td>
<td style="text-align: left"></td>
</tr>
@@ -165,21 +156,25 @@
</tbody>
</table>
+## Look at the CI and Docker Builds
+
+For preparing the build environment and for starting builds we
+suggest to take a look at the GitHub Action builds or for the
+docker-based builds as these are current. The documentation here
+may be old and (in some details) not accurate anymore.
## Preparations
-Note, that if your distribution supports Qt4 and Qt5 make
-sure that you install the Qt5 packages. If you have installed Qt4 and Qt5
-packages in parallel you might have to install additional packages that offer
-you ways to default to Qt5 or select Qt5 dynamically (e.g. qt5-default for
-debian).
+Note, that if your distribution supports Qt5 and Qt6, the builds
+will look for QT5. YOu have to explicitly configure the meson
+build to look for Qt6.
### Setup under Linux
The concrete packages you have to install depends on the distribution you use.
Libosmscout provides a number of Docker images under `ci/docker`. take the look at
the corresponding docker file for your distribution and the used `install.sh`and
-`build.sh`scripts to se, how you can setup a valid environment.
+`build.sh`scripts to se, how you can set up a valid environment.
### Setup for VisualStudio
@@ -192,7 +187,7 @@
You can use [vcpkg](https://github.com/Microsoft/vcpkg)
to install required dependencies and build against.
-Currently the following vcpkg dependencies can be used (depending on the libraries you want
+Currently, the following vcpkg dependencies can be used (depending on the libraries you want
to build):
* zlib
@@ -219,7 +214,7 @@
```bash
$ mkdir vcbuild
$ cd vcbuild
-$ cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_TOOLCHAIN_FILE=../../vcpkg\scripts\buildsystems\vcpkg.cmake ..
+$ cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE=../../vcpkg\scripts\buildsystems\vcpkg.cmake ..
$ cmake --build .
```
@@ -275,7 +270,7 @@
$ cmake . -DCMAKE_PREFIX_PATH=[QT5_Installation_prefix]
```
-Note also that native XCode projects doe not have dependency autodetection.
+Note also that native XCode projects does not have dependency autodetection.
As such the dependencies of the libosmsocout libraries and the XCode projects
may differ and have to be adapted. In concrete, the XCode projects assume that
marisa support was build in to the libomscout library, but as this is an
@@ -303,14 +298,14 @@
$ make
```
-This should recursively analyse dependencies for all project sub directories and
+This should recursively analyse dependencies for all project subdirectories and
afterwards build them.
Real life example for building using VisualStudio:
```bash
$ mkdir build
$ cd build
-$ cmake .. -G "Visual Studio 14 2015" -DCMAKE_SYSTEM_VERSION=10.0.10586.0
+$ cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.10586.0
-DCMAKE_INSTALL_PREFIX=D:\Mine\OpenSource\osmlib
$ cmake --build . --config Release --target install
```
@@ -324,17 +319,17 @@
You can then import the Xcode project created in the build directory.
-If you are using a non standard Qt installation directory (likely under Windows),
+If you are using a nonstandard Qt installation directory (likely under Windows),
you might add some additional hints to the cmake call. Relevant are the
variables `QTDIR` and `CMAKE_PREFIX_PATH`.
Example (with also some other libosmscout specific options):
```bash
-$ cmake -G "Visual Studio 14 2015" -DCMAKE_SYSTEM_VERSION=10.0.##### ..
+$ cmake -G "Visual Studio 16 2019" -DCMAKE_SYSTEM_VERSION=10.0.##### ..
-DCMAKE_INSTALL_PREFIX=.\output -DOSMSCOUT_BUILD_IMPORT=OFF
-DOSMSCOUT_BUILD_DOC_API=OFF -DOSMSCOUT_BUILD_TESTS=OFF
--DQTDIR=D:/Tools/Qt/5.9.2/msvc2015
+-DQTDIR=D:/Tools/Qt/5.9.2/msvc2019
-DCMAKE_PREFIX_PATH=D:/Tools/Qt/5.9.2/msvc2015/lib/cmake
```
@@ -352,7 +347,7 @@
```bash
$ mkdir debug
-$ meson debug --backend vs2015
+$ meson debug --backend vs2019
$ cd debug
$ msbuild.exe libosmscout.sln /t:build /p:Configuration=debugoptimized /p:Platform="x64"
```
@@ -366,9 +361,9 @@
For this `LD_LIBRARY_PATH` has to be extended. See the `setupAutoconf.sh`
script in the top level directory for how to do it.
-Note that current Mac OS X versions doe not support additional
+Note that current Mac OS X versions does not support additional
library search paths via environment variables anymore. Location of the
-library hass to be set during compile. cmake and autoconf (and libtool) based
+library has to be set during compile. cmake and autoconf (and libtool) based
do this correctly, the qmake build for OSMScout2 and Styleconfig currently
does not.
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/graphics/cover-2.29.svg
^
|
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="845"
+ height="422"
+ id="svg2054"
+ version="1.1"
+ sodipodi:docname="cover-2.17.svg"
+ inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata
+ id="metadata14">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs12">
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect68354"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect67275"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect61307"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect60161"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect58467"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect52944"
+ is_visible="true"
+ lpeversion="1" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter51493"
+ x="-0.2313123"
+ y="-0.37891728"
+ width="1.4626246"
+ height="1.7578346">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.0860482"
+ id="feGaussianBlur51495" />
+ </filter>
+ <meshgradient
+ inkscape:collect="always"
+ id="meshgradient21283"
+ gradientUnits="userSpaceOnUse"
+ x="-332.61957"
+ y="814.60327">
+ <meshrow
+ id="meshrow47633">
+ <meshpatch
+ id="meshpatch47635">
+ <stop
+ path="c 5.2076,-5.43232e-05 13.5814,1.93095 18.7891,1.93095"
+ style="stop-color:#ffffff;stop-opacity:1"
+ id="stop47637" />
+ <stop
+ path="c 0.22361,7.77765 -1.84395,8.97825 -1.84406,16.3893"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47639" />
+ <stop
+ path="c -5.20756,0.000281765 -8.57128,5.84397 -13.779,5.84397"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47641" />
+ <stop
+ path="c 0,-7.41092 -3.16582,-16.7528 -3.16604,-24.1642"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47643" />
+ </meshpatch>
+ <meshpatch
+ id="meshpatch47645">
+ <stop
+ path="c 5.2077,0 9.81985,0.929076 15.0274,0.929122"
+ id="stop47647" />
+ <stop
+ path="c 0.000144097,7.41081 0.595604,13.893 0.595604,21.3039"
+ style="stop-color:#5b471d;stop-opacity:1"
+ id="stop47649" />
+ <stop
+ path="c -2.11035,-6.44281 -10.3606,-5.23983 -17.4671,-5.84374"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47651" />
+ </meshpatch>
+ </meshrow>
+ <meshrow
+ id="meshrow47653">
+ <meshpatch
+ id="meshpatch47655">
+ <stop
+ path="c -1.68717,14.2356 1.43271,21.6624 1.84406,28.0763"
+ id="stop47657" />
+ <stop
+ path="c -5.2077,0 -10.4154,0 -15.6231,1.13687e-13"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47659" />
+ <stop
+ path="c -5.68434e-14,-7.41092 -5.68434e-14,-14.8218 4e-05,-22.2324"
+ style="stop-color:#cbb55e;stop-opacity:1"
+ id="stop47661" />
+ </meshpatch>
+ <meshpatch
+ id="meshpatch47663">
+ <stop
+ path="c 0,7.41092 -4.3727,6.98682 -4.37276,14.3978"
+ id="stop47665" />
+ <stop
+ path="c -5.20757,-0.000164599 -6.04249,7.83479 -11.2502,7.83478"
+ style="stop-color:#1f180a;stop-opacity:1"
+ id="stop47667" />
+ </meshpatch>
+ </meshrow>
+ </meshgradient>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter48085"
+ x="-0.011683676"
+ y="-0.0082102014"
+ width="1.0233674"
+ height="1.0164204">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.1521128"
+ id="feGaussianBlur48087" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1136"
+ id="namedview10"
+ showgrid="false"
+ inkscape:zoom="0.87407407"
+ inkscape:cx="353.51695"
+ inkscape:cy="253.98305"
+ inkscape:window-x="1920"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2054"
+ inkscape:pagecheckerboard="0" />
+ <image
+ sodipodi:absref="/home/karry/SailfishOS/projects/osmscout-sailfish/graphics/cover-2.17.jpg"
+ xlink:href="cover-2.17.jpg"
+ y="0"
+ x="0"
+ id="image892"
+ style="image-rendering:optimizeSpeed"
+ preserveAspectRatio="none"
+ height="422"
+ width="845" />
+ <g
+ id="label"
+ transform="matrix(1.4841993,0,0,1.4841993,49.48781,-1166.5396)"
+ style="opacity:1">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:50px;line-height:99%;font-family:Arial;-inkscape-font-specification:Arial;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
+ x="263.37292"
+ y="835.81036"
+ id="text4187"><tspan
+ style="fill:#411f11;fill-opacity:0.734982"
|
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/pics/cover.jpg
^
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/qml/custom/OpeningHoursRow.qml
^
|
@@ -0,0 +1,57 @@
+/*
+ OSM Scout for Sailfish OS
+ Copyright (C) 2023 Lukas Karas
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+import harbour.osmscout.map 1.0
+
+Row {
+ id: openingHoursRow
+
+ property alias openingHours: model.openingHours
+
+ OpeningHoursModel {
+ id: model
+ property string todayStr: model.today.join(", ")
+ onParseError: {
+ console.log("openingHours parse error: " + openingHours);
+ }
+ }
+
+ width: parent.width
+ height: openingHoursIcon.height
+
+ IconButton {
+ id: openingHoursIcon
+
+ icon.source: "image://theme/icon-m-clock"
+ visible: openingHours!=""
+ }
+
+ Label {
+ id: openingHoursLabel
+
+ anchors.left: openingHoursIcon.right
+ anchors.verticalCenter: openingHoursIcon.verticalCenter
+ text: model.todayStr!="" ? model.todayStr : openingHours
+ color: Theme.highlightColor
+ truncationMode: TruncationMode.Fade
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/qml/pages/MapPage.qml
^
|
@@ -642,9 +642,10 @@
}
onIconTapped: {
- //(QPoint screenCoord, double lat, double lon, QString databasePath,
- // QString objectType, quint64 objectId, int poiId, QString type,
- // QString name, QString altName, QString ref, QString operatorName, QString phone, QString website);
+ // void iconTapped(QPoint screenCoord, double lat, double lon, QString databasePath,
+ // QString objectType, quint64 objectId, int poiId, QString type,
+ // QString name, QString altName, QString ref, QString operatorName, QString phone, QString website,
+ // QString openingHours);
poiBox.objectType = objectType;
poiBox.objectId = objectId;
poiBox.poiId = poiId;
@@ -655,6 +656,7 @@
poiBox.operatorName = operatorName;
poiBox.phone = phone;
poiBox.website = website;
+ poiBox.openingHours = openingHours;
poiBox.lat = lat;
poiBox.lon = lon;
poiBox.show();
@@ -954,6 +956,7 @@
property string operatorName: ""
property string phone: ""
property string website: ""
+ property string openingHours: ""
function hide() {
state = "HIDDEN";
@@ -1059,6 +1062,7 @@
color: Theme.secondaryColor
}
Label {
+ id: poiNameLabel
width: poiBox.width - poiIcon.width - (2*Theme.paddingSmall)
property string nameFormated: settings.showAltLanguage && poiBox.altName != "" ?
(poiBox.altName + (poiBox.name != ""? " (" +poiBox.name+ ")" : "")) :
@@ -1076,6 +1080,21 @@
website: poiBox.website
visible: poiBox.website!="" && poiBox.state == "INFORMATIVE"
}
+ OpeningHoursRow {
+ id: openingHoursRow
+ openingHours: poiBox.openingHours
+ visible: poiBox.openingHours!="" && poiBox.state == "INFORMATIVE"
+ MouseArea {
+ onClicked: {
+ pageStack.push(Qt.resolvedUrl("OpeningHours.qml"), {
+ "name": poiNameLabel.text,
+ "type": poiBox.type,
+ "openingHours": poiBox.openingHours
+ });
+ }
+ anchors.fill: parent
+ }
+ }
Row{
id : placeTools
visible: poiBox.state == "INFORMATIVE"
@@ -1515,7 +1534,7 @@
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
- width: height
+ width: height
fillMode: Image.PreserveAspectFit
horizontalAlignment: Image.AlignHCenter
verticalAlignment: Image.AlignLeft
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/qml/pages/OpeningHours.qml
^
|
@@ -0,0 +1,136 @@
+/*
+ OSM Scout for Sailfish OS
+ Copyright (C) 2023 Lukas Karas
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+import harbour.osmscout.map 1.0
+
+import "../custom"
+import "../custom/Utils.js" as Utils
+
+Page {
+ id: openingHoursPage
+
+ property string name: ""
+ property string type: ""
+ property alias openingHours: objectTypeModel.openingHours
+
+ OpeningHoursModel {
+ id: objectTypeModel
+
+ property string todayStr: objectTypeModel.today.join(", ")
+
+ onParseError: {
+ console.log("openingHours parse error: " + openingHours);
+ }
+ }
+ Settings {
+ id: settings
+ }
+
+ SilicaListView {
+ id: listView
+
+ anchors.fill: parent
+ spacing: Theme.paddingMedium
+ x: Theme.paddingMedium
+ clip: true
+ currentIndex: -1 // otherwise currentItem will steal focus
+ model: objectTypeModel
+
+ VerticalScrollDecorator {
+ }
+
+ header: Column {
+ PageHeader {
+ id: header
+
+ width: listView.width
+ title: qsTr("Opening hours")
+ }
+
+ Row {
+ POIIcon {
+ id: poiIcon
+
+ poiType: openingHoursPage.type
+ width: Theme.iconSizeMedium
+ height: Theme.iconSizeMedium
+ }
+ Label {
+ width: listView.width - poiIcon.width - (2 * Theme.paddingSmall)
+ text: openingHoursPage.name
+ font.pixelSize: Theme.fontSizeExtraLarge
+ }
+ }
+ Text {
+ font.pixelSize: Theme.fontSizeSmall
+ wrapMode: Text.Wrap
+ text: objectTypeModel.openingHours
+ visible: objectTypeModel.rowCount()==0 // parsing failed
+ color: Theme.secondaryHighlightColor
+ textFormat: Text.PlainText
+ anchors {
+ left: parent.left
+ right: parent.right
+ topMargin: Theme.paddingSmall
+ leftMargin: Theme.paddingSmall
+ rightMargin: Theme.paddingSmall
+ }
+ }
+ }
+
+ delegate: BackgroundItem {
+ id: item
+
+ highlighted: isToday
+
+ Text {
+ id: labelText
+
+ y: Theme.paddingSmall
+ width: Math.max(parent.width*0.25, 300)
+ anchors {
+ left: parent.left
+ rightMargin: Theme.paddingSmall
+ }
+ horizontalAlignment: Text.AlignRight
+ color: Theme.secondaryHighlightColor
+ font.pixelSize: Theme.fontSizeMedium
+ textFormat: Text.PlainText
+ wrapMode: Text.Wrap
+ text: model.day
+ }
+
+ Text {
+ id: valueText
+
+ y: Theme.paddingSmall
+ x: labelText.width + Theme.paddingSmall
+ width: parent.width-(x+Theme.paddingSmall)
+ horizontalAlignment: Text.AlignLeft
+ color: Theme.highlightColor
+ font.pixelSize: Theme.fontSizeMedium
+ textFormat: Text.PlainText
+ wrapMode: Text.Wrap
+ text: model.timeIntervals.join(", ")
+ }
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/qml/pages/PlaceDetail.qml
^
|
@@ -301,8 +301,20 @@
id: websiteRow
website: model.website
}
-
-
+ OpeningHoursRow {
+ id: openingHoursRow
+ openingHours: model.openingHours
+ MouseArea {
+ onClicked: {
+ pageStack.push(Qt.resolvedUrl("OpeningHours.qml"), {
+ "name": entryPoi.text,
+ "type": model.type,
+ "openingHours": model.openingHours
+ });
+ }
+ anchors.fill: parent
+ }
+ }
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/qml/pages/Search.qml
^
|
@@ -595,7 +595,11 @@
latitude: selectedLocation.lat,
longitude: selectedLocation.lon,
acceptDestination: searchPage,
- name: model.label,
+ name: (model.type==="coordinate") ?
+ Utils.formatCoord(lat, lon, AppSettings.gpsFormat) :
+ (settings.showAltLanguage && model.altLangName !== "" ?
+ (model.altLangName + (model.label!=="" ? " (" + model.label +")" : "")) :
+ model.label),
description: entryRegion.text
});
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/scripts/deploy.sh
^
|
@@ -15,7 +15,7 @@
##################################################################
## configure SDK
PATH=$PATH:~/SailfishOS/bin/
-export OS_VERSION=${OS_VERSION:-4.4.0.58}
+export OS_VERSION=${OS_VERSION:-4.5.0.18}
# device may be configured in SailfishOS SDK
if [ $# -ge 2 ] ; then
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/scripts/transifexPull.sh
^
|
@@ -1,4 +1,4 @@
#!/bin/bash
set -xe
-/usr/bin/tx -d pull -a "$@"
+tx pull -a "$@"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/scripts/transifexPush.sh
^
|
@@ -1,3 +1,3 @@
#!/bin/bash
set -xe
-/usr/bin/tx -d push -st "$@"
+tx push -st "$@"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/src/CollectionModel.cpp
^
|
@@ -193,7 +193,7 @@
return std::get<Track>(item).creationTime;
} else {
assert(std::holds_alternative<Waypoint>(item));
- return timestampToDateTime(std::get<Waypoint>(item).data.time);
+ return timestampToDateTime(std::get<Waypoint>(item).data.timestamp);
}
};
@@ -342,7 +342,7 @@
case LongitudeRole: return waypoint.data.coord.GetLon();
case ElevationRole: return waypoint.data.elevation.has_value() ? *(waypoint.data.elevation) : QVariant();
- case TimeRole: return timestampToDateTime(waypoint.data.time);
+ case TimeRole: return timestampToDateTime(waypoint.data.timestamp);
case LastModificationRole: return waypoint.lastModification;
case VisibleRole: return waypoint.visible;
case ColorRole: return waypointColor(waypoint.data.symbol);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/src/NearWaypointModel.cpp
^
|
@@ -123,7 +123,7 @@
const auto& [distance, waypoint]=items.at(row);
- // QML will take ownerhip
+ // QML will take ownership
return new osmscout::LocationEntry(
osmscout::LocationEntry::typeObject,
QString::fromStdString(waypoint.data.name ? waypoint.data.name.value() : waypoint.data.coord.GetDisplayText()),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/src/OSMScout.cpp
^
|
@@ -25,7 +25,6 @@
#include "IconProvider.h" // IconProvider
#include "Arguments.h"
#include "MemoryManager.h"
-#include "Migration.h"
#include "LocFile.h"
// collections
@@ -199,19 +198,6 @@
QStringList databaseLookupDirectories;
- { // TODO: remove this migration when Sailjail will be really enabled (old paths will be unavailable)
- Migration migration("", "harbour-osmscout");
- // migrate to new path used with Sailjail:
- migration.migrateConfig(); // ~/.config/harbour-osmscout/harbour-osmscout.conf -> ~/.config/cz.karry.osmscout/OSMScout/OSMScout.conf
- migration.migrateLocal(); // ~/.local/share/harbour-osmscout/harbour-osmscout -> ~/.local/share/cz.karry.osmscout/OSMScout
- migration.wipeOldCache(); // wipe ~/.cache/harbour-osmscout/harbour-osmscout/
- // ~/Maps -> ~/Downloads/Maps
- if (!migration.migrate(homeDir + QDir::separator() + "Maps", downloadDir + QDir::separator() + "Maps")) {
- // possibly ~/Documents/Maps -> ~/Downloads/Maps
- migration.migrate(docsDir + QDir::separator() + "Maps", downloadDir + QDir::separator() + "Maps");
- }
- }
-
// lookup Maps in "Downloads" directory
databaseLookupDirectories << downloadDir + QDir::separator() + "Maps";
@@ -255,9 +241,9 @@
.AddOnlineTileProviders(SailfishApp::pathTo("resources/online-tile-providers.json").toLocalFile())
.AddOnlineTileProviders(dataDir + QDir::separator() + "online-tile-providers.json")
.AddMapProviders(SailfishApp::pathTo("resources/map-providers.json").toLocalFile())
- .AddOnlineTileProviders(dataDir + QDir::separator() + "map-providers.json")
+ .AddMapProviders(dataDir + QDir::separator() + "map-providers.json")
.AddVoiceProviders(SailfishApp::pathTo("resources/voice-providers.json").toLocalFile())
- .AddOnlineTileProviders(dataDir + QDir::separator() + "voice-providers.json")
+ .AddVoiceProviders(dataDir + QDir::separator() + "voice-providers.json")
.WithBasemapLookupDirectory(SailfishApp::pathTo("resources/world").toLocalFile())
.WithMapLookupDirectories(databaseLookupDirectories)
.AddCustomPoiType("_highlighted")
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/src/PerformanceTest.cpp
^
|
@@ -73,6 +73,8 @@
#include <osmscout/util/StopClock.h>
#include <osmscout/util/Tiling.h>
+#include <osmscout/projection/TileProjection.h>
+
/*
Example for the nordrhein-westfalen.osm (to be executed in the Demos top
level directory), drawing the "Ruhrgebiet":
@@ -699,7 +701,7 @@
args.TileWidth(),
args.TileHeight());
- projection.GetDimensions(boundingBox);
+ boundingBox=projection.GetDimensions();
projection.SetLinearInterpolationUsage(level.Get() >= 10);
for (size_t i=0; i<args.loadRepeat; i++) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/src/PositionSimulator.cpp
^
|
@@ -103,8 +103,8 @@
segmentStart=points[0];
segmentEnd=points[points.size()-1];
- if (segmentStart.time){
- simulationTime=*segmentStart.time;
+ if (segmentStart.timestamp){
+ simulationTime=*segmentStart.timestamp;
}else{
simulationTime=Now();
}
@@ -151,17 +151,19 @@
while (true){
if (currentPoint<points.size()) {
auto &point=points[currentPoint];
- if (point.time && *point.time > simulationTime){
+ if (point.timestamp && *point.timestamp > simulationTime){
return;
}
- osmscout::log.Debug() << "Simulator point: " << osmscout::TimestampToISO8601TimeString(point.time.value_or(simulationTime)) << " @ " << point.coord.GetDisplayText();
+ osmscout::log.Debug() << "Simulator point: "
+ << osmscout::TimestampToISO8601TimeString(point.timestamp.value_or(simulationTime))
+ << " @ " << point.coord.GetDisplayText();
currentPosition=point.coord;
emit positionChanged(currentPosition.GetLat(), currentPosition.GetLon(),
point.hdop.has_value(), point.hdop.value_or(0),
point.elevation.has_value(), point.elevation.value_or(0),
point.vdop.has_value(), point.vdop.value_or(0));
currentPoint++;
- if (!point.time){
+ if (!point.timestamp){
return;
}
}else{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/src/Storage.cpp
^
|
@@ -62,11 +62,11 @@
void MaxSpeedBuffer::insert(const gpx::TrackPoint &p)
{
- if (!p.time){
+ if (!p.timestamp){
return;
}
if (lastPoint){
- Timestamp::duration timeDiff = *(p.time) - *(lastPoint->time);
+ Timestamp::duration timeDiff = *(p.timestamp) - *(lastPoint->timestamp);
if (timeDiff.count() < 0){
qWarning() << "Traveling in time is not supported";
return;
@@ -131,9 +131,9 @@
if (lastPoint) {
Distance distanceDiff = GetEllipsoidalDistance(lastPoint->coord, p.coord);
bool flushBuffer = false;
- if (p.time && lastPoint->time) {
+ if (p.timestamp && lastPoint->timestamp) {
using SecondDuration = std::chrono::duration<double, std::ratio<1>>;
- double timeDiff = duration_cast<SecondDuration>(*(p.time) - *(lastPoint->time)).count();
+ double timeDiff = duration_cast<SecondDuration>(*(p.timestamp) - *(lastPoint->timestamp)).count();
if (timeDiff > 0) {
Distance eleDiff = Meters(*(p.elevation) - *(lastPoint->elevation));
double speed = std::abs(eleDiff.AsMeter()) / timeDiff; // m/s
@@ -790,7 +790,7 @@
QVariant timestampVar = sql.value("timestamp");
if (!timestampVar.isNull()) {
- wpt.time = dateTimeToTimestamp(varToDateTime(timestampVar));
+ wpt.timestamp = dateTimeToTimestamp(varToDateTime(timestampVar));
}
wpt.elevation = varToDoubleOpt(sql.value("elevation"));
@@ -916,7 +916,7 @@
));
gpx::TrackPoint &point = segment.points.back();
- point.time = varLongToOptTimestamp(sql.value(iTimestamp));
+ point.timestamp = varLongToOptTimestamp(sql.value(iTimestamp));
point.elevation = varToDoubleOpt(sql.value(iElevation));
// see TrackPoint notes
@@ -1186,7 +1186,7 @@
wptName = tr("waypoint %1").arg(wptNum);
sqlWpt.bindValue(":collection_id", collectionId);
- sqlWpt.bindValue(":timestamp", dateTimeToSQL(timestampToDateTime(wpt.time)));
+ sqlWpt.bindValue(":timestamp", dateTimeToSQL(timestampToDateTime(wpt.timestamp)));
sqlWpt.bindValue(":modification_time", dateTimeToSQL(QDateTime::currentDateTime()));
sqlWpt.bindValue(":latitude", wpt.coord.GetLat());
sqlWpt.bindValue(":longitude", wpt.coord.GetLon());
@@ -1268,8 +1268,8 @@
rawCount++;
// time computation
- if (p.time.has_value()){
- to=p.time;
+ if (p.timestamp.has_value()){
+ to=p.timestamp;
if (!from.has_value()){
from=to;
}
@@ -1291,15 +1291,15 @@
lastCoord = p.coord;
// max speed
- if (filter && p.time) {
+ if (filter && p.timestamp) {
if (previousTime) {
maxSpeedBuf.insert(p);
- auto diff = *(p.time) - *previousTime;
+ auto diff = *(p.timestamp) - *previousTime;
if (diff < minutes(5)) {
movingDuration += diff;
}
}
- previousTime=p.time;
+ previousTime=p.timestamp;
}
// elevation
@@ -1543,7 +1543,7 @@
pointNum ++;
sql.bindValue(":segment_id", segmentId);
- sql.bindValue(":timestamp", dateTimeToSQL(timestampToDateTime(point.time)));
+ sql.bindValue(":timestamp", dateTimeToSQL(timestampToDateTime(point.timestamp)));
sql.bindValue(":latitude", point.coord.GetLat());
sql.bindValue(":longitude", point.coord.GetLon());
sql.bindValue(":elevation", point.elevation.has_value() ? *point.elevation : QVariant());
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/src/Tracker.cpp
^
|
@@ -230,8 +230,8 @@
using namespace osmscout;
gpx::TrackPoint point(GeoCoord(lat, lon));
- point.time=converters::dateTimeToTimestampOpt(timestamp); // use time from gps
- assert(point.time.has_value());
+ point.timestamp=converters::dateTimeToTimestampOpt(timestamp); // use time from gps
+ assert(point.timestamp.has_value());
if (elevationValid) {
point.elevation=elevation;
}
@@ -247,9 +247,9 @@
Timestamp::duration diffFromFirst;
Distance distanceFromLast;
if (!batch->empty()){
- assert(batch->back().time.has_value());
- diffFromLast = *(point.time) - *(batch->back().time);
- diffFromFirst = *(point.time) - *(batch->front().time);
+ assert(batch->back().timestamp.has_value());
+ diffFromLast = *(point.timestamp) - *(batch->back().timestamp);
+ diffFromFirst = *(point.timestamp) - *(batch->front().timestamp);
distanceFromLast = GetEllipsoidalDistance(point.coord, batch->back().coord);
if (diffFromLast < Timestamp::duration::zero()){
qWarning() << "Clock move to the past by " <<
@@ -259,7 +259,7 @@
} else {
// track resumed
if (accumulator.getTo()){
- diffFromLast = *(point.time) - *(accumulator.getTo());
+ diffFromLast = *(point.timestamp) - *(accumulator.getTo());
distanceFromLast = Kilometers(42); // always start with the new segment on track resume (and track is not "empty")
}else {
diffFromLast = Timestamp::duration::zero();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/cs.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation>Otevírací doba</translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation>zavřeno</translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Státní svátky</translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Školní prázdniny</translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation>Státní svátky</translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation>Školní prázdniny</translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/de.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/en.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/es.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/et.ts
^
|
@@ -576,7 +576,7 @@
</message>
<message>
<source>Pull down to import collection or create empty one</source>
- <translation type="unfinished"></translation>
+ <translation>Kogumiku importimiseks või uue loomiseks viipa ülamenüüst</translation>
</message>
</context>
<context>
@@ -927,7 +927,7 @@
</message>
<message>
<source>Scroll down for more entries</source>
- <translation type="unfinished"></translation>
+ <translation>Täiendavate kirjete nägemiseks viipa allapoole</translation>
</message>
</context>
<context>
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -1761,7 +1796,7 @@
</message>
<message>
<source>You can return to the map, tracking will continue on background</source>
- <translation type="unfinished"></translation>
+ <translation>Võid uuesti kaardivaate avada ning raja salvestamine jätkub taustal</translation>
</message>
</context>
<context>
@@ -1832,78 +1867,78 @@
</message>
<message numerus="yes">
<source>%n miles</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n miil</numerusform>
+ <numerusform>%n miili</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n meters</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>% meeter</numerusform>
+ <numerusform>%n meetrit</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n km</source>
<extracomment>N kilometers</extracomment>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n km</numerusform>
+ <numerusform>%n km</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n ft</source>
<extracomment>N feet</extracomment>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n ft</numerusform>
+ <numerusform>%n ft</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n mi</source>
<extracomment>N miles</extracomment>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n mi</numerusform>
+ <numerusform>%n mi</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n m</source>
<extracomment>N meters</extracomment>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n m</numerusform>
+ <numerusform>%n m</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n feet</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n jalg</numerusform>
+ <numerusform>%n jalga</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n yards</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n jard</numerusform>
+ <numerusform>%n jardi</numerusform>
</translation>
</message>
<message>
<source>%1 miles</source>
<extracomment>fraction of miles, %n cannot be used</extracomment>
- <translation type="unfinished"></translation>
+ <translation>%1 miili</translation>
</message>
<message>
<source>%1 km</source>
<extracomment>fraction of kilometers, %n cannot be used</extracomment>
- <translation type="unfinished"></translation>
+ <translation>%1 km</translation>
</message>
<message>
<source>%1 mi</source>
<extracomment>fraction of miles, %n cannot be used</extracomment>
- <translation type="unfinished"></translation>
+ <translation>%1 mi</translation>
</message>
</context>
<context>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/fa.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/fr.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/hu.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/it.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/nb.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/nl.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/nl_BE.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/pl.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/pt_BR.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/ru.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/sv.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation>Öppettider</translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation>stängd</translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Helgdag</translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Skollov</translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation>Hd</translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation>Sl</translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/translations/zh_CN.ts
^
|
@@ -976,6 +976,41 @@
</message>
</context>
<context>
+ <name>OpeningHours</name>
+ <message>
+ <source>Opening hours</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.changes.in
^
|
@@ -582,3 +582,13 @@
- improve loading time of collections (added database indexes)
- fix decoding of %xx escaping in geo: uri
- new icon ;-)
+
+* 2023-04-25 Lukáš Karas <lukas.karas@centrum.cz> 2.29
+- update translations (Czech, Estonian, Swedish)
+- parse location coordinates format used on booking.com in search
+- optimize memory usage during search
+- remove Sailjail data migration code
+- fix rare crash during rendering - it happened sometimes with outdoor map style during navigation
+- fix infinite loop in router when entering mini roundabout from oneway
+- fix routing via junctions with turn restrictions
+- support for simple POI opening hours
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.yaml
^
|
@@ -1,6 +1,6 @@
Name: harbour-osmscout
Summary: OSMScout for Sailfish
-Version: 2.28
+Version: 2.29
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
|