[-]
[+]
|
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.29</param>
+ <param name="revision">v2.30</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/TypeFeatures.h
^
|
@@ -1,2395 +0,0 @@
-#ifndef OSMSCOUT_FEATURES_H
-#define OSMSCOUT_FEATURES_H
-
-/*
- This source is part of the libosmscout library
- Copyright (C) 2014 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 <cstdint>
-#include <limits>
-#include <unordered_map>
-
-#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeature.h>
-
-#include <osmscout/util/Color.h>
-#include <osmscout/util/LaneTurn.h>
-
-namespace osmscout {
-
- class OSMSCOUT_API NameFeatureValue : public FeatureValue
- {
- private:
- std::string name;
-
- public:
- NameFeatureValue() = default;
- NameFeatureValue(const NameFeatureValue& featureValue) = default;
-
- explicit NameFeatureValue(const std::string& name)
- : name(name)
- {
- // no code
- }
-
- void SetName(const std::string& name)
- {
- this->name=name;
- }
-
- std::string GetName() const
- {
- return name;
- }
-
- std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
- {
- return name;
- }
-
- void Read(FileScanner& scanner) override;
- void Write(FileWriter& writer) override;
-
- NameFeatureValue& operator=(const FeatureValue& other) override;
- bool operator==(const FeatureValue& other) const override;
- };
-
- class OSMSCOUT_API NameFeature : public Feature
- {
- public:
- /** Name of this feature */
- static const char* const NAME;
-
- /** Name of the "name" label */
- static const char* const NAME_LABEL;
-
- /** Index of the 'name' label */
- static const size_t NAME_LABEL_INDEX;
-
- public:
- NameFeature();
- 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 NameAltFeatureValue : public FeatureValue
- {
- private:
- std::string nameAlt;
-
- public:
- NameAltFeatureValue() = default;
- NameAltFeatureValue(const NameAltFeatureValue& featureValue) = default;
-
- explicit NameAltFeatureValue(const std::string& nameAlt)
- : nameAlt(nameAlt)
- {
- // no code
- }
-
- void SetNameAlt(const std::string& nameAlt)
- {
- this->nameAlt=nameAlt;
- }
-
- std::string GetNameAlt() const
- {
- return nameAlt;
- }
-
- std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
- {
- return nameAlt;
- }
-
- void Read(FileScanner& scanner) override;
- void Write(FileWriter& writer) override;
-
- NameAltFeatureValue& operator=(const FeatureValue& other) override;
- bool operator==(const FeatureValue& other) const override;
- };
-
- class OSMSCOUT_API NameAltFeature : public Feature
- {
- public:
- /** Name of this feature */
- static const char* const NAME;
-
- /** Name of the "name" label */
- static const char* const NAME_LABEL;
-
- /** Index of the 'name' label */
- static const size_t NAME_LABEL_INDEX;
-
- public:
- NameAltFeature();
- 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 NameShortFeatureValue : public FeatureValue
- {
- private:
- std::string nameShort;
-
- public:
- NameShortFeatureValue() = default;
-
- explicit NameShortFeatureValue(const std::string& nameShort)
- : nameShort(nameShort)
- {
- // no code
- }
-
- void SetNameShort(const std::string& nameShort)
- {
- this->nameShort=nameShort;
- }
-
- std::string GetNameShort() const
- {
- return nameShort;
- }
-
- std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
- {
- return nameShort;
- }
-
- void Read(FileScanner& scanner) override;
- void Write(FileWriter& writer) override;
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.29.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/TypeFeatures.cpp
^
|
@@ -1,3516 +0,0 @@
- /*
- This source is part of the libosmscout library
- Copyright (C) 2014 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/TypeFeatures.h>
-
-#include <algorithm>
-
-#include <osmscout/util/String.h>
-
-#include <iostream>
-#include <iomanip>
-#include <set>
-#include <sstream>
-
-namespace osmscout {
-
- void NameFeatureValue::Read(FileScanner& scanner)
- {
- name=scanner.ReadString();
- }
-
- void NameFeatureValue::Write(FileWriter& writer)
- {
- writer.Write(name);
- }
-
-
- NameFeatureValue& NameFeatureValue::operator=(const FeatureValue& other)
- {
- if (this!=&other) {
- const auto& otherValue=static_cast<const NameFeatureValue&>(other);
-
- name=otherValue.name;
- }
-
- return *this;
- }
-
- bool NameFeatureValue::operator==(const FeatureValue& other) const
- {
- const auto& otherValue=static_cast<const NameFeatureValue&>(other);
-
- return name==otherValue.name;
- }
-
- const char* const NameFeature::NAME = "Name";
- const char* const NameFeature::NAME_LABEL = "name";
- const size_t NameFeature::NAME_LABEL_INDEX = 0;
-
-
- NameFeature::NameFeature()
- {
- RegisterLabel(NAME_LABEL_INDEX,
- NAME_LABEL);
- }
-
- void NameFeature::Initialize(TagRegistry& /*tagRegistry*/)
- {
- // no code
- }
-
- std::string NameFeature::GetName() const
- {
- return NAME;
- }
-
- size_t NameFeature::GetValueAlignment() const
- {
- return alignof(NameFeatureValue);
- }
-
- size_t NameFeature::GetValueSize() const
- {
- return sizeof(NameFeatureValue);
- }
-
- FeatureValue* NameFeature::AllocateValue(void* buffer)
- {
- return new (buffer) NameFeatureValue();
- }
-
- void NameFeature::Parse(TagErrorReporter& /*errorReporter*/,
- const TagRegistry& tagRegistry,
- const FeatureInstance& feature,
- const ObjectOSMRef& /*object*/,
- const TagMap& tags,
- FeatureValueBuffer& buffer) const
- {
- std::string name;
- uint32_t namePriority=std::numeric_limits<uint32_t>::max();
-
- for (const auto &tag : tags) {
- uint32_t ntPrio;
- bool isNameTag=tagRegistry.IsNameTag(tag.first,ntPrio);
-
- if (isNameTag &&
- (name.empty() || ntPrio<namePriority)) {
- name=tag.second;
- namePriority=ntPrio;
- }
- }
-
- if (!name.empty()) {
- auto* value=static_cast<NameFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
-
- value->SetName(name);
- }
- }
-
- void NameAltFeatureValue::Read(FileScanner& scanner)
- {
- nameAlt=scanner.ReadString();
- }
-
- void NameAltFeatureValue::Write(FileWriter& writer)
- {
- writer.Write(nameAlt);
- }
-
- NameAltFeatureValue& NameAltFeatureValue::operator=(const FeatureValue& other)
- {
- if (this!=&other) {
- const auto& otherValue=static_cast<const NameAltFeatureValue&>(other);
-
- nameAlt=otherValue.nameAlt;
- }
-
- return *this;
- }
-
- bool NameAltFeatureValue::operator==(const FeatureValue& other) const
- {
- const auto& otherValue=static_cast<const NameAltFeatureValue&>(other);
-
- return nameAlt==otherValue.nameAlt;
- }
-
- const char* const NameAltFeature::NAME = "NameAlt";
- const char* const NameAltFeature::NAME_LABEL = "name";
- const size_t NameAltFeature::NAME_LABEL_INDEX = 0;
-
- void NameAltFeature::Initialize(TagRegistry& /*tagRegistry*/)
- {
- // no code
- }
-
- NameAltFeature::NameAltFeature()
- {
- RegisterLabel(NAME_LABEL_INDEX,
- NAME_LABEL);
- }
-
- std::string NameAltFeature::GetName() const
- {
- return NAME;
- }
-
- size_t NameAltFeature::GetValueAlignment() const
- {
- return alignof(NameAltFeatureValue);
- }
-
- size_t NameAltFeature::GetValueSize() const
- {
- return sizeof(NameAltFeatureValue);
- }
-
- FeatureValue* NameAltFeature::AllocateValue(void* buffer)
- {
- return new (buffer) NameAltFeatureValue();
- }
-
- void NameAltFeature::Parse(TagErrorReporter& /*errorReporter*/,
- const TagRegistry& tagRegistry,
- const FeatureInstance& feature,
- const ObjectOSMRef& /*object*/,
- const TagMap& tags,
- FeatureValueBuffer& buffer) const
- {
- std::string nameAlt;
- uint32_t nameAltPriority=std::numeric_limits<uint32_t>::max();
-
- for (const auto &tag : tags) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.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.29.0 LANGUAGES C CXX)
+project(osmscout-sailfish VERSION 2.30.0 LANGUAGES C CXX)
# ==================================================================================================
# Information to update before to release this package.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_ios.yml
^
|
@@ -13,7 +13,7 @@
jobs:
build_cmake:
name: cmake
- runs-on: macos-10.15
+ runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_osx.yml
^
|
@@ -13,7 +13,7 @@
jobs:
build_meson:
name: meson
- runs-on: macos-10.15
+ runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -32,7 +32,7 @@
build_cmake:
name: cmake
- runs-on: macos-10.15
+ runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_vs2019.yml
^
|
@@ -84,9 +84,6 @@
uses: actions/setup-python@v4
with:
python-version: '3.x'
- # https://github.com/mesonbuild/meson/issues/9955#issuecomment-1030843844
- - name: Downgrade pip
- run: python -m pip install -U pip==21.3.1
- name: Install meson and ninja
run: pip install meson ninja
- name: Prepare MSVC
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/.gitignore
^
|
@@ -26,10 +26,18 @@
/debug/
/release/
+# JReleaser
+/out
+
+# Maven
+/libosmscout-kotlin/target/
+
# Generation of db for tests
-Tests/*.dat
-Tests/*.idx
-Tests/*.tmp
-Tests/*.idmap
-Tests/*.txt
-Tests/*.html
+/Tests/*.dat
+/Tests/*.idx
+/Tests/*.tmp
+/Tests/*.idmap
+/Tests/*.txt
+/Tests/*.html
+/Tests/Testing/Temporary/*
+/Tests/data/testregion/stats.dot
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Demos/include/DrawMap.h
^
|
@@ -41,6 +41,8 @@
#endif
double dpi=96.0;
+ osmscout::Bearing angle;
+
bool renderContourLines=false;
bool renderHillShading=false;
@@ -109,6 +111,12 @@
"dpi",
"Rendering DPI (" + std::to_string(args.dpi) + ")",
false);
+ AddOption(osmscout::CmdLineDoubleOption([this](const double& value) {
+ args.angle=osmscout::Bearing::Degrees(value);
+ }),
+ "angle",
+ "Rendering angle (in degrees)",
+ false);
AddOption(osmscout::CmdLineStringOption([this](const std::string& value) {
args.fontName = value;
}),
@@ -315,6 +323,7 @@
drawParameter.SetLabelLineFitToArea(true);
projection.Set(args.center,
+ args.angle.AsRadians(),
args.zoom,
args.dpi,
args.width,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Demos/src/DrawMapQt.cpp
^
|
@@ -29,6 +29,8 @@
#include <osmscout/Database.h>
#include <osmscoutmap/MapService.h>
+#include <osmscout/feature/ConstructionYearFeature.h>
+
#include <osmscoutmapqt/MapPainterQt.h>
/*
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Demos/src/LocationDescription.cpp
^
|
@@ -24,7 +24,8 @@
#include <osmscout/Database.h>
#include <osmscout/LocationService.h>
#include <osmscout/LocationDescriptionService.h>
-#include <osmscout/TypeFeatures.h>
+
+#include <osmscout/feature/AdminLevelFeature.h>
#include <osmscout/util/CmdLineParsing.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Demos/src/LookupPOI.cpp
^
|
@@ -23,9 +23,10 @@
#include <osmscout/POIService.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
+#include <osmscout/feature/NameFeature.h>
+
#include <osmscout/util/CmdLineParsing.h>
#include <osmscout/util/GeoBox.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Demos/src/LookupText.cpp
^
|
@@ -76,14 +76,14 @@
true);
argParser.AddOption(osmscout::CmdLineUIntOption([&args](unsigned int value) {
- args.maxPrintedOffsets=value;
- }),
+ args.maxPrintedOffsets=value;
+ }),
"max-offsets",
"Maximum of printed offsets for each result (default "s + std::to_string(args.maxPrintedOffsets) + ")"s,
false);
argParser.AddOption(osmscout::CmdLineUIntOption([&args](unsigned int value) {
- args.maxPrintedOffsets=value;
+ args.maxUniqueResults=value;
}),
"max-results",
"Maximum of printed unique results (default "s + std::to_string(args.maxUniqueResults) + ")"s,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/DumpData/src/DumpData.cpp
^
|
@@ -19,21 +19,33 @@
#include <cstring>
#include <iostream>
+#include <list>
+#include <map>
+#include <string>
+#include <vector>
#include <osmscout/Database.h>
#include <osmscout/DebugDatabase.h>
#include <osmscout/routing/RouteNode.h>
-#include <osmscout/TypeFeatures.h>
+
+#include <osmscout/feature/AccessFeature.h>
+#include <osmscout/feature/AccessRestrictedFeature.h>
+#include <osmscout/feature/AddressFeature.h>
+#include <osmscout/feature/AdminLevelFeature.h>
+#include <osmscout/feature/IsInFeature.h>
+#include <osmscout/feature/LanesFeature.h>
+#include <osmscout/feature/LayerFeature.h>
+#include <osmscout/feature/LocationFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/NameAltFeature.h>
+#include <osmscout/feature/RefFeature.h>
+#include <osmscout/feature/SidewayFeature.h>
+#include <osmscout/feature/WidthFeature.h>
#include <osmscout/routing/RouteNodeDataFile.h>
#include <osmscout/routing/RoutingService.h>
-#include <list>
-#include <map>
-#include <string>
-#include <vector>
-
/*
* Example:
* src/DumpData ../TravelJinni/ -n 25293125 -w 4290108 -w 26688152 -r 531985
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/PublicTransportMap/src/PublicTransportMap.cpp
^
|
@@ -25,6 +25,8 @@
#include <osmscout/Database.h>
#include <osmscout/PTRouteDataFile.h>
+#include <osmscout/feature/NameFeature.h>
+
#include <osmscout/util/CmdLineParsing.h>
#include <osmscout/util/FileScanner.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Tests/src/AccessParse.cpp
^
|
@@ -4,8 +4,7 @@
#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeatures.h>
-#include <osmscout/FeatureReader.h>
+#include <osmscout/feature/AccessFeature.h>
#include <osmscout/util/TagErrorReporter.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Tests/src/FeatureLabelTest.cpp
^
|
@@ -1,5 +1,5 @@
-#include <osmscout/TypeFeatures.h>
+#include <osmscout/feature/EleFeature.h>
#include <TestMain.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Tests/src/MercatorProjection.cpp
^
|
@@ -266,3 +266,19 @@
REQUIRE(projection.GetDimensions().GetDisplayText()==expectedBox.GetDisplayText());
}
+
+TEST_CASE("GetDimensions() with rotation")
+{
+ osmscout::MercatorProjection projection;
+ osmscout::GeoBox expectedBox(osmscout::GeoCoord(51.49061,7.42522),
+ osmscout::GeoCoord(51.53420,7.50528));
+
+ projection.Set(defaultCenter,
+ 0.524, // 30°
+ osmscout::Magnification(osmscout::Magnification::magClose),
+ defaultDpi,
+ defaultWidth,
+ defaultHeight);
+
+ REQUIRE(projection.GetDimensions().GetDisplayText()==expectedBox.GetDisplayText());
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Tests/src/OpeningHours.cpp
^
|
@@ -46,6 +46,32 @@
REQUIRE(oh->GetRules()[0].intervals[1].to.minute==30);
}
+TEST_CASE("Parse simple opening hours with space")
+{
+ // space between time intervals should not be there, but be tolerant
+ 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");
@@ -79,3 +105,10 @@
REQUIRE(oh->GetRules()[5].day==osmscout::OpeningHours::WeekDay::PublicHoliday);
REQUIRE(oh->GetRules()[5].intervals.empty());
}
+
+TEST_CASE("Wrong rule separator")
+{
+ // this value use comma instead of semicolon
+ auto oh = osmscout::OpeningHours::Parse("Mo-Th 11:00-24:00, Sa 11:30-24:00, Su 11:30-22:00, Fr 11:00-01:00");
+ REQUIRE(oh == std::nullopt);
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/Tests/src/StringUtils.cpp
^
|
@@ -41,6 +41,36 @@
REQUIRE(*(it++) == "gravel");
}
+TEST_CASE("Split empty string to pair")
+{
+ auto elements = osmscout::SplitStringToPair("", ";");
+ REQUIRE_FALSE(elements.has_value());
+}
+
+TEST_CASE("Split string with multiple separators to pair")
+{
+ auto elements = osmscout::SplitStringToPair("a;b;c;", ";");
+ REQUIRE(elements.has_value());
+ REQUIRE(std::get<0>(elements.value())=="a");
+ REQUIRE(std::get<1>(elements.value())=="b;c;");
+}
+
+TEST_CASE("Split string with separator on the end")
+{
+ auto elements = osmscout::SplitStringToPair("a;", ";");
+ REQUIRE(elements.has_value());
+ REQUIRE(std::get<0>(elements.value())=="a");
+ REQUIRE(std::get<1>(elements.value()).empty());
+}
+
+TEST_CASE("Split string just with separator")
+{
+ auto elements = osmscout::SplitStringToPair(";", ";");
+ REQUIRE(elements.has_value());
+ REQUIRE(std::get<0>(elements.value()).empty());
+ REQUIRE(std::get<1>(elements.value()).empty());
+}
+
TEST_CASE("Transliterate diacritics")
{
try {
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/cspell.json
^
|
@@ -0,0 +1,9 @@
+{
+ "version": "0.2",
+ "ignorePaths": [],
+ "dictionaryDefinitions": [],
+ "dictionaries": ["en-gb"],
+ "words": ["Teulings", "framstag", "osmscout"],
+ "ignoreWords": [],
+ "import": []
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/AvailableVoicesModel.h
^
|
@@ -91,10 +91,10 @@
};
Q_ENUM(VoiceState)
- Q_INVOKABLE virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ 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;
Q_INVOKABLE void download(const QModelIndex &index);
Q_INVOKABLE void remove(const QModelIndex &index);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/InstalledMapsModel.h
^
|
@@ -58,10 +58,10 @@
};
Q_ENUM(Roles)
- Q_INVOKABLE virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ 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;
/**
* Delete installed map represented this model on given row
@@ -69,7 +69,7 @@
* @return true on success
*/
Q_INVOKABLE bool deleteMap(int row);
- Q_INVOKABLE virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
+ Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
/**
* Generation time of map with given path. Null if don't exists
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/InstalledVoicesModel.h
^
|
@@ -54,7 +54,7 @@
public:
InstalledVoicesModel();
- virtual ~InstalledVoicesModel();
+ ~InstalledVoicesModel() override;
enum Roles {
NameRole = Qt::UserRole, // name
@@ -68,10 +68,10 @@
};
Q_ENUM(Roles)
- Q_INVOKABLE virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ 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;
Q_INVOKABLE void select(const QModelIndex &index);
Q_INVOKABLE void playSample(const QModelIndex &index, const QStringList &sample);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/LocationInfoModel.h
^
|
@@ -86,16 +86,16 @@
public:
LocationInfoModel();
- virtual ~LocationInfoModel();
+ ~LocationInfoModel() override;
- Q_INVOKABLE virtual int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const
+ Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
{
return model.size();
};
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ 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;
bool inline isReady() const
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/LookupModule.h
^
|
@@ -20,13 +20,20 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <iostream>
+
#include <QObject>
#include <QThread>
-#include <osmscoutclientqt/DBThread.h>
+
#include <osmscout/LocationDescriptionService.h>
+#include <osmscout/feature/PhoneFeature.h>
+#include <osmscout/feature/WebsiteFeature.h>
+#include <osmscout/feature/OpeningHoursFeature.h>
+
+#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
-#include <iostream>
+
namespace osmscout {
@@ -67,6 +74,7 @@
QString altLangName;
QString phone;
QString website;
+ QString openingHours;
QString addressNumber;
LocationDescriptionService::ReverseLookupRef reverseLookupRef;
QList<AdminRegionInfoRef> adminRegionList;
@@ -194,6 +202,10 @@
info.website=QString::fromStdString(website->GetWebsite());
}
+ if (const osmscout::OpeningHoursFeatureValue *openingHours=features.findValue<osmscout::OpeningHoursFeatureValue>(); openingHours!=nullptr){
+ info.openingHours=QString::fromStdString(openingHours->GetValue());
+ }
+
if (const osmscout::AddressFeatureValue *address=features.findValue<osmscout::AddressFeatureValue>(); address!=nullptr){
info.addressNumber=QString::fromStdString(address->GetAddress());
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapDownloadsModel.h
^
|
@@ -55,7 +55,7 @@
public:
MapDownloadsModel(QObject *parent=Q_NULLPTR);
- virtual inline ~MapDownloadsModel(){};
+ ~MapDownloadsModel() override = default;
enum Roles {
MapNameRole = Qt::UserRole,
@@ -66,10 +66,10 @@
};
Q_ENUM(Roles)
- Q_INVOKABLE virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ 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;
Q_INVOKABLE void cancel(int row);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapObjectInfoModel.h
^
|
@@ -61,7 +61,8 @@
RegionRole = Qt::UserRole+10,
LatRole = Qt::UserRole+11,
LonRole = Qt::UserRole+12,
- AltLangName = Qt::UserRole+13
+ AltLangName = Qt::UserRole+13,
+ OpeningHours = Qt::UserRole+14
};
Q_ENUM(Roles)
@@ -89,9 +90,9 @@
public:
MapObjectInfoModel();
- virtual ~MapObjectInfoModel();
+ ~MapObjectInfoModel() override;
- Q_INVOKABLE virtual int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const
+ Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
{
return model.size();
};
@@ -103,9 +104,9 @@
Q_INVOKABLE QObject* createOverlayObject(int row) const;
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ 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;
private:
bool ready;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapStyleModel.h
^
|
@@ -53,19 +53,19 @@
Q_ENUM(Roles)
MapStyleModel();
- virtual ~MapStyleModel();
+ ~MapStyleModel() override;
QString getStyle() const;
void setStyle(const QString &style);
- Q_INVOKABLE virtual int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const
+ Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
{
return stylesheets.size();
};
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ 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;
Q_INVOKABLE int indexOf(const QString &style) const;
Q_INVOKABLE QString file(int i) const;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NavigationModel.h
^
|
@@ -126,7 +126,7 @@
public:
NavigationModel();
- virtual ~NavigationModel();
+ ~NavigationModel() override;
bool isPositionOnRoute();
@@ -135,13 +135,13 @@
QObject *getNextRoutStep();
- QVariant data(const QModelIndex &index, int role) const;
+ QVariant data(const QModelIndex &index, int role) const override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
- Qt::ItemFlags flags(const QModelIndex &index) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- QHash<int, QByteArray> roleNames() const;
+ QHash<int, QByteArray> roleNames() const override;
inline OverlayWay* getRouteWay() const
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NearPOIModel.h
^
|
@@ -120,17 +120,17 @@
public:
NearPOIModel();
- virtual ~NearPOIModel();
+ ~NearPOIModel() override;
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const;
+ Q_INVOKABLE QVariant data(const QModelIndex &index, int role) const override;
- Q_INVOKABLE virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const override;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ Q_INVOKABLE Qt::ItemFlags flags(const QModelIndex &index) const override;
Q_INVOKABLE QObject* get(int row) const;
- virtual QHash<int, QByteArray> roleNames() const;
+ QHash<int, QByteArray> roleNames() const override;
inline bool isSearching() const
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OpeningHoursModel.h
^
|
@@ -65,7 +65,7 @@
OpeningHoursModel& operator=(const OpeningHoursModel&) = delete;
OpeningHoursModel& operator=(OpeningHoursModel&&) = delete;
- Q_INVOKABLE virtual int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const
+ Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
{
return model.size();
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/RoutingModel.h
^
|
@@ -101,14 +101,14 @@
explicit RoutingListModel(QObject* parent = nullptr);
RoutingListModel(const RoutingListModel&) = delete;
RoutingListModel(RoutingListModel&&) = delete;
- virtual ~RoutingListModel();
+ ~RoutingListModel() override;
RoutingListModel& operator=(const RoutingListModel&) = delete;
RoutingListModel& operator=(RoutingListModel&&) = delete;
- QVariant data(const QModelIndex &index, int role) const;
+ QVariant data(const QModelIndex &index, int role) const override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
/**
* Route length in meters
@@ -122,9 +122,9 @@
*/
double getRouteDuration() const;
- Qt::ItemFlags flags(const QModelIndex &index) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- QHash<int, QByteArray> roleNames() const;
+ QHash<int, QByteArray> roleNames() const override;
Q_INVOKABLE QObject* get(int row) const;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/SearchLocationModel.h
^
|
@@ -69,7 +69,12 @@
/**
* Limit of results for each database.
*/
- Q_PROPERTY(int resultLimit READ GetResultLimit WRITE SetResultLimit)
+ Q_PROPERTY(int resultLimit READ GetResultLimit WRITE SetResultLimit)
+
+ /**
+ * Limit of model rows
+ */
+ Q_PROPERTY(int displayLimit READ GetDisplayLimit WRITE SetDisplayLimit)
/**
* Searched pattern
@@ -141,21 +146,27 @@
void onLocationAdminRegions(const osmscout::GeoCoord,QList<AdminRegionInfoRef>);
void onLocationAdminRegionFinished(const osmscout::GeoCoord);
+private slots:
+ void postponeAdd();
+
private:
QString pattern;
QString lastRequestPattern;
QList<LocationEntryRef> locations;
- bool searching;
+ QList<LocationEntryRef> postponedEntries;
+ bool searching=false;
SearchModule* searchModule;
LookupModule* lookupModule;
SettingsRef settings;
osmscout::GeoCoord searchCenter;
- int resultLimit;
+ int resultLimit=2000;
+ int displayLimit=100;
osmscout::BreakerRef breaker;
AdminRegionInfoRef defaultRegion;
AdminRegionInfoRef lastRequestDefaultRegion;
QJSValue compareFn;
QJSValue equalsFn;
+ QTimer postponeTimer;
public:
enum Roles {
@@ -207,7 +218,7 @@
Q_INVOKABLE QObject* get(int row) const;
inline bool isSearching() const {
- return searching;
+ return searching || !postponedEntries.empty();
}
inline double GetLat() const {
@@ -240,6 +251,14 @@
resultLimit=limit;
}
+ inline int GetDisplayLimit() const {
+ return displayLimit;
+ }
+
+ inline void SetDisplayLimit(int limit) {
+ displayLimit=limit;
+ }
+
inline QString getPattern() const {
return pattern;
}
@@ -247,6 +266,9 @@
private:
void lookupRegion();
+ void addBatch(QList<LocationEntryRef> foundLocations);
+
+
};
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/StyleFlagsModel.h
^
|
@@ -61,14 +61,14 @@
StyleFlagsModel();
~StyleFlagsModel() override;
- Q_INVOKABLE virtual int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
+ Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
{
return mapFlags.size();
};
- Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role) const override;
- virtual QHash<int, QByteArray> roleNames() const override;
- Q_INVOKABLE virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
+ 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;
Q_INVOKABLE void setFlag(const QString &key, bool value);
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/IconLookup.cpp
^
|
@@ -17,12 +17,20 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <osmscoutmapqt/SymbolRendererQt.h>
#include <osmscoutclientqt/IconLookup.h>
+#include <cmath>
+
#include <QSvgRenderer>
-#include <cmath>
+#include <osmscout/feature/OpeningHoursFeature.h>
+#include <osmscout/feature/OperatorFeature.h>
+#include <osmscout/feature/PhoneFeature.h>
+#include <osmscout/feature/WebsiteFeature.h>
+
+#include <osmscoutmapqt/SymbolRendererQt.h>
+
+
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LocationInfoModel.cpp
^
|
@@ -19,12 +19,16 @@
*/
#include <osmscoutclientqt/LocationInfoModel.h>
+
+#include <algorithm>
+
+#include <osmscout/feature/OpeningHoursFeature.h>
+#include <osmscout/feature/PostalCodeFeature.h>
+
#include <osmscoutclientqt/OSMScoutQt.h>
#include <QtCore/qabstractitemmodel.h>
-#include <algorithm>
-
namespace osmscout {
LocationInfoModel::LocationInfoModel():
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LookupModule.cpp
^
|
@@ -18,9 +18,14 @@
*/
#include <osmscoutclientqt/LookupModule.h>
-#include <osmscoutclientqt/OSMScoutQt.h>
+
+
#include <iostream>
+#include <osmscout/feature/AdminLevelFeature.h>
+
+#include <osmscoutclientqt/OSMScoutQt.h>
+
namespace osmscout {
LookupModule::LookupModule(QThread *thread,DBThreadRef dbThread):
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapObjectInfoModel.cpp
^
|
@@ -97,6 +97,7 @@
roles[LatRole] = "lat";
roles[LonRole] = "lon";
roles[AltLangName] = "altLangName";
+ roles[OpeningHours] = "openingHours";
return roles;
}
@@ -194,6 +195,9 @@
if (role==LonRole){
return QVariant::fromValue(obj.center.GetLon());
}
+ if (role==OpeningHours){
+ return QVariant::fromValue(obj.openingHours);
+ }
//qDebug() << "Undefined role" << role << "("<<LabelRole<<"..."<<NameRole<<")";
return QVariant();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OverlayObject.cpp
^
|
@@ -19,11 +19,16 @@
*/
#include <osmscoutclientqt/OverlayObject.h>
+
+#include <iostream>
+
+#include <osmscout/feature/ColorFeature.h>
+#include <osmscout/feature/LayerFeature.h>
+#include <osmscout/feature/NameFeature.h>
+
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Logger.h>
-#include <osmscout/TypeFeatures.h>
-#include <iostream>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/POILookupModule.cpp
^
|
@@ -18,6 +18,9 @@
*/
#include <osmscoutclientqt/POILookupModule.h>
+
+#include <osmscout/feature/OperatorFeature.h>
+
#include <osmscout/POIService.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/SearchLocationModel.cpp
^
|
@@ -32,7 +32,7 @@
#define INVALID_COORD -1000.0
LocationListModel::LocationListModel(QObject* parent)
-: QAbstractListModel(parent), searching(false), searchCenter(INVALID_COORD,INVALID_COORD), resultLimit(50)
+: QAbstractListModel(parent), searchCenter(INVALID_COORD,INVALID_COORD)
{
searchModule=OSMScoutQt::GetInstance().MakeSearchModule();
lookupModule=OSMScoutQt::GetInstance().MakeLookupModule();
@@ -61,6 +61,10 @@
connect(lookupModule, &LookupModule::locationAdminRegionFinished,
this, &LocationListModel::onLocationAdminRegionFinished,
Qt::QueuedConnection);
+
+ connect(&postponeTimer, &QTimer::timeout,
+ this, &LocationListModel::postponeAdd,
+ Qt::QueuedConnection);
}
LocationListModel::~LocationListModel()
@@ -82,28 +86,54 @@
}
void LocationListModel::onSearchResult(const QString searchPattern,
- const QList<LocationEntry> foundLocationsConst)
-{
+ const QList<LocationEntry> foundLocationsConst) {
if (this->pattern.isEmpty()) {
return; //No search requested
}
- if (!searchPattern.contains(this->pattern, Qt::CaseInsensitive)){
+ if (!searchPattern.contains(this->pattern, Qt::CaseInsensitive)) {
return; // result is not for us
}
- QElapsedTimer timer;
- timer.start();
+ /**
+ * Adding huge batch of entries to model (more that 100) may take longer than ~16 ms
+ * and UI may become choppy. So, we enqueue all found entries to postponedEntries
+ * and start postponeTimer that adds entries by small chunks. Whole operation is splitted
+ * to multiple animation frames.
+ */
+ for (const LocationEntry &e: foundLocationsConst) {
+ postponedEntries.push_back(std::make_shared<LocationEntry>(e));
+ }
+
+ postponeTimer.setInterval(1);
+ postponeTimer.start();
+}
- int equalityCall=0;
- int comparisonsCall=0;
+void LocationListModel::postponeAdd() {
+ constexpr int batchSize = 50;
- QList<LocationEntryRef> foundLocations;
- for (const LocationEntry& e : foundLocationsConst) {
- foundLocations.push_back(std::make_shared<LocationEntry>(e));
+ if (postponedEntries.size() <= batchSize) {
+ addBatch(postponedEntries);
+ postponedEntries.clear();
+ postponeTimer.stop();
+ emit SearchingChanged(isSearching());
+ } else {
+ QList<LocationEntryRef> batch;
+ batch.reserve(batchSize);
+ std::copy(postponedEntries.begin(), postponedEntries.begin() + batchSize, std::back_inserter(batch));
+ addBatch(batch);
+ postponedEntries.erase(postponedEntries.begin(), postponedEntries.begin() + batchSize);
}
+}
+
+void LocationListModel::addBatch(QList<LocationEntryRef> foundLocations) {
+ QElapsedTimer timer;
+ timer.start();
+
+ int equalityCall = 0;
+ int comparisonsCall = 0;
QQmlEngine *engine = qmlEngine(this);
- if (equalsFn.isCallable()){
+ if (equalsFn.isCallable()) {
// try to merge locations that are equals
auto Equal = [&](const LocationEntryRef& a, const LocationEntryRef& b) -> bool {
assert(a != nullptr && b != nullptr);
@@ -226,9 +256,14 @@
}
}
+ if (locations.size()>displayLimit) {
+ emit beginRemoveRows(QModelIndex(), displayLimit, locations.size() -1);
+ locations.erase(locations.begin()+displayLimit, locations.end());
+ emit endRemoveRows();
+ }
+
emit countChanged(locations.size());
- qDebug() << "new" << foundLocationsConst.size()
- << "added" << foundLocations.size()
+ qDebug() << "added" << foundLocations.size()
<< "(in" << timer.elapsed() << "ms,"
<< "equal" << equalityCall << "x, compare" << comparisonsCall << "x),"
<< "model size" << locations.size();
@@ -273,7 +308,7 @@
emit SearchRequested(pattern,resultLimit,searchCenter,defaultRegion,breaker);
}else{
searching = false;
- emit SearchingChanged(false);
+ emit SearchingChanged(isSearching());
}
}
@@ -290,6 +325,8 @@
locations.clear();
endRemoveRows();
emit countChanged(locations.size());
+ postponedEntries.clear();
+ postponeTimer.stop();
std::string stdPattern=pattern.toUtf8().constData();
@@ -320,7 +357,7 @@
searching = true;
lastRequestPattern = pattern;
lastRequestDefaultRegion=defaultRegion;
- emit SearchingChanged(true);
+ emit SearchingChanged(isSearching());
breaker=std::make_shared<osmscout::ThreadedBreaker>();
emit SearchRequested(pattern,resultLimit,searchCenter,defaultRegion,breaker);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/GenRouteDat.h
^
|
@@ -27,12 +27,8 @@
#include <osmscout/NumericIndex.h>
-#include <osmscout/routing/RouteNode.h>
-#include <osmscout/routing/TurnRestriction.h>
-
#include <osmscout/OSMScoutTypes.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/Area.h>
@@ -40,13 +36,21 @@
#include <osmscout/ObjectRef.h>
+#include <osmscout/feature/AccessFeature.h>
+#include <osmscout/feature/AccessRestrictedFeature.h>
+#include <osmscout/feature/GradeFeature.h>
+#include <osmscout/feature/MaxSpeedFeature.h>
+
+#include <osmscout/routing/RouteNode.h>
+#include <osmscout/routing/TurnRestriction.h>
+
#include <osmscout/util/FileWriter.h>
#include <osmscout/util/NodeUseMap.h>
-#include <osmscoutimport/Import.h>
-
#include <osmscout/system/Compiler.h>
+#include <osmscoutimport/Import.h>
+
namespace osmscout {
class RouteDataGenerator CLASS_FINAL : public ImportModule
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenAreaAreaIndex.cpp
^
|
@@ -22,12 +22,16 @@
#include <numeric>
#include <vector>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/AreaAreaIndex.h>
#include <osmscout/AreaDataFile.h>
+#include <osmscout/feature/AddressFeature.h>
+#include <osmscout/feature/LocationFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/PostalCodeFeature.h>
+
#include <osmscout/util/File.h>
#include <osmscout/util/FileScanner.h>
#include <osmscout/util/GeoBox.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenLocationIndex.cpp
^
|
@@ -28,7 +28,6 @@
#include <osmscout/Pixel.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/LocationIndex.h>
@@ -37,6 +36,13 @@
#include <osmscout/NodeDataFile.h>
#include <osmscout/WayDataFile.h>
+#include <osmscout/feature/AdminLevelFeature.h>
+#include <osmscout/feature/IsInFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/NameAltFeature.h>
+#include <osmscout/feature/PostalCodeFeature.h>
+#include <osmscout/feature/RefFeature.h>
+
#include <osmscout/system/Assert.h>
#include <osmscout/system/Math.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenOptimizeWaysLowZoom.cpp
^
|
@@ -21,7 +21,7 @@
#include <osmscout/Pixel.h>
-#include <osmscout/TypeFeatures.h>
+#include <osmscout/feature/RefFeature.h>
#include <osmscout/Way.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenPTRouteDat.cpp
^
|
@@ -22,13 +22,19 @@
#include <list>
#include <map>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/NodeDataFile.h>
#include <osmscout/WayDataFile.h>
#include <osmscout/PTRouteDataFile.h>
+#include <osmscout/feature/ColorFeature.h>
+#include <osmscout/feature/FromToFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/NetworkFeature.h>
+#include <osmscout/feature/OperatorFeature.h>
+#include <osmscout/feature/RefFeature.h>
+
#include <osmscoutimport/Preprocess.h>
#include <osmscout/util/Color.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenRelAreaDat.cpp
^
|
@@ -21,12 +21,15 @@
#include <algorithm>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/TypeInfoSet.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/RefFeature.h>
+
#include <osmscout/system/Assert.h>
#include <osmscout/util/Geometry.h>
+
#include <osmscoutimport/Preprocess.h>
#include <osmscoutimport/GenRawNodeIndex.h>
#include <osmscoutimport/GenRawWayIndex.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenRouteDat.cpp
^
|
@@ -21,7 +21,6 @@
#include <algorithm>
#include <future>
-#include <iterator>
#include <osmscout/ObjectRef.h>
@@ -29,21 +28,14 @@
#include <osmscout/routing/RoutingService.h>
-#include <osmscoutimport/GenRouteDat.h>
-
-#include <algorithm>
-#include <future>
#include <osmscout/system/Assert.h>
#include <osmscout/system/Math.h>
#include <osmscout/util/Geometry.h>
-#include <osmscout/util/StopClock.h>
#include <osmscoutimport/Preprocess.h>
#include <osmscoutimport/GenWayWayDat.h>
-#include <iostream>
-
namespace osmscout {
void RouteDataGenerator::GetDescription(const ImportParameter& parameter,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenTextIndex.cpp
^
|
@@ -23,7 +23,6 @@
#include <osmscout/Way.h>
#include <osmscout/Area.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/TextSearchIndex.h>
@@ -32,6 +31,10 @@
#include <osmscout/WayDataFile.h>
#include <osmscout/AreaDataFile.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/NameAltFeature.h>
+#include <osmscout/feature/RefFeature.h>
+
#include <osmscout/util/File.h>
#include <osmscout/util/FileScanner.h>
#include <osmscout/util/FileWriter.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenWaterIndex.cpp
^
|
@@ -24,11 +24,14 @@
#include <osmscout/DataFile.h>
#include <osmscout/BoundingBoxDataFile.h>
#include <osmscout/CoordDataFile.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/WaterIndex.h>
#include <osmscout/WayDataFile.h>
+#include <osmscout/feature/BridgeFeature.h>
+#include <osmscout/feature/EmbankmentFeature.h>
+#include <osmscout/feature/TunnelFeature.h>
+
#include <osmscout/projection/MercatorProjection.h>
#include <osmscout/util/File.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/RawWay.cpp
^
|
@@ -22,9 +22,7 @@
#include <algorithm>
#include <limits>
-#include <osmscout/TypeFeatures.h>
-
-#include <osmscout/system/Math.h>
+#include <osmscout/feature/AccessFeature.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/SortNodeDat.cpp
^
|
@@ -19,10 +19,15 @@
#include <osmscoutimport/SortNodeDat.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/NodeDataFile.h>
+
+#include <osmscout/feature/AddressFeature.h>
+#include <osmscout/feature/LocationFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/PostalCodeFeature.h>
+
#include <osmscoutimport/GenNodeDat.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/SortWayDat.cpp
^
|
@@ -19,11 +19,13 @@
#include <osmscoutimport/SortWayDat.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/WayDataFile.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/PostalCodeFeature.h>
+
#include <osmscout/util/Geometry.h>
#include <osmscoutimport/GenOptimizeAreaWayIds.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/WaterIndexProcessor.cpp
^
|
@@ -22,7 +22,6 @@
#include <iostream>
#include <algorithm>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/WaterIndex.h>
#include <osmscout/system/Assert.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-import/src/protobuf/meson.build
^
|
@@ -1,10 +1,9 @@
if protobufDep.found() and protocCmd.found()
protoGen = generator(protocCmd,
output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
- arguments : ['--cpp_out=@BUILD_DIR@','--proto_path=@SOURCE_DIR@/libosmscout-import/src/protobuf','@INPUT@'])
+ arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--cpp_out=@BUILD_DIR@','@INPUT@'])
protoSrc = protoGen.process('fileformat.proto', 'osmformat.proto')
else
protoSrc = []
endif
-
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/CMakeLists.txt
^
|
@@ -1,9 +1,11 @@
set(HEADER_FILES
include/osmscoutmapiosx/MapPainterIOS.h
+ include/osmscoutmapiosx/SymbolRendererIOS.h
)
set(SOURCE_FILES
src/osmscout/MapPainterIOS.mm
+ src/osmscout/SymbolRendererIOS.mm
)
osmscout_library_project(
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/include/meson.build
^
|
@@ -1,7 +1,8 @@
osmscoutmapiosxIncDir = include_directories('.')
osmscoutmapiosxHeader = [
- 'osmscoutmapiosx/MapPainterIOS.h'
+ 'osmscoutmapiosx/MapPainterIOS.h',
+ 'osmscoutmapiosx/SymbolRendererIOS.h'
]
if meson.version().version_compare('>=0.63.0')
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/include/osmscoutmapiosx/SymbolRendererIOS.h
^
|
@@ -0,0 +1,72 @@
+#ifndef OSMSCOUT_MAP_IOSX_SYMBOLRENDERERIOSX_H
+#define OSMSCOUT_MAP_IOSX_SYMBOLRENDERERIOSX_H
+
+/*
+ This source is part of the libosmscout-map-iOSX library
+ Copyright (C) 2010 Tim Teulings
+ Copyright (C) 2023 Vladimir Vyskocil
+
+ 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/SymbolRenderer.h>
+
+#include <osmscoutmap/Styles.h>
+
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#endif
+
+#if TARGET_OS_IPHONE
+#import <UIKit/UIKit.h>
+#else
+#import <AppKit/AppKit.h>
+#endif
+
+namespace osmscout {
+
+/**
+ * \ingroup Renderer
+ */
+class SymbolRendererIOS: public SymbolRenderer {
+private:
+
+ CGContextRef cg;
+ FillStyleRef fillStyle;
+ BorderStyleRef borderStyle;
+ double screenMmInPixel;
+
+public:
+ explicit SymbolRendererIOS(CGContextRef cg);
+ SymbolRendererIOS(const SymbolRendererIOS&) = default;
+ SymbolRendererIOS(SymbolRendererIOS&&) = default;
+
+ ~SymbolRendererIOS() override = default;
+
+ SymbolRendererIOS& operator=(const SymbolRendererIOS&) = default;
+ SymbolRendererIOS& operator=(SymbolRendererIOS&&) = default;
+
+protected:
+ void BeginPrimitive() override;
+ void SetFill(const FillStyleRef &fillStyle) override;
+ void SetBorder(const BorderStyleRef &borderStyle, double screenMmInPixel) override;
+ void DrawPolygon(const std::vector<Vertex2D> &polygonPixels) override;
+ void DrawRect(double x, double y, double w, double h) override;
+ void DrawCircle(double x, double y, double radius) override;
+ void EndPrimitive() override;
+};
+}
+
+#endif // OSMSCOUT_MAP_IOSX_SYMBOLRENDERERIOSX_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/src/meson.build
^
|
@@ -1,5 +1,6 @@
osmscoutmapiosxSrc = [
'src/osmscout/MapPainterIOS.mm',
+ 'src/osmscout/SymbolRendererIOS.mm'
]
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/src/osmscout/MapPainterIOS.mm
^
|
@@ -18,6 +18,7 @@
*/
#import <osmscoutmapiosx/MapPainterIOS.h>
+#import <osmscoutmapiosx/SymbolRendererIOS.h>
#include <cassert>
#include <limits>
@@ -623,10 +624,11 @@
}
void MapPainterIOS::DrawContourSymbol(const Projection& projection,
- const MapParameter& parameter,
+ const MapParameter& /* parameter */,
const Symbol& symbol,
const ContourSymbolData& data){
-
+ CGContextRef drawCG = cg;
+ SymbolRendererIOS renderer(cg);
ScreenBox boundingBox=symbol.GetBoundingBox(projection);
double width=boundingBox.GetWidth();
double height=boundingBox.GetHeight();
@@ -640,6 +642,7 @@
if(!isClosed && !followPath(followPathHnd, data.symbolOffset, origin)){
return;
}
+
bool loop = true;
while (loop){
x1 = origin.GetX();
@@ -657,7 +660,14 @@
CGContextTranslateCTM(cg, x2, y2);
CGAffineTransform ct = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(slope));
CGContextConcatCTM(cg, ct);
- DrawSymbol(projection, parameter, symbol, Vertex2D::ZERO, data.symbolScale);
+ renderer.Render(projection,
+ symbol,
+ Vertex2D(0.0, 0.0),
+ []() {
+ },
+ []() {
+ },
+ data.symbolScale);
CGContextRestoreGState(cg);
loop = followPath(followPathHnd, data.symbolSpace, origin);
}
@@ -673,7 +683,7 @@
*/
void MapPainterIOS::DrawIcon(const IconStyle* style,
const Vertex2D& centerPos,
- double /*width*/, double /*height*/){
+ double /*width*/, double /*height*/) {
size_t idx=style->GetIconId()-1;
assert(idx<images.size());
@@ -690,6 +700,7 @@
CGContextRestoreGState(cg);
}
+
/*
* DrawSymbol(const Projection& projection,
* const MapParameter& parameter,
@@ -697,104 +708,17 @@
* double x, double y, double scaleFactor)
*/
void MapPainterIOS::DrawSymbol(const Projection& projection,
- const MapParameter& parameter,
+ const MapParameter& /* parameter */,
const Symbol& symbol,
const Vertex2D& screenPos,
- double scaleFactor){
- ScreenBox boundingBox=symbol.GetBoundingBox(projection);
- Vertex2D center=boundingBox.GetCenter();
-
- CGContextSaveGState(cg);
- if (scaleFactor != 0.0) {
- CGContextConcatCTM(cg, CGAffineTransformMakeScale(scaleFactor, scaleFactor));
- }
- for (const auto& primitive : symbol.GetPrimitives()) {
- const DrawPrimitive *primitivePtr=primitive.get();
-
- if (const auto *polygon = dynamic_cast<const PolygonPrimitive*>(primitivePtr);
- polygon != nullptr) {
-
- FillStyleRef fillStyle=polygon->GetFillStyle();
- BorderStyleRef borderStyle=polygon->GetBorderStyle();
-
- if (fillStyle) {
- SetFill(projection, parameter, *fillStyle);
- } else {
- CGContextSetRGBFillColor(cg,0,0,0,0);
- }
-
- if (borderStyle) {
- SetBorder(projection, parameter, *borderStyle);
- } else {
- CGContextSetRGBStrokeColor(cg,0,0,0,0);
- }
-
- CGContextBeginPath(cg);
-
- for (std::list<Vertex2D>::const_iterator pixel=polygon->GetCoords().begin();
- pixel!=polygon->GetCoords().end();
- ++pixel) {
- if (pixel==polygon->GetCoords().begin()) {
- CGContextMoveToPoint(cg,
- screenPos.GetX()+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
- screenPos.GetY()+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
- } else {
- CGContextAddLineToPoint(cg,
- screenPos.GetX()+projection.ConvertWidthToPixel(pixel->GetX())-center.GetX(),
- screenPos.GetY()+projection.ConvertWidthToPixel(pixel->GetY())-center.GetY());
- }
- }
-
- CGContextDrawPath(cg, kCGPathFillStroke);
- }
- else if (const auto *rectangle = dynamic_cast<const RectanglePrimitive*>(primitivePtr);
- rectangle != nullptr) {
-
- FillStyleRef fillStyle=rectangle->GetFillStyle();
- BorderStyleRef borderStyle=rectangle->GetBorderStyle();
- if (fillStyle) {
- SetFill(projection, parameter, *fillStyle);
- } else {
- CGContextSetRGBFillColor(cg,0,0,0,0);
- }
-
- if (borderStyle) {
- SetBorder(projection, parameter, *borderStyle);
- } else {
- CGContextSetRGBStrokeColor(cg,0,0,0,0);
- }
- 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);
- CGContextDrawPath(cg, kCGPathFillStroke);
- }
- else if (const auto *circle = dynamic_cast<const CirclePrimitive*>(primitivePtr);
- circle != nullptr) {
-
- FillStyleRef fillStyle=circle->GetFillStyle();
- BorderStyleRef borderStyle=circle->GetBorderStyle();
- if (fillStyle) {
- SetFill(projection, parameter, *fillStyle);
- } else {
- CGContextSetRGBFillColor(cg,0,0,0,0);
- }
-
- if (borderStyle) {
- SetBorder(projection, parameter, *borderStyle);
- } else {
- CGContextSetRGBStrokeColor(cg,0,0,0,0);
- }
- 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);
- CGContextDrawPath(cg, kCGPathFillStroke);
- }
- }
- CGContextRestoreGState(cg);
+ double scaleFactor) {
+
+ SymbolRendererIOS renderer(cg);
+
+ renderer.Render(projection,
+ symbol,
+ screenPos,
+ scaleFactor);
}
/*
@@ -888,33 +812,6 @@
}
/*
- * SetPen(const LineStyle& style,
- * double lineWidth)
- */
- void MapPainterIOS::SetPen(const LineStyle& style,
- double lineWidth) {
- CGContextSetRGBStrokeColor(cg,style.GetLineColor().GetR(),
- style.GetLineColor().GetG(),
- style.GetLineColor().GetB(),
- style.GetLineColor().GetA());
- CGContextSetLineWidth(cg,lineWidth);
-
- if (style.GetDash().empty()) {
- CGContextSetLineDash(cg, 0.0, NULL, 0);
- CGContextSetLineCap(cg, kCGLineCapRound);
- } else {
- CGFloat *dashes = (CGFloat *)malloc(sizeof(CGFloat)*style.GetDash().size());
- for (size_t i=0; i<style.GetDash().size(); i++) {
- dashes[i] = style.GetDash()[i]*lineWidth;
- }
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/src/osmscout/SymbolRendererIOS.mm
^
|
@@ -0,0 +1,131 @@
+/*
+ This source is part of the libosmscout-map library
+ Copyright (C) 2010 Tim Teulings
+ Copyright (C) 2023 Vladimir Vyskocil
+
+ 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 <osmscoutmapiosx/SymbolRendererIOS.h>
+
+#include <osmscout/util/Logger.h>
+
+namespace osmscout {
+ SymbolRendererIOS::SymbolRendererIOS(CGContextRef cg)
+ : cg(cg) {
+ }
+
+ void SymbolRendererIOS::BeginPrimitive() {
+ fillStyle=nullptr;
+ borderStyle=nullptr;
+ }
+
+ void SymbolRendererIOS::SetFill(const FillStyleRef& fillStyle) {
+ this->fillStyle=fillStyle;
+ }
+
+ void SymbolRendererIOS::SetBorder(const BorderStyleRef& borderStyle,
+ double screenMmInPixel) {
+ this->borderStyle=borderStyle;
+ this->screenMmInPixel=screenMmInPixel;
+ }
+
+ void SymbolRendererIOS::DrawPolygon(const std::vector<Vertex2D>& polygonPixels) {
+ CGContextBeginPath(cg);
+
+ for (auto pixel=polygonPixels.begin();
+ pixel!=polygonPixels.end();
+ ++pixel) {
+ if (pixel==polygonPixels.begin()) {
+ CGContextMoveToPoint(cg,
+ pixel->GetX(),
+ pixel->GetY());
+ } else {
+ CGContextAddLineToPoint(cg,
+ pixel->GetX(),
+ pixel->GetY());
+ }
+ }
+
+ CGContextClosePath(cg);
+ }
+
+ void SymbolRendererIOS::DrawRect(double x,
+ double y,
+ double w,
+ double h) {
+ CGRect rect = CGRectMake(x,y,w,h);
+ CGContextAddRect(cg,rect);
+ }
+
+ void SymbolRendererIOS::DrawCircle(double x,
+ double y,
+ double radius) {
+ CGRect rect = CGRectMake(x-radius/2, y-radius/2, radius, radius);
+ CGContextAddEllipseInRect(cg, rect);
+ }
+
+ void SymbolRendererIOS::EndPrimitive() {
+ bool hasFill=false;
+ bool hasBorder=false;
+ double borderWidth=borderStyle->GetWidth() * screenMmInPixel;
+
+ if (fillStyle) {
+ if (fillStyle->HasPattern()) {
+ log.Warn() << "Pattern is not supported for symbols";
+ } else if (fillStyle->GetFillColor().IsVisible()) {
+ Color color = fillStyle->GetFillColor();
+ CGContextSetRGBFillColor(cg,
+ color.GetR(),
+ color.GetG(),
+ color.GetB(),
+ color.GetA());
+ hasFill = true;
+ }
+ }
+
+ if (borderStyle) {
+ hasBorder = borderWidth > 0 &&
+ borderStyle->GetColor().IsVisible();
+ if (hasBorder) {
+ CGContextSetLineWidth(cg, borderWidth);
+ CGContextSetRGBStrokeColor(cg,borderStyle->GetColor().GetR(),
+ borderStyle->GetColor().GetG(),
+ borderStyle->GetColor().GetB(),
+ borderStyle->GetColor().GetA());
+ if (borderStyle->GetDash().empty()) {
+ CGContextSetLineDash(cg, 0.0, NULL, 0);
+ CGContextSetLineCap(cg, kCGLineCapRound);
+ } else {
+ CGFloat *dashes = (CGFloat *)malloc(sizeof(CGFloat)*borderStyle->GetDash().size());
+ for (size_t i=0; i<borderStyle->GetDash().size(); i++) {
+ dashes[i] = borderStyle->GetDash()[i]*borderWidth;
+ }
+ CGContextSetLineDash(cg, 0.0, dashes, borderStyle->GetDash().size());
+ free(dashes); dashes = NULL;
+ CGContextSetLineCap(cg, kCGLineCapButt);
+ }
+ }
+ }
+
+ if (hasFill && hasBorder) {
+ CGContextDrawPath(cg, kCGPathFillStroke);
+ } else if (hasFill) {
+ CGContextDrawPath(cg, kCGPathFill);
+ } else {
+ CGContextDrawPath(cg, kCGPathStroke);
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/BatchMapPainter.h
^
|
@@ -1,5 +1,5 @@
-#ifndef OSMSCOUT_MAP_BATCHAPPAINTER_H
-#define OSMSCOUT_MAP_BATCHMAPPAINTER_H
+#ifndef OSMSCOUT_MAP_BATCH_MAP_PAINTER_H
+#define OSMSCOUT_MAP_BATCH_MAP_PAINTER_H
/*
This source is part of the libosmscout-map library
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/LabelProvider.h
^
|
@@ -25,7 +25,6 @@
#include <osmscoutmap/MapImportExport.h>
#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscoutmap/MapParameter.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/MapPainter.h
^
|
@@ -28,7 +28,14 @@
#include <osmscout/ObjectRef.h>
-#include <osmscout/TypeFeatures.h>
+#include <osmscout/feature/AddressFeature.h>
+#include <osmscout/feature/ColorFeature.h>
+#include <osmscout/feature/LanesFeature.h>
+#include <osmscout/feature/LayerFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/NameAltFeature.h>
+#include <osmscout/feature/RefFeature.h>
+#include <osmscout/feature/WidthFeature.h>
#include <osmscout/Node.h>
#include <osmscout/Area.h>
@@ -65,7 +72,7 @@
ProcessAreas = 4, //!< Process (complex) areas for rendering
ProcessRoutes = 5, //!< Process routes for rendering
AfterPreprocessing = 6, //!< Additional postprocessing
- Prerender = 7, //!< Implementation specific preparison
+ Prerender = 7, //!< Implementation specific preparation
DrawBaseMapTiles = 8, //!< Draw unknown/sea/land tiles and tiles with "coastlines" from base map
DrawGroundTiles = 9, //!< Same as previous, but from main database
DrawOSMTileGrids = 10, //!< If special style exists, renders grid corresponding to OSM tiles
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/MapParameter.h
^
|
@@ -21,6 +21,7 @@
*/
#include <list>
+#include <locale>
#include <string>
#include <osmscoutmap/MapImportExport.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/StyleConfig.h
^
|
@@ -32,7 +32,6 @@
#include <osmscout/OSMScoutTypes.h>
#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/TypeInfoSet.h>
#include <osmscout/FeatureReader.h>
@@ -40,6 +39,8 @@
#include <osmscout/Area.h>
#include <osmscout/Way.h>
+#include <osmscout/feature/AccessFeature.h>
+
#include <osmscout/util/Color.h>
#include <osmscout/util/Transformation.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/StyleProcessor.h
^
|
@@ -22,7 +22,7 @@
#include <osmscoutmap/MapImportExport.h>
-#include <osmscout/TypeFeatures.h>
+#include <osmscout/TypeConfig.h>
#include <osmscoutmap/Styles.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/LabelProvider.cpp
^
|
@@ -19,6 +19,9 @@
#include <osmscoutmap/LabelProvider.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/NameAltFeature.h>
+
#include <osmscout/system/Assert.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/CMakeLists.txt
^
|
@@ -45,7 +45,6 @@
include/osmscout/Tag.h
include/osmscout/TypeConfig.h
include/osmscout/TypeFeature.h
- include/osmscout/TypeFeatures.h
include/osmscout/TypeInfoSet.h
include/osmscout/FeatureReader.h
include/osmscout/OSMScoutTypes.h
@@ -54,6 +53,42 @@
include/osmscout/WayDataFile.h
include/osmscout/CoreFeatures.h)
+set(HEADER_FILES_FEATURE
+ include/osmscout/feature/AccessFeature.h
+ include/osmscout/feature/AccessRestrictedFeature.h
+ include/osmscout/feature/AddressFeature.h
+ include/osmscout/feature/AdminLevelFeature.h
+ include/osmscout/feature/BridgeFeature.h
+ include/osmscout/feature/BuildingFeature.h
+ include/osmscout/feature/ClockwiseDirectionFeature.h
+ include/osmscout/feature/ColorFeature.h
+ include/osmscout/feature/ConstructionYearFeature.h
+ include/osmscout/feature/DestinationFeature.h
+ include/osmscout/feature/EleFeature.h
+ include/osmscout/feature/EmbankmentFeature.h
+ include/osmscout/feature/FromToFeature.h
+ include/osmscout/feature/GradeFeature.h
+ include/osmscout/feature/IsInFeature.h
+ include/osmscout/feature/LanesFeature.h
+ include/osmscout/feature/LayerFeature.h
+ include/osmscout/feature/LocationFeature.h
+ include/osmscout/feature/MaxSpeedFeature.h
+ include/osmscout/feature/NameFeature.h
+ include/osmscout/feature/NameAltFeature.h
+ include/osmscout/feature/NameShortFeature.h
+ include/osmscout/feature/NetworkFeature.h
+ include/osmscout/feature/OpeningHoursFeature.h
+ include/osmscout/feature/OperatorFeature.h
+ include/osmscout/feature/PhoneFeature.h
+ include/osmscout/feature/PostalCodeFeature.h
+ include/osmscout/feature/RefFeature.h
+ include/osmscout/feature/RoundaboutFeature.h
+ include/osmscout/feature/SidewayFeature.h
+ include/osmscout/feature/TunnelFeature.h
+ include/osmscout/feature/WebsiteFeature.h
+ include/osmscout/feature/WidthFeature.h
+ )
+
set(HEADER_FILES_NAVIGATION
include/osmscout/navigation/Agents.h
include/osmscout/navigation/ArrivalEstimateAgent.h
@@ -150,12 +185,70 @@
)
set(SOURCE_FILES
+ src/osmscout/feature/AccessFeature.cpp
+ src/osmscout/feature/AccessRestrictedFeature.cpp
+ src/osmscout/feature/AddressFeature.cpp
+ src/osmscout/feature/AdminLevelFeature.cpp
+ src/osmscout/feature/BridgeFeature.cpp
+ src/osmscout/feature/BuildingFeature.cpp
+ src/osmscout/feature/ClockwiseDirectionFeature.cpp
+ src/osmscout/feature/ColorFeature.cpp
+ src/osmscout/feature/ConstructionYearFeature.cpp
+ src/osmscout/feature/DestinationFeature.cpp
+ src/osmscout/feature/EleFeature.cpp
+ src/osmscout/feature/EmbankmentFeature.cpp
+ src/osmscout/feature/FromToFeature.cpp
+ src/osmscout/feature/GradeFeature.cpp
+ src/osmscout/feature/IsInFeature.cpp
+ src/osmscout/feature/LanesFeature.cpp
+ src/osmscout/feature/LayerFeature.cpp
+ src/osmscout/feature/LocationFeature.cpp
+ src/osmscout/feature/MaxSpeedFeature.cpp
+ src/osmscout/feature/NameFeature.cpp
+ src/osmscout/feature/NameAltFeature.cpp
+ src/osmscout/feature/NameShortFeature.cpp
+ src/osmscout/feature/NetworkFeature.cpp
+ src/osmscout/feature/OpeningHoursFeature.cpp
+ src/osmscout/feature/OperatorFeature.cpp
+ src/osmscout/feature/PhoneFeature.cpp
+ src/osmscout/feature/PostalCodeFeature.cpp
+ src/osmscout/feature/RefFeature.cpp
+ src/osmscout/feature/RoundaboutFeature.cpp
+ src/osmscout/feature/SidewayFeature.cpp
+ src/osmscout/feature/TunnelFeature.cpp
+ src/osmscout/feature/WebsiteFeature.cpp
+ src/osmscout/feature/WidthFeature.cpp
+ src/osmscout/navigation/Agents.cpp
+ src/osmscout/navigation/ArrivalEstimateAgent.cpp
+ src/osmscout/navigation/BearingAgent.cpp
+ src/osmscout/navigation/DataAgent.cpp
+ src/osmscout/navigation/PositionAgent.cpp
+ src/osmscout/navigation/RouteStateAgent.cpp
+ src/osmscout/navigation/RouteInstructionAgent.cpp
+ src/osmscout/navigation/SpeedAgent.cpp
+ src/osmscout/navigation/Engine.cpp
+ src/osmscout/navigation/VoiceInstructionAgent.cpp
+ src/osmscout/navigation/LaneAgent.cpp
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/routing/RouteData.cpp
+ src/osmscout/routing/RouteDescription.cpp
+ src/osmscout/routing/RouteNode.cpp
+ src/osmscout/routing/RouteNodeDataFile.cpp
+ src/osmscout/routing/RoutePostprocessor.cpp
+ src/osmscout/routing/RoutingDB.cpp
+ src/osmscout/routing/RoutingProfile.cpp
+ src/osmscout/routing/RoutingService.cpp
+ src/osmscout/routing/AbstractRoutingService.cpp
+ src/osmscout/routing/SimpleRoutingService.cpp
+ src/osmscout/routing/MultiDBRoutingService.cpp
+ src/osmscout/routing/TurnRestriction.cpp
+ src/osmscout/routing/MultiDBRoutingState.cpp
+ src/osmscout/routing/RouteDescriptionPostprocessor.cpp
src/osmscout/system/SSEMath.cpp
src/osmscout/util/Bearing.cpp
src/osmscout/util/Breaker.cpp
@@ -194,31 +287,6 @@
src/osmscout/util/WorkQueue.cpp
src/osmscout/util/SunriseSunset.cpp
src/osmscout/util/TagErrorReporter.cpp
- src/osmscout/routing/RouteData.cpp
- src/osmscout/routing/RouteDescription.cpp
- src/osmscout/routing/RouteNode.cpp
- src/osmscout/routing/RouteNodeDataFile.cpp
- src/osmscout/routing/RoutePostprocessor.cpp
- src/osmscout/routing/RoutingDB.cpp
- src/osmscout/routing/RoutingProfile.cpp
- src/osmscout/routing/RoutingService.cpp
- src/osmscout/routing/AbstractRoutingService.cpp
- src/osmscout/routing/SimpleRoutingService.cpp
- src/osmscout/routing/MultiDBRoutingService.cpp
- src/osmscout/routing/TurnRestriction.cpp
- src/osmscout/routing/MultiDBRoutingState.cpp
- src/osmscout/routing/RouteDescriptionPostprocessor.cpp
- src/osmscout/navigation/Agents.cpp
- src/osmscout/navigation/ArrivalEstimateAgent.cpp
- src/osmscout/navigation/BearingAgent.cpp
- src/osmscout/navigation/DataAgent.cpp
- src/osmscout/navigation/PositionAgent.cpp
- src/osmscout/navigation/RouteStateAgent.cpp
- src/osmscout/navigation/RouteInstructionAgent.cpp
- src/osmscout/navigation/SpeedAgent.cpp
- src/osmscout/navigation/Engine.cpp
- src/osmscout/navigation/VoiceInstructionAgent.cpp
- src/osmscout/navigation/LaneAgent.cpp
src/osmscout/Area.cpp
src/osmscout/AreaDataFile.cpp
src/osmscout/AreaAreaIndex.cpp
@@ -259,7 +327,6 @@
src/osmscout/Tag.cpp
src/osmscout/TypeConfig.cpp
src/osmscout/TypeFeature.cpp
- src/osmscout/TypeFeatures.cpp
src/osmscout/TypeInfoSet.cpp
src/osmscout/FeatureReader.cpp
src/osmscout/OSMScoutTypes.cpp
@@ -279,12 +346,13 @@
set(HEADER_FILES
${HEADER_FILES_ROOT}
+ ${HEADER_FILES_FEATURE}
+ ${HEADER_FILES_NAVIGATION}
${HEADER_FILES_OST}
${HEADER_FILES_PROJECTION}
- ${HEADER_FILES_SYSTEM}
- ${HEADER_FILES_UTIL}
${HEADER_FILES_ROUTING}
- ${HEADER_FILES_NAVIGATION})
+ ${HEADER_FILES_SYSTEM}
+ ${HEADER_FILES_UTIL})
osmscout_library_project(
NAME OSMScout
@@ -328,6 +396,8 @@
PROPERTIES MACOSX_PACKAGE_LOCATION Headers/routing)
set_source_files_properties(${HEADER_FILES_NAVIGATION}
PROPERTIES MACOSX_PACKAGE_LOCATION Headers/navigation)
+ set_source_files_properties(${HEADER_FILES_PROJECTION}
+ PROPERTIES MACOSX_PACKAGE_LOCATION Headers/projection)
set_target_properties(OSMScout PROPERTIES
FRAMEWORK TRUE
@@ -339,4 +409,3 @@
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscout DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN "private/Config.h" EXCLUDE)
endif()
-
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/meson.build
^
|
@@ -2,12 +2,72 @@
osmscoutHeader = [
'osmscout/CoreImportExport.h',
+ 'osmscout/feature/AccessFeature.h',
+ 'osmscout/feature/AccessRestrictedFeature.h',
+ 'osmscout/feature/AddressFeature.h',
+ 'osmscout/feature/AdminLevelFeature.h',
+ 'osmscout/feature/BridgeFeature.h',
+ 'osmscout/feature/BuildingFeature.h',
+ 'osmscout/feature/ClockwiseDirectionFeature.h',
+ 'osmscout/feature/ColorFeature.h',
+ 'osmscout/feature/ConstructionYearFeature.h',
+ 'osmscout/feature/DestinationFeature.h',
+ 'osmscout/feature/EleFeature.h',
+ 'osmscout/feature/EmbankmentFeature.h',
+ 'osmscout/feature/FromToFeature.h',
+ 'osmscout/feature/GradeFeature.h',
+ 'osmscout/feature/IsInFeature.h',
+ 'osmscout/feature/LanesFeature.h',
+ 'osmscout/feature/LayerFeature.h',
+ 'osmscout/feature/LocationFeature.h',
+ 'osmscout/feature/MaxSpeedFeature.h',
+ 'osmscout/feature/NameFeature.h',
+ 'osmscout/feature/NameAltFeature.h',
+ 'osmscout/feature/NameShortFeature.h',
+ 'osmscout/feature/NetworkFeature.h',
+ 'osmscout/feature/OpeningHoursFeature.h',
+ 'osmscout/feature/OperatorFeature.h',
+ 'osmscout/feature/PhoneFeature.h',
+ 'osmscout/feature/PostalCodeFeature.h',
+ 'osmscout/feature/RefFeature.h',
+ 'osmscout/feature/RoundaboutFeature.h',
+ 'osmscout/feature/SidewayFeature.h',
+ 'osmscout/feature/TunnelFeature.h',
+ 'osmscout/feature/WebsiteFeature.h',
+ 'osmscout/feature/WidthFeature.h',
+ 'osmscout/navigation/Agents.h',
+ 'osmscout/navigation/BearingAgent.h',
+ 'osmscout/navigation/DataAgent.h',
+ 'osmscout/navigation/PositionAgent.h',
+ 'osmscout/navigation/Engine.h',
+ 'osmscout/navigation/Navigation.h',
+ 'osmscout/navigation/RouteStateAgent.h',
+ 'osmscout/navigation/RouteInstructionAgent.h',
+ 'osmscout/navigation/ArrivalEstimateAgent.h',
+ 'osmscout/navigation/SpeedAgent.h',
+ 'osmscout/navigation/VoiceInstructionAgent.h',
+ 'osmscout/navigation/LaneAgent.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/routing/RouteDescription.h',
+ 'osmscout/routing/RouteDescriptionPostprocessor.h',
+ 'osmscout/routing/RouteData.h',
+ 'osmscout/routing/RouteNode.h',
+ 'osmscout/routing/RouteNodeDataFile.h',
+ 'osmscout/routing/RoutePostprocessor.h',
+ 'osmscout/routing/RoutingDB.h',
+ 'osmscout/routing/RoutingProfile.h',
+ 'osmscout/routing/RoutingService.h',
+ 'osmscout/routing/AbstractRoutingService.h',
+ 'osmscout/routing/SimpleRoutingService.h',
+ 'osmscout/routing/MultiDBRoutingService.h',
+ 'osmscout/routing/DBFileOffset.h',
+ 'osmscout/routing/TurnRestriction.h',
+ 'osmscout/routing/MultiDBRoutingState.h',
'osmscout/system/Assert.h',
'osmscout/system/Compiler.h',
'osmscout/system/Math.h',
@@ -57,33 +117,6 @@
'osmscout/util/TagErrorReporter.h',
'osmscout/util/utf8helper.h',
'osmscout/util/utf8helper_charmap.h',
- 'osmscout/routing/RouteDescription.h',
- 'osmscout/routing/RouteDescriptionPostprocessor.h',
- 'osmscout/routing/RouteData.h',
- 'osmscout/routing/RouteNode.h',
- 'osmscout/routing/RouteNodeDataFile.h',
- 'osmscout/routing/RoutePostprocessor.h',
- 'osmscout/routing/RoutingDB.h',
- 'osmscout/routing/RoutingProfile.h',
- 'osmscout/routing/RoutingService.h',
- 'osmscout/routing/AbstractRoutingService.h',
- 'osmscout/routing/SimpleRoutingService.h',
- 'osmscout/routing/MultiDBRoutingService.h',
- 'osmscout/routing/DBFileOffset.h',
- 'osmscout/routing/TurnRestriction.h',
- 'osmscout/routing/MultiDBRoutingState.h',
- 'osmscout/navigation/Agents.h',
- 'osmscout/navigation/BearingAgent.h',
- 'osmscout/navigation/DataAgent.h',
- 'osmscout/navigation/PositionAgent.h',
- 'osmscout/navigation/Engine.h',
- 'osmscout/navigation/Navigation.h',
- 'osmscout/navigation/RouteStateAgent.h',
- 'osmscout/navigation/RouteInstructionAgent.h',
- 'osmscout/navigation/ArrivalEstimateAgent.h',
- 'osmscout/navigation/SpeedAgent.h',
- 'osmscout/navigation/VoiceInstructionAgent.h',
- 'osmscout/navigation/LaneAgent.h',
'osmscout/Area.h',
'osmscout/AreaDataFile.h',
'osmscout/AreaAreaIndex.h',
@@ -125,7 +158,6 @@
'osmscout/Tag.h',
'osmscout/TypeConfig.h',
'osmscout/TypeFeature.h',
- 'osmscout/TypeFeatures.h',
'osmscout/TypeInfoSet.h',
'osmscout/FeatureReader.h',
'osmscout/OSMScoutTypes.h',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/ElevationService.h
^
|
@@ -23,7 +23,8 @@
#include <osmscout/TypeConfig.h>
#include <osmscout/Way.h>
#include <osmscout/CoreImportExport.h>
-#include <osmscout/FeatureReader.h>
+
+#include <osmscout/feature/EleFeature.h>
#include <osmscout/util/TileId.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/FeatureReader.h
^
|
@@ -24,7 +24,6 @@
#include <vector>
#include <osmscout/TypeFeature.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/TypeConfig.h>
namespace osmscout {
@@ -107,13 +106,6 @@
return false;
}
- using AccessRestrictedFeatureReader = FeatureReader<AccessRestrictedFeature>;
- using BridgeFeatureReader = FeatureReader<BridgeFeature>;
- using TunnelFeatureReader = FeatureReader<TunnelFeature>;
- using EmbankmentFeatureReader = FeatureReader<EmbankmentFeature>;
- using RoundaboutFeatureReader = FeatureReader<RoundaboutFeature>;
- using ClockwiseDirectionFeatureReader = FeatureReader<ClockwiseDirectionFeature>;
-
/**
* Variant of FeatureReader that is not type set and thus can easier get used
* in cases where runtime dynamics are required and features are referenced
@@ -257,30 +249,6 @@
return defaultValue;
}
- using NameFeatureValueReader = FeatureValueReader<NameFeature, NameFeatureValue>;
- using NameAltFeatureValueReader = FeatureValueReader<NameAltFeature, NameAltFeatureValue>;
- using NameShortFeatureValueReader = FeatureValueReader<NameShortFeature, NameShortFeatureValue>;
- using RefFeatureValueReader = FeatureValueReader<RefFeature, RefFeatureValue>;
- using LocationFeatureValueReader = FeatureValueReader<LocationFeature, LocationFeatureValue>;
- using AddressFeatureValueReader = FeatureValueReader<AddressFeature, AddressFeatureValue>;
- using AccessFeatureValueReader = FeatureValueReader<AccessFeature, AccessFeatureValue>;
- using AccessRestrictedFeatureValueReader = FeatureValueReader<AccessRestrictedFeature, AccessRestrictedFeatureValue>;
- using LayerFeatureValueReader = FeatureValueReader<LayerFeature, LayerFeatureValue>;
- using WidthFeatureValueReader = FeatureValueReader<WidthFeature, WidthFeatureValue>;
- using MaxSpeedFeatureValueReader = FeatureValueReader<MaxSpeedFeature, MaxSpeedFeatureValue>;
- using GradeFeatureValueReader = FeatureValueReader<GradeFeature, GradeFeatureValue>;
- using AdminLevelFeatureValueReader = FeatureValueReader<AdminLevelFeature, AdminLevelFeatureValue>;
- using PostalCodeFeatureValueReader = FeatureValueReader<PostalCodeFeature, PostalCodeFeatureValue>;
- using IsInFeatureValueReader = FeatureValueReader<IsInFeature, IsInFeatureValue>;
- using DestinationFeatureValueReader = FeatureValueReader<DestinationFeature, DestinationFeatureValue>;
- using ConstructionYearFeatureValueReader = FeatureValueReader<ConstructionYearFeature, ConstructionYearFeatureValue>;
- using LanesFeatureValueReader = FeatureValueReader<LanesFeature, LanesFeatureValue>;
- using EleFeatureValueReader = FeatureValueReader<EleFeature, EleFeatureValue>;
- using OperatorFeatureValueReader = FeatureValueReader<OperatorFeature, OperatorFeatureValue>;
- using NetworkFeatureValueReader = FeatureValueReader<NetworkFeature, NetworkFeatureValue>;
- using FromToFeatureValueReader = FeatureValueReader<FromToFeature, FromToFeatureValue>;
- using ColorFeatureValueReader = FeatureValueReader<ColorFeature, ColorFeatureValue>;
-
template <class F, class V>
class FeatureLabelReader
{
@@ -337,9 +305,6 @@
return "";
}
- using NameFeatureLabelReader = FeatureLabelReader<NameFeature, NameFeatureValue>;
- using RefFeatureLabelReader = FeatureLabelReader<RefFeature, RefFeatureValue>;
-
/**
* \defgroup type Object type related data structures and services
*/
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/AccessFeature.h
^
|
@@ -0,0 +1,279 @@
+#ifndef OSMSCOUT_FEATURE_ACCESS_FEATURE_H
+#define OSMSCOUT_FEATURE_ACCESS_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API AccessFeatureValue : public FeatureValue
+ {
+ public:
+ enum Access : uint8_t {
+ footForward = 1u << 0u,
+ footBackward = 1u << 1u,
+ bicycleForward = 1u << 2u,
+ bicycleBackward = 1u << 3u,
+ carForward = 1u << 4u,
+ carBackward = 1u << 5u,
+ onewayForward = 1u << 6u,
+ onewayBackward = 1u << 7u
+ };
+
+ private:
+ uint8_t access=0;
+
+ public:
+ AccessFeatureValue() = default;
+ AccessFeatureValue(const AccessFeatureValue& other) = default;
+
+ explicit AccessFeatureValue(uint8_t access)
+ : access(access)
+ {
+ // no code
+ }
+
+ void SetAccess(uint8_t access)
+ {
+ this->access=access;
+ }
+
+ uint8_t GetAccess() const
+ {
+ return access;
+ }
+
+ bool CanRoute() const
+ {
+ return (access & (footForward|footBackward|bicycleForward|bicycleBackward|carForward|carBackward))!=0;
+ }
+
+ bool CanRoute(Vehicle vehicle) const
+ {
+ switch (vehicle)
+ {
+ case vehicleFoot:
+ return (access & (footForward|footBackward))!=0;
+ case vehicleBicycle:
+ return (access & (bicycleForward|bicycleBackward))!=0;
+ case vehicleCar:
+ return (access & (carForward|carBackward))!=0;
+ }
+
+ return false;
+ }
+
+ bool CanRoute(VehicleMask vehicleMask) const
+ {
+ if ((vehicleMask & vehicleFoot)!=0 &&
+ (access & (footForward|footBackward))!=0) {
+ return true;
+ }
+
+ if ((vehicleMask & vehicleBicycle)!=0 &&
+ (access & (bicycleForward|bicycleBackward))!=0) {
+ return true;
+ }
+
+ if ((vehicleMask & vehicleCar)!=0 &&
+ (access & (carForward|carBackward))!=0) {
+ return true;
+ }
+
+ return false;
+ }
+
+ bool CanRouteForward() const
+ {
+ return (access & (footForward|bicycleForward|carForward))!=0;
+ }
+
+ bool CanRouteForward(Vehicle vehicle) const
+ {
+ switch (vehicle)
+ {
+ case vehicleFoot:
+ return (access & footForward)!=0;
+ case vehicleBicycle:
+ return (access & bicycleForward)!=0;
+ case vehicleCar:
+ return (access & carForward)!=0;
+ }
+
+ return false;
+ }
+
+ bool CanRouteBackward() const
+ {
+ return (access & (footBackward|bicycleBackward|carBackward))!=0;
+ }
+
+ bool CanRouteBackward(Vehicle vehicle) const
+ {
+ switch (vehicle)
+ {
+ case vehicleFoot:
+ return (access & footBackward)!=0;
+ case vehicleBicycle:
+ return (access & bicycleBackward)!=0;
+ case vehicleCar:
+ return (access & carBackward)!=0;
+ }
+
+ return false;
+ }
+
+ bool CanRouteFoot() const
+ {
+ return (access & footForward)!=0 ||
+ (access & footBackward)!=0;
+ }
+
+ bool CanRouteFootForward() const
+ {
+ return (access & footForward)!=0;
+ }
+
+ bool CanRouteFootBackward() const
+ {
+ return (access & footBackward)!=0;
+ }
+
+ bool CanRouteBicycle() const
+ {
+ return (access & bicycleForward)!=0 ||
+ (access & bicycleBackward)!=0;
+ }
+
+ bool CanRouteBicycleForward() const
+ {
+ return (access & bicycleForward)!=0;
+ }
+
+ bool CanRouteBicycleBackward() const
+ {
+ return (access & bicycleBackward)!=0;
+ }
+
+ bool CanRouteCar() const
+ {
+ return (access & carForward)!=0 ||
+ (access & carBackward)!=0;
+ }
+
+ bool CanRouteCarForward() const
+ {
+ return (access & carForward)!=0;
+ }
+
+ bool CanRouteCarBackward() const
+ {
+ return (access & carBackward)!=0;
+ }
+
+ bool IsOneway() const
+ {
+ return (access & (onewayForward|onewayBackward))!=0;
+ }
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/AccessRestrictedFeature.h
^
|
@@ -0,0 +1,162 @@
+#ifndef OSMSCOUT_FEATURE_ACCESS_RESTRICTED_FEATURE_H
+#define OSMSCOUT_FEATURE_ACCESS_RESTRICTED_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API AccessRestrictedFeatureValue : public FeatureValue
+ {
+ public:
+ enum Access : uint8_t {
+ foot = 1u << 0u,
+ bicycle = 1u << 1u,
+ car = 1u << 2u,
+ };
+
+ private:
+ uint8_t access=0;
+
+ public:
+ AccessRestrictedFeatureValue() = default;
+
+ explicit AccessRestrictedFeatureValue(uint8_t access)
+ : access(access)
+ {
+ // no code
+ }
+
+ void SetAccess(uint8_t access)
+ {
+ this->access=access;
+ }
+
+ uint8_t GetAccess() const
+ {
+ return access;
+ }
+
+ bool CanAccess() const
+ {
+ return (access & (foot|bicycle|car))!=0;
+ }
+
+ bool CanAccess(Vehicle vehicle) const
+ {
+ switch (vehicle)
+ {
+ case vehicleFoot:
+ return (access &foot)!=0;
+ case vehicleBicycle:
+ return (access & bicycle)!=0;
+ case vehicleCar:
+ return (access & car)!=0;
+ }
+
+ return false;
+ }
+
+ bool CanAccess(VehicleMask vehicleMask) const
+ {
+ if ((vehicleMask & vehicleFoot)!=0 &&
+ (access & foot)!=0) {
+ return true;
+ }
+
+ if ((vehicleMask & vehicleBicycle)!=0 &&
+ (access & bicycle)!=0) {
+ return true;
+ }
+
+ return (vehicleMask & vehicleCar)!=0 &&
+ (access & car)!=0;
+ }
+
+ bool CanAccessFoot() const
+ {
+ return (access & foot)!=0;
+ }
+
+ bool CanAccessBicycle() const
+ {
+ return (access & bicycle)!=0;
+ }
+
+ bool CanAccessCar() const
+ {
+ return (access & car)!=0;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ AccessRestrictedFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ /**
+ * AccessRestriction signals, if there is some access restriction for a given way and a given vehicle.
+ *
+ * An access restriction means, that a way can be used for a vehicle, but access ist restricted.
+ * Restricted access means, that you can enter a restricted region, but cannot leave it again for a given
+ * route. You may only enter the restricted region if you have a certain intention.
+ *
+ * No access restriction, does not mean that a way can be used for a given vehicle. You must still evaluate if
+ * there is access at all for the vehicle.
+ */
+ class OSMSCOUT_API AccessRestrictedFeature : public Feature
+ {
+ private:
+ TagId tagAccess;
+ TagId tagFoot;
+ TagId tagBicycle;
+ TagId tagMotorVehicle;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ 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;
+ };
+
+ using AccessRestrictedFeatureReader = FeatureReader<AccessRestrictedFeature>;
+ using AccessRestrictedFeatureValueReader = FeatureValueReader<AccessRestrictedFeature, AccessRestrictedFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/AddressFeature.h
^
|
@@ -0,0 +1,111 @@
+#ifndef OSMSCOUT_FEATURE_ADDRESS_FEATURE_H
+#define OSMSCOUT_FEATURE_ADDRESS_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ /**
+ * The address feature stores the house number of an (normally) node or area. Even the data is not stored
+ * the address feature checks that a street or place and an house number is stored on the object.
+ *
+ * So in effect it stores the house number part of objects that have an address.
+ */
+ class OSMSCOUT_API AddressFeatureValue : public FeatureValue
+ {
+ private:
+ std::string address;
+
+ public:
+ AddressFeatureValue() = default;
+ AddressFeatureValue(const AddressFeatureValue& featureValue) = default;
+
+ explicit AddressFeatureValue(const std::string& address)
+ : address(address)
+ {
+ // no code
+ }
+
+ void SetAddress(const std::string_view& address)
+ {
+ this->address=address;
+ }
+
+ std::string GetAddress() const
+ {
+ return address;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return address;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ AddressFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API AddressFeature : public Feature
+ {
+ private:
+ TagId tagAddrHouseNr=0;
+ TagId tagAddrStreet=0;
+ TagId tagAddrPlace=0;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ AddressFeature();
+ 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;
+ };
+
+ using AddressFeatureValueReader = FeatureValueReader<AddressFeature, AddressFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/AdminLevelFeature.h
^
|
@@ -0,0 +1,104 @@
+#ifndef OSMSCOUT_FEATURE_ADMIN_LEVEL_FEATURE_H
+#define OSMSCOUT_FEATURE_ADMIN_LEVEL_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API AdminLevelFeatureValue : public FeatureValue
+ {
+ private:
+ uint8_t adminLevel=0;
+ std::string isIn;
+
+ public:
+ AdminLevelFeatureValue() = default;
+
+ AdminLevelFeatureValue(uint8_t adminLevel,
+ const std::string& isIn)
+ : adminLevel(adminLevel),
+ isIn(isIn)
+ {
+ // no code
+ }
+
+ void SetAdminLevel(uint8_t adminLevel)
+ {
+ this->adminLevel=adminLevel;
+ }
+
+ void SetIsIn(const std::string_view& isIn)
+ {
+ this->isIn=isIn;
+ }
+
+ uint8_t GetAdminLevel() const
+ {
+ return adminLevel;
+ }
+
+ std::string GetIsIn() const
+ {
+ return isIn;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ AdminLevelFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API AdminLevelFeature : public Feature
+ {
+ private:
+ TagId tagAdminLevel;
+ TagId tagIsIn;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ 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;
+ };
+
+ using AdminLevelFeatureValueReader = FeatureValueReader<AdminLevelFeature, AdminLevelFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/BridgeFeature.h
^
|
@@ -0,0 +1,55 @@
+#ifndef OSMSCOUT_FEATURE_BRIDGE_FEATURE_H
+#define OSMSCOUT_FEATURE_BRIDGE_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API BridgeFeature : public Feature
+ {
+ private:
+ TagId tagBridge;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ void Initialize(TagRegistry& tagRegistry) override;
+
+ std::string GetName() const override;
+
+ void Parse(TagErrorReporter& reporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const override;
+ };
+
+ using BridgeFeatureReader = FeatureReader<BridgeFeature>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/BuildingFeature.h
^
|
@@ -0,0 +1,53 @@
+#ifndef OSMSCOUT_FEATURE_BUILDING_FEATURE_H
+#define OSMSCOUT_FEATURE_BUILDING_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API BuildingFeature : public Feature
+ {
+ private:
+ TagId tagBuilding;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ void Initialize(TagRegistry& tagRegistry) override;
+
+ std::string GetName() const override;
+
+ void Parse(TagErrorReporter& reporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const override;
+ };
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/ClockwiseDirectionFeature.h
^
|
@@ -0,0 +1,55 @@
+#ifndef OSMSCOUT_FEATURE_CLOCKWISE_DIRECTION_FEATURE_H
+#define OSMSCOUT_FEATURE_CLOCKWISE_DIRECTION_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API ClockwiseDirectionFeature : public Feature
+ {
+ private:
+ TagId tagDirection;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ void Initialize(TagRegistry& tagRegistry) override;
+
+ std::string GetName() const override;
+
+ void Parse(TagErrorReporter& reporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const override;
+ };
+
+ using ClockwiseDirectionFeatureReader = FeatureReader<ClockwiseDirectionFeature>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/ColorFeature.h
^
|
@@ -0,0 +1,105 @@
+#ifndef OSMSCOUT_FEATURE_COLOR_FEATURE_H
+#define OSMSCOUT_FEATURE_COLOR_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API ColorFeatureValue : public FeatureValue
+ {
+ private:
+ Color color;
+
+ public:
+ ColorFeatureValue() = default;
+ ColorFeatureValue(const ColorFeatureValue& featureValue) = default;
+
+ explicit ColorFeatureValue(const Color& color)
+ : color(color)
+ {
+ // no code
+ }
+
+ Color GetColor() const
+ {
+ return color;
+ }
+
+ void SetColor(const Color& color)
+ {
+ ColorFeatureValue::color=color;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return color.ToHexString();
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ ColorFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API ColorFeature : public Feature
+ {
+ private:
+ TagId tagColor;
+ TagId tagSymbol;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "number" label */
+ static const char* const NUMBER_LABEL;
+
+ /** Index of the 'number' label */
+ static const size_t NUMBER_LABEL_INDEX;
+
+ public:
+ ColorFeature();
+ 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;
+ };
+
+ using ColorFeatureValueReader = FeatureValueReader<ColorFeature, ColorFeatureValue>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/ConstructionYearFeature.h
^
|
@@ -0,0 +1,119 @@
+#ifndef OSMSCOUT_FEATURE_CONSTRUCTION_YEAR_FEATURE_H
+#define OSMSCOUT_FEATURE_CONSTRUCTION_YEAR_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API ConstructionYearFeatureValue : public FeatureValue
+ {
+ private:
+ int startYear=0;
+ int endYear=0;
+
+ public:
+ ConstructionYearFeatureValue() = default;
+
+ ConstructionYearFeatureValue(int startYear, int endYear)
+ : startYear(startYear),
+ endYear(endYear)
+ {
+ // no code
+ }
+
+ void SetStartYear(int year)
+ {
+ this->startYear=year;
+ }
+
+ int GetStartYear() const
+ {
+ return startYear;
+ }
+
+ void SetEndYear(int year)
+ {
+ this->endYear=year;
+ }
+
+ int GetEndYear() const
+ {
+ return endYear;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ if (startYear==endYear) {
+ return std::to_string(startYear);
+ }
+
+ return std::to_string(startYear)+"-"+std::to_string(endYear);
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ ConstructionYearFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API ConstructionYearFeature : public Feature
+ {
+ private:
+ TagId tagConstructionYear;
+ TagId tagStartDate;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "year" label */
+ static const char* const YEAR_LABEL;
+
+ /** Index of the 'year' label */
+ static const size_t YEAR_LABEL_INDEX;
+
+ public:
+ ConstructionYearFeature();
+ 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;
+ };
+
+ using ConstructionYearFeatureValueReader = FeatureValueReader<ConstructionYearFeature, ConstructionYearFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/DestinationFeature.h
^
|
@@ -0,0 +1,104 @@
+#ifndef OSMSCOUT_FEATURE_DESTINATION_FEATURE_H
+#define OSMSCOUT_FEATURE_DESTINATION_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API DestinationFeatureValue : public FeatureValue
+ {
+ private:
+ std::string destination;
+
+ public:
+ DestinationFeatureValue() = default;
+
+ explicit DestinationFeatureValue(const std::string& destination)
+ : destination(destination)
+ {
+ // no code
+ }
+
+ void SetDestination(const std::string_view& destination)
+ {
+ this->destination=destination;
+ }
+
+ std::string GetDestination() const
+ {
+ return destination;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return destination;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ DestinationFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API DestinationFeature : public Feature
+ {
+ private:
+ TagId tagDestination=0;
+ TagId tagDestinationRef=0;
+ TagId tagDestinationForward=0;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ DestinationFeature();
+ 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;
+ };
+
+ using DestinationFeatureValueReader = FeatureValueReader<DestinationFeature, DestinationFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/EleFeature.h
^
|
@@ -0,0 +1,112 @@
+#ifndef OSMSCOUT_FEATURE_ELE_FEATURE_H
+#define OSMSCOUT_FEATURE_ELE_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API EleFeatureValue : public FeatureValue
+ {
+ private:
+ int16_t ele=0;
+
+ public:
+ EleFeatureValue() = default;
+
+ explicit EleFeatureValue(int16_t ele)
+ : ele(ele)
+ {
+ // no code
+ }
+
+ void SetEle(int16_t ele)
+ {
+ this->ele=ele;
+ }
+
+ int16_t GetEle() const
+ {
+ return ele;
+ }
+
+ std::string GetLabel(const Locale &locale, size_t labelIndex) const override;
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ EleFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API EleFeature : public Feature
+ {
+ private:
+ TagId tagEle=0;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "inMeter" label */
+ static const char* const IN_METER_LABEL;
+
+ /** Index of the 'inMeter' label */
+ static const size_t IN_METER_LABEL_INDEX;
+
+ /** Name of the "inFeet" label */
+ static const char* const IN_FEET_LABEL;
+
+ /** Index of the 'inFeet' label */
+ static const size_t IN_FEET_LABEL_INDEX;
+
+ /** Name of the "inLocaleUnit" label */
+ static const char* const IN_LOCALE_UNIT_LABEL;
+
+ /** Index of the 'inLocaleUnit' label */
+ static const size_t IN_LOCALE_UNIT_LABEL_INDEX;
+
+ public:
+ EleFeature();
+ 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;
+ };
+
+ using EleFeatureValueReader = FeatureValueReader<EleFeature, EleFeatureValue>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/EmbankmentFeature.h
^
|
@@ -0,0 +1,56 @@
+#ifndef OSMSCOUT_FEATURE_EMBANKMENT_FEATURE_H
+#define OSMSCOUT_FEATURE_EMBANKMENT_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API EmbankmentFeature : public Feature
+ {
+ private:
+ TagId tagEmbankment;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ void Initialize(TagRegistry& tagRegistry) override;
+
+ std::string GetName() const override;
+
+ void Parse(TagErrorReporter& reporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const override;
+ };
+
+ using EmbankmentFeatureReader = FeatureReader<EmbankmentFeature>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/FromToFeature.h
^
|
@@ -0,0 +1,129 @@
+#ifndef OSMSCOUT_FEATURE_FROM_TO_FEATURE_H
+#define OSMSCOUT_FEATURE_FROM_TO_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API FromToFeatureValue : public FeatureValue
+ {
+ private:
+ std::string from;
+ std::string to;
+
+ public:
+ FromToFeatureValue() = default;
+ FromToFeatureValue(const FromToFeatureValue& featureValue) = default;
+
+ explicit FromToFeatureValue(const std::string_view& from,
+ const std::string_view& to)
+ : from(from),
+ to(to)
+ {
+ // no code
+ }
+
+ const std::string& GetFrom() const
+ {
+ return from;
+ }
+
+ void SetFrom(const std::string_view& from)
+ {
+ FromToFeatureValue::from=from;
+ }
+
+ const std::string& GetTo() const
+ {
+ return to;
+ }
+
+ void SetTo(const std::string_view& to)
+ {
+ FromToFeatureValue::to=to;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ if (!from.empty() && ! to.empty()) {
+ return from + " => " + to;
+ }
+
+ if (!from.empty()) {
+ return from + "=>";
+ }
+
+ if (!to.empty()) {
+ return "=> " + to;
+ }
+
+ return "";
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ FromToFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API FromToFeature : public Feature
+ {
+ private:
+ TagId tagFrom;
+ TagId tagTo;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "number" label */
+ static const char* const NUMBER_LABEL;
+
+ /** Index of the 'number' label */
+ static const size_t NUMBER_LABEL_INDEX;
+
+ public:
+ FromToFeature();
+ 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;
+ };
+
+ using FromToFeatureValueReader = FeatureValueReader<FromToFeature, FromToFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/GradeFeature.h
^
|
@@ -0,0 +1,91 @@
+#ifndef OSMSCOUT_FEATURE_GRADE_FEATURE_H
+#define OSMSCOUT_FEATURE_GRADE_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API GradeFeatureValue : public FeatureValue
+ {
+ private:
+ uint8_t grade=0;
+
+ public:
+ GradeFeatureValue() = default;
+
+ explicit GradeFeatureValue(uint8_t grade)
+ : grade(grade)
+ {
+ // no code
+ }
+
+ void SetGrade(uint8_t grade)
+ {
+ this->grade=grade;
+ }
+
+ uint8_t GetGrade() const
+ {
+ return grade;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ GradeFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API GradeFeature : public Feature
+ {
+ private:
+ TagId tagSurface;
+ TagId tagTrackType;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ 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;
+ };
+
+ using GradeFeatureValueReader = FeatureValueReader<GradeFeature, GradeFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/IsInFeature.h
^
|
@@ -0,0 +1,91 @@
+#ifndef OSMSCOUT_FEATURE_IS_IN_FEATURE_H
+#define OSMSCOUT_FEATURE_IS_IN_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API IsInFeatureValue : public FeatureValue
+ {
+ private:
+ std::string isIn;
+
+ public:
+ IsInFeatureValue() = default;
+
+ explicit IsInFeatureValue(const std::string& isIn)
+ : isIn(isIn)
+ {
+ // no code
+ }
+
+ void SetIsIn(const std::string_view& isIn)
+ {
+ this->isIn=isIn;
+ }
+
+ std::string GetIsIn() const
+ {
+ return isIn;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ IsInFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API IsInFeature : public Feature
+ {
+ private:
+ TagId tagIsIn;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ 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;
+ };
+
+ using IsInFeatureValueReader = FeatureValueReader<IsInFeature, IsInFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/LanesFeature.h
^
|
@@ -0,0 +1,171 @@
+#ifndef OSMSCOUT_FEATURE_LANES_FEATURE_H
+#define OSMSCOUT_FEATURE_LANES_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+#include <osmscout/util/LaneTurn.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API LanesFeatureValue : public FeatureValue
+ {
+ private:
+
+ uint8_t lanes=0; //!< First two bits reserved, 3 bit for number of lanes in each direction
+ std::vector<LaneTurn> turnForward;
+ std::vector<LaneTurn> turnBackward;
+ std::string destinationForward;
+ std::string destinationBackward;
+
+ public:
+ LanesFeatureValue() = default;
+
+ explicit LanesFeatureValue(uint8_t lanes)
+ : lanes(lanes)
+ {
+ // no code
+ }
+
+ void SetLanes(uint8_t forwardLanes,
+ uint8_t backwardLanes)
+ {
+ this->lanes=((forwardLanes & uint8_t(0x7u)) << 2) |
+ ((backwardLanes & uint8_t(0x7u)) << 5);
+ }
+
+ bool HasSingleLane() const
+ {
+ return GetLanes()==0;
+ }
+
+ uint8_t GetForwardLanes() const
+ {
+ return (lanes >> 2) & (uint8_t)0x07;
+ }
+
+ uint8_t GetBackwardLanes() const
+ {
+ return (lanes >> 5) & (uint8_t)0x07;
+ }
+
+ uint8_t GetLanes() const;
+
+ void SetTurnLanes(const std::vector<LaneTurn>& turnForward,
+ const std::vector<LaneTurn>& turnBackward)
+ {
+ this->turnForward=turnForward;
+ this->turnBackward=turnBackward;
+ }
+
+ std::vector<LaneTurn> GetTurnForward() const
+ {
+ return turnForward;
+ }
+
+ std::vector<LaneTurn> GetTurnBackward() const
+ {
+ return turnBackward;
+ }
+
+ std::string GetDestinationForward() const
+ {
+ return destinationForward;
+ }
+
+ std::string GetDestinationBackward() const
+ {
+ return destinationBackward;
+ }
+
+ void SetDestinationLanes(const std::string_view& destinationForward,
+ const std::string_view& destinationBackward)
+ {
+ this->destinationForward=destinationForward;
+ this->destinationBackward=destinationBackward;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ if (HasSingleLane()) {
+ return "1";
+ }
+
+ return std::to_string(GetForwardLanes()) + " " + std::to_string(GetBackwardLanes());
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ LanesFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API LanesFeature : public Feature
+ {
+ private:
+ TagId tagOneway=0;
+ TagId tagLanes=0;
+ TagId tagLanesForward=0;
+ TagId tagLanesBackward=0;
+ TagId tagTurnLanes=0;
+ TagId tagTurnLanesForward=0;
+ TagId tagTurnLanesBackward=0;
+ TagId tagDestinationLanes=0;
+ TagId tagDestinationLanesForward=0;
+ TagId tagDestinationLanesBackward=0;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ LanesFeature();
+ 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;
+ };
+
+ using LanesFeatureValueReader = FeatureValueReader<LanesFeature, LanesFeatureValue>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/LayerFeature.h
^
|
@@ -0,0 +1,90 @@
+#ifndef OSMSCOUT_FEATURE_LAYER_FEATURE_H
+#define OSMSCOUT_FEATURE_LAYER_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API LayerFeatureValue : public FeatureValue
+ {
+ private:
+ int8_t layer=0;
+
+ public:
+ LayerFeatureValue() = default;
+
+ explicit LayerFeatureValue(int8_t layer)
+ : layer(layer)
+ {
+ // no code
+ }
+
+ void SetLayer(int8_t layer)
+ {
+ this->layer=layer;
+ }
+
+ int8_t GetLayer() const
+ {
+ return layer;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ LayerFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API LayerFeature : public Feature
+ {
+ private:
+ TagId tagLayer;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ 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;
+ };
+
+ using LayerFeatureValueReader = FeatureValueReader<LayerFeature, LayerFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/LocationFeature.h
^
|
@@ -0,0 +1,104 @@
+#ifndef OSMSCOUT_FEATURE_LOCATION_FEATURE_H
+#define OSMSCOUT_FEATURE_LOCATION_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API LocationFeatureValue : public FeatureValue
+ {
+ private:
+ std::string location;
+
+ public:
+ LocationFeatureValue() = default;
+ LocationFeatureValue(const LocationFeatureValue& featureValue) = default;
+
+ explicit LocationFeatureValue(const std::string& location)
+ : location(location)
+ {
+ // no code
+ }
+
+ void SetLocation(const std::string_view& location)
+ {
+ this->location=location;
+ }
+
+ std::string GetLocation() const
+ {
+ return location;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return location;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ LocationFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ /**
+ * The location feature stores the location of an (normally) node or area. Even the data is not stored
+ * the location feature checks that a street or place and an house number is stored on the object.
+ *
+ * So in effect it stores the location part of objects that have an address.
+ */
+ class OSMSCOUT_API LocationFeature : public Feature
+ {
+ private:
+ TagId tagAddrStreet;
+ TagId tagAddrHouseNr;
+ TagId tagAddrPlace;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ 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;
+ };
+
+ using LocationFeatureValueReader = FeatureValueReader<LocationFeature, LocationFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/MaxSpeedFeature.h
^
|
@@ -0,0 +1,101 @@
+#ifndef OSMSCOUT_FEATURE_MAX_SPEED_FEATURE_H
+#define OSMSCOUT_FEATURE_MAX_SPEED_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API MaxSpeedFeatureValue : public FeatureValue
+ {
+ private:
+ uint8_t maxSpeed=0;
+
+ public:
+ MaxSpeedFeatureValue() = default;
+
+ explicit MaxSpeedFeatureValue(uint8_t maxSpeed)
+ : maxSpeed(maxSpeed)
+ {
+ // no code
+ }
+
+ void SetMaxSpeed(uint8_t maxSpeed)
+ {
+ this->maxSpeed=maxSpeed;
+ }
+
+ uint8_t GetMaxSpeed() const
+ {
+ return maxSpeed;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ MaxSpeedFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API MaxSpeedFeature : public Feature
+ {
+ private:
+ TagId tagMaxSpeed;
+ TagId tagMaxSpeedForward;
+ TagId tagMaxSpeedBackward;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ private:
+ bool GetTagValue(TagErrorReporter& errorReporter,
+ const TagRegistry& tagRegistry,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ const std::string& input,
+ uint8_t& speed) const;
+
+ public:
+ 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;
+ };
+
+ using MaxSpeedFeatureValueReader = FeatureValueReader<MaxSpeedFeature, MaxSpeedFeatureValue>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/NameAltFeature.h
^
|
@@ -0,0 +1,100 @@
+#ifndef OSMSCOUT_FEATURE_NAME_ALT_FEATURE_H
+#define OSMSCOUT_FEATURE_NAME_ALT_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API NameAltFeatureValue : public FeatureValue
+ {
+ private:
+ std::string nameAlt;
+
+ public:
+ NameAltFeatureValue() = default;
+ NameAltFeatureValue(const NameAltFeatureValue& featureValue) = default;
+
+ explicit NameAltFeatureValue(const std::string& nameAlt)
+ : nameAlt(nameAlt)
+ {
+ // no code
+ }
+
+ void SetNameAlt(const std::string_view& nameAlt)
+ {
+ this->nameAlt=nameAlt;
+ }
+
+ std::string GetNameAlt() const
+ {
+ return nameAlt;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return nameAlt;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ NameAltFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API NameAltFeature : public Feature
+ {
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ NameAltFeature();
+ 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;
+ };
+
+ using NameAltFeatureValueReader = FeatureValueReader<NameAltFeature, NameAltFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/NameFeature.h
^
|
@@ -0,0 +1,102 @@
+#ifndef OSMSCOUT_FEATURE_NAME_FEATURE_H
+#define OSMSCOUT_FEATURE_NAME_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API NameFeatureValue : public FeatureValue
+ {
+ private:
+ std::string name;
+
+ public:
+ NameFeatureValue() = default;
+ NameFeatureValue(const NameFeatureValue& featureValue) = default;
+
+ explicit NameFeatureValue(const std::string& name)
+ : name(name)
+ {
+ // no code
+ }
+
+ void SetName(const std::string_view& name)
+ {
+ this->name=name;
+ }
+
+ std::string GetName() const
+ {
+ return name;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return name;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ NameFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API NameFeature : public Feature
+ {
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ NameFeature();
+ 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;
+ };
+
+ using NameFeatureValueReader = FeatureValueReader<NameFeature, NameFeatureValue>;
+ using NameFeatureLabelReader = FeatureLabelReader<NameFeature, NameFeatureValue>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/NameShortFeature.h
^
|
@@ -0,0 +1,102 @@
+#ifndef OSMSCOUT_FEATURE_NAME_SHORT_FEATURE_H
+#define OSMSCOUT_FEATURE_NAME_SHORT_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API NameShortFeatureValue : public FeatureValue
+ {
+ private:
+ std::string nameShort;
+
+ public:
+ NameShortFeatureValue() = default;
+
+ explicit NameShortFeatureValue(const std::string& nameShort)
+ : nameShort(nameShort)
+ {
+ // no code
+ }
+
+ void SetNameShort(const std::string_view& nameShort)
+ {
+ this->nameShort=nameShort;
+ }
+
+ std::string GetNameShort() const
+ {
+ return nameShort;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return nameShort;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ NameShortFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API NameShortFeature : public Feature
+ {
+ private:
+ TagId tagShortName=0;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ NameShortFeature();
+ 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;
+ };
+
+ using NameShortFeatureValueReader = FeatureValueReader<NameShortFeature, NameShortFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/NetworkFeature.h
^
|
@@ -0,0 +1,103 @@
+#ifndef OSMSCOUT_FEATURE_NETWORK_FEATURE_H
+#define OSMSCOUT_FEATURE_NETWORK_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API NetworkFeatureValue : public FeatureValue
+ {
+ private:
+ std::string network;
+
+ public:
+ NetworkFeatureValue() = default;
+ NetworkFeatureValue(const NetworkFeatureValue& featureValue) = default;
+
+ explicit NetworkFeatureValue(const std::string& network)
+ : network(network)
+ {
+ // no code
+ }
+
+ void SetNetwork(const std::string_view& network)
+ {
+ this->network=network;
+ }
+
+ std::string GetNetwork() const
+ {
+ return network;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return network;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ NetworkFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API NetworkFeature : public Feature
+ {
+ private:
+ TagId tagNetwork;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ NetworkFeature();
+ 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;
+ };
+
+ using NetworkFeatureValueReader = FeatureValueReader<NetworkFeature, NetworkFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/OpeningHoursFeature.h
^
|
@@ -0,0 +1,101 @@
+#ifndef OSMSCOUT_FEATURE_OPENING_HOURS_FEATURE_H
+#define OSMSCOUT_FEATURE_OPENING_HOURS_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ 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_view& 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;
+ 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;
+ };
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/OperatorFeature.h
^
|
@@ -0,0 +1,103 @@
+#ifndef OSMSCOUT_FEATURE_OPERATOR_FEATURE_H
+#define OSMSCOUT_FEATURE_OPERATOR_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API OperatorFeatureValue : public FeatureValue
+ {
+ private:
+ std::string op;
+
+ public:
+ OperatorFeatureValue() = default;
+ OperatorFeatureValue(const OperatorFeatureValue& featureValue) = default;
+
+ explicit OperatorFeatureValue(const std::string& op)
+ : op(op)
+ {
+ // no code
+ }
+
+ void SetOperator(const std::string_view& op)
+ {
+ this->op=op;
+ }
+
+ std::string GetOperator() const
+ {
+ return op;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return op;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ OperatorFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API OperatorFeature : public Feature
+ {
+ private:
+ TagId tagOperator;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ OperatorFeature();
+ 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;
+ };
+
+ using OperatorFeatureValueReader = FeatureValueReader<OperatorFeature, OperatorFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/PhoneFeature.h
^
|
@@ -0,0 +1,102 @@
+#ifndef OSMSCOUT_FEATURE_PHONE_FEATURE_H
+#define OSMSCOUT_FEATURE_PHONE_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API PhoneFeatureValue : public FeatureValue
+ {
+ private:
+ std::string phone;
+
+ public:
+ PhoneFeatureValue() = default;
+
+ explicit PhoneFeatureValue(const std::string& phone)
+ : phone(phone)
+ {
+ // no code
+ }
+
+ void SetPhone(const std::string_view& phone)
+ {
+ this->phone=phone;
+ }
+
+ std::string GetPhone() const
+ {
+ return phone;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return phone;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ PhoneFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API PhoneFeature : public Feature
+ {
+ private:
+ TagId tagPhone;
+ TagId tagContactPhone;
+ TagId tagContactMobile;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "number" label */
+ static const char* const NUMBER_LABEL;
+
+ /** Index of the 'number' label */
+ static const size_t NUMBER_LABEL_INDEX;
+
+ public:
+ PhoneFeature();
+ 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;
+ };
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/PostalCodeFeature.h
^
|
@@ -0,0 +1,104 @@
+#ifndef OSMSCOUT_FEATURE_POSTAL_CODE_FEATURE_H
+#define OSMSCOUT_FEATURE_POSTAL_CODE_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API PostalCodeFeatureValue : public FeatureValue
+ {
+ private:
+ std::string postalCode;
+
+ public:
+ PostalCodeFeatureValue() = default;
+
+ explicit PostalCodeFeatureValue(const std::string& postalCode)
+ : postalCode(postalCode)
+ {
+ // no code
+ }
+
+ void SetPostalCode(const std::string_view& postalCode)
+ {
+ this->postalCode=postalCode;
+ }
+
+ std::string GetPostalCode() const
+ {
+ return postalCode;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return postalCode;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ PostalCodeFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API PostalCodeFeature : public Feature
+ {
+ private:
+ TagId tagPostalCode;
+ TagId tagAddrPostCode;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "name" label */
+ static const char* const NAME_LABEL;
+
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ PostalCodeFeature();
+
+ 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;
+ };
+
+ using PostalCodeFeatureValueReader = FeatureValueReader<PostalCodeFeature, PostalCodeFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/RefFeature.h
^
|
@@ -0,0 +1,103 @@
+#ifndef OSMSCOUT_FEATURE_REF_FEATURE_H
+#define OSMSCOUT_FEATURE_REF_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API RefFeatureValue : public FeatureValue
+ {
+ private:
+ std::string ref;
+
+ public:
+ RefFeatureValue() = default;
+ RefFeatureValue(const RefFeatureValue& featureValue) = default;
+
+ explicit RefFeatureValue(const std::string& ref)
+ : ref(ref)
+ {
+ // no code
+ }
+
+ void SetRef(const std::string_view& ref)
+ {
+ this->ref=ref;
+ }
+
+ std::string GetRef() const
+ {
+ return ref;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return ref;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ RefFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API RefFeature : public Feature
+ {
+ private:
+ TagId tagRef=0;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+ /** Name of this feature */
+ static const char* const NAME_LABEL;
+ /** Index of the 'name' label */
+ static const size_t NAME_LABEL_INDEX;
+
+ public:
+ RefFeature();
+ 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;
+ };
+
+ using RefFeatureValueReader = FeatureValueReader<RefFeature, RefFeatureValue>;
+ using RefFeatureLabelReader = FeatureLabelReader<RefFeature, RefFeatureValue>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/RoundaboutFeature.h
^
|
@@ -0,0 +1,56 @@
+#ifndef OSMSCOUT_FEATURE_ROUNDABOUT_FEATURE_H
+#define OSMSCOUT_FEATURE_ROUNDABOUT_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API RoundaboutFeature : public Feature
+ {
+ private:
+ TagId tagJunction;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ void Initialize(TagRegistry& tagRegistry) override;
+
+ std::string GetName() const override;
+
+ void Parse(TagErrorReporter& reporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const override;
+ };
+
+ using RoundaboutFeatureReader = FeatureReader<RoundaboutFeature>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/SidewayFeature.h
^
|
@@ -0,0 +1,137 @@
+#ifndef OSMSCOUT_FEATURE_SIDEWAY_FEATURE_H
+#define OSMSCOUT_FEATURE_SIDEWAY_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API SidewayFeatureValue : public FeatureValue
+ {
+ public:
+ enum Feature : uint8_t {
+ sidewalkTrackLeft = 1u << 0u,
+ sidewalkTrackRight = 1u << 1u,
+ cyclewayLaneLeft = 1u << 2u,
+ cyclewayLaneRight = 1u << 3u,
+ cyclewayTrackLeft = 1u << 4u,
+ cyclewayTrackRight = 1u << 5u,
+ };
+
+ private:
+ uint8_t featureSet=0;
+
+ public:
+ SidewayFeatureValue() = default;
+
+ bool IsFlagSet(size_t flagIndex) const override
+ {
+ return (featureSet & (1<< flagIndex))!=0;
+ }
+
+ void SetFeatureSet(uint8_t featureSet)
+ {
+ this->featureSet=featureSet;
+ }
+
+ bool HasSidewalkTrackLeft() const
+ {
+ return (featureSet & sidewalkTrackLeft)!=0;
+ }
+
+ bool HasSidewalkTrackRight() const
+ {
+ return (featureSet & sidewalkTrackRight)!=0;
+ }
+
+ bool HasCyclewayLaneLeft() const
+ {
+ return (featureSet & cyclewayLaneLeft)!=0;
+ }
+
+ bool HasCyclewayLaneRight() const
+ {
+ return (featureSet & cyclewayLaneRight)!=0;
+ }
+
+ bool HasCyclewayTrackLeft() const
+ {
+ return (featureSet & cyclewayTrackLeft)!=0;
+ }
+
+ bool HasCyclewayTrackRight() const
+ {
+ return (featureSet & cyclewayTrackRight)!=0;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ SidewayFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API SidewayFeature : public Feature
+ {
+ private:
+ enum class FeatureFlags: uint8_t {
+ sidewalkTrackLeft = 0,
+ sidewalkTrackRight = 1,
+ cyclewayLaneLeft = 2,
+ cyclewayLaneRight = 3,
+ cyclewayTrackLeft = 4,
+ cyclewayTrackRight = 5
+ };
+
+ private:
+ TagId tagSidewalk;
+ TagId tagCyclewayLeft;
+ TagId tagCyclewayLeftSegregated;
+ TagId tagCyclewayRight;
+ TagId tagCyclewayRightSegregated;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ SidewayFeature();
+ 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;
+ };
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/TunnelFeature.h
^
|
@@ -0,0 +1,56 @@
+#ifndef OSMSCOUT_FEATURE_TUNNEL_FEATURE_H
+#define OSMSCOUT_FEATURE_TUNNEL_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API TunnelFeature : public Feature
+ {
+ private:
+ TagId tagTunnel;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ void Initialize(TagRegistry& tagRegistry) override;
+
+ std::string GetName() const override;
+
+ void Parse(TagErrorReporter& reporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const override;
+ };
+
+ using TunnelFeatureReader = FeatureReader<TunnelFeature>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/WebsiteFeature.h
^
|
@@ -0,0 +1,101 @@
+#ifndef OSMSCOUT_FEATURE_WEBSIDE_FEATURE_H
+#define OSMSCOUT_FEATURE_WEBSIDE_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API WebsiteFeatureValue : public FeatureValue
+ {
+ private:
+ std::string website;
+
+ public:
+ WebsiteFeatureValue() = default;
+
+ explicit WebsiteFeatureValue(const std::string& website)
+ : website(website)
+ {
+ // no code
+ }
+
+ void SetWebsite(const std::string_view& website)
+ {
+ this->website=website;
+ }
+
+ std::string GetWebsite() const
+ {
+ return website;
+ }
+
+ std::string GetLabel(const Locale &/*locale*/, size_t /*labelIndex*/) const override
+ {
+ return website;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ WebsiteFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API WebsiteFeature : public Feature
+ {
+ private:
+ TagId tagWebsite;
+ TagId tagContactWebsite;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ /** Name of the "url" label */
+ static const char* const URL_LABEL;
+
+ /** Index of the 'url' label */
+ static const size_t URL_LABEL_INDEX;
+
+ public:
+ WebsiteFeature();
+ 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;
+ };
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/feature/WidthFeature.h
^
|
@@ -0,0 +1,90 @@
+#ifndef OSMSCOUT_FEATURE_WIDTH_FEATURE_H
+#define OSMSCOUT_FEATURE_WIDTH_FEATURE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2014 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/TypeConfig.h>
+#include <osmscout/TypeFeature.h>
+
+#include <osmscout/FeatureReader.h>
+
+namespace osmscout {
+
+ class OSMSCOUT_API WidthFeatureValue : public FeatureValue
+ {
+ private:
+ uint8_t width=0;
+
+ public:
+ WidthFeatureValue() = default;
+
+ explicit WidthFeatureValue(uint8_t width)
+ : width(width)
+ {
+ // no code
+ }
+
+ void SetWidth(uint8_t width)
+ {
+ this->width=width;
+ }
+
+ uint8_t GetWidth() const
+ {
+ return width;
+ }
+
+ void Read(FileScanner& scanner) override;
+ void Write(FileWriter& writer) override;
+
+ WidthFeatureValue& operator=(const FeatureValue& other) override;
+ bool operator==(const FeatureValue& other) const override;
+ };
+
+ class OSMSCOUT_API WidthFeature : public Feature
+ {
+ private:
+ TagId tagWidth;
+
+ public:
+ /** Name of this feature */
+ static const char* const NAME;
+
+ public:
+ 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;
+ };
+
+ using WidthFeatureValueReader = FeatureValueReader<WidthFeature, WidthFeatureValue>;
+}
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/navigation/VoiceInstructionAgent.h
^
|
@@ -118,8 +118,8 @@
{
public:
- enum class MessageType {
- NoMessage,
+ enum class MessageType: int {
+ NoMessage = 0,
LeaveRbExit1,
LeaveRbExit2,
@@ -138,7 +138,9 @@
LeaveMotorway,
LeaveMotorwayRight,
- LeaveMotorwayLeft
+ LeaveMotorwayLeft,
+
+ Silent
};
struct MessageStruct {
@@ -175,6 +177,7 @@
private:
DistanceUnitSystem units{DistanceUnitSystem::Metrics};
+ Vehicle vehicle{vehicleCar};
// state used for triggering GpsFound / GpsLost messages
bool prevGpsSignal{true};
@@ -194,7 +197,8 @@
private:
void toSamples(std::vector<VoiceInstructionMessage::VoiceSample> &samples,
- const MessageType &messageType);
+ const MessageType &messageType,
+ bool shortRoundaboutMessage);
std::vector<VoiceInstructionMessage::VoiceSample> toSamples(const Distance &distanceFromStart,
const MessageStruct &message,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/ost/Parser.h
^
|
@@ -22,7 +22,8 @@
#define osmscout_ost_PARSER_H
#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeatures.h>
+
+#include <osmscout/feature/NameFeature.h>
#include <osmscout/util/File.h>
#include <osmscout/util/String.h>
@@ -167,4 +168,3 @@
#endif // !defined(COCO_PARSER_H__)
-
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RoutePostprocessor.h
^
|
@@ -28,7 +28,14 @@
#include <osmscout/CoreFeatures.h>
#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeatures.h>
+
+#include <osmscout/feature/BridgeFeature.h>
+#include <osmscout/feature/ClockwiseDirectionFeature.h>
+#include <osmscout/feature/DestinationFeature.h>
+#include <osmscout/feature/LanesFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/RefFeature.h>
+#include <osmscout/feature/RoundaboutFeature.h>
#include <osmscout/util/Time.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RoutingProfile.h
^
|
@@ -27,18 +27,21 @@
#include <osmscout/OSMScoutTypes.h>
#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeatures.h>
#include <osmscout/FeatureReader.h>
#include <osmscout/Way.h>
#include <osmscout/Area.h>
+#include <osmscout/feature/AccessFeature.h>
+#include <osmscout/feature/GradeFeature.h>
+#include <osmscout/feature/MaxSpeedFeature.h>
+
+#include <osmscout/routing/RouteNode.h>
+
#include <osmscout/util/Time.h>
#include <osmscout/util/String.h>
#include <osmscout/util/Logger.h>
-#include <osmscout/routing/RouteNode.h>
-
namespace osmscout {
/**
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/Base64.h
^
|
@@ -7,6 +7,7 @@
* licensed under terms of MIT license
*/
+#include <cstdint>
#include <string>
#include <sstream>
#include <iostream>
@@ -18,7 +19,6 @@
static inline std::string Base64Encode(const std::vector<char> &in)
{
-
std::string out;
uint32_t val = 0;
@@ -45,7 +45,6 @@
static inline std::vector<char> Base64Decode(const std::string &in)
{
-
std::vector<char> out;
std::vector<int> T(256, -1);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/LaneTurn.h
^
|
@@ -20,7 +20,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <cstddef>
+#include <cstdint>
#include <string>
#include <osmscout/CoreImportExport.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/String.h
^
|
@@ -25,6 +25,8 @@
#include <memory>
#include <string>
#include <chrono>
+#include <optional>
+#include <utility>
#include <osmscout/CoreFeatures.h>
@@ -323,6 +325,17 @@
const std::string& separator,
int maxSize=-1);
+ /**
+ * Split string by separator to two parts. Unlike SplitString with maxSize=2,
+ * second element contains the rest of the string after first separator.
+ * When no separator found, nullopt is returned.
+ *
+ * \note when str is empty nullopt is returned
+ * \note separator must not be empty
+ * \note when string ends with separator, and there is just one, second element is empty
+ */
+ extern OSMSCOUT_API std::optional<std::pair<std::string,std::string>> SplitStringToPair(const std::string& str,
+ const std::string& separator);
/**
* \ingroup Util
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/parser/OST/OST.atg
^
|
@@ -1,5 +1,6 @@
#include <osmscout/TypeConfig.h>
-#include <osmscout/TypeFeatures.h>
+
+#include <osmscout/feature/NameFeature.h>
#include <osmscout/util/File.h>
#include <osmscout/util/String.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/meson.build
^
|
@@ -1,11 +1,69 @@
osmscoutSrc = [
+ 'src/osmscout/feature/AccessFeature.cpp',
+ 'src/osmscout/feature/AccessRestrictedFeature.cpp',
+ 'src/osmscout/feature/AddressFeature.cpp',
+ 'src/osmscout/feature/AdminLevelFeature.cpp',
+ 'src/osmscout/feature/BridgeFeature.cpp',
+ 'src/osmscout/feature/BuildingFeature.cpp',
+ 'src/osmscout/feature/ClockwiseDirectionFeature.cpp',
+ 'src/osmscout/feature/ColorFeature.cpp',
+ 'src/osmscout/feature/ConstructionYearFeature.cpp',
+ 'src/osmscout/feature/DestinationFeature.cpp',
+ 'src/osmscout/feature/EleFeature.cpp',
+ 'src/osmscout/feature/EmbankmentFeature.cpp',
+ 'src/osmscout/feature/FromToFeature.cpp',
+ 'src/osmscout/feature/GradeFeature.cpp',
+ 'src/osmscout/feature/IsInFeature.cpp',
+ 'src/osmscout/feature/LanesFeature.cpp',
+ 'src/osmscout/feature/LayerFeature.cpp',
+ 'src/osmscout/feature/LocationFeature.cpp',
+ 'src/osmscout/feature/MaxSpeedFeature.cpp',
+ 'src/osmscout/feature/NameFeature.cpp',
+ 'src/osmscout/feature/NameAltFeature.cpp',
+ 'src/osmscout/feature/NameShortFeature.cpp',
+ 'src/osmscout/feature/NetworkFeature.cpp',
+ 'src/osmscout/feature/OpeningHoursFeature.cpp',
+ 'src/osmscout/feature/OperatorFeature.cpp',
+ 'src/osmscout/feature/PhoneFeature.cpp',
+ 'src/osmscout/feature/PostalCodeFeature.cpp',
+ 'src/osmscout/feature/RefFeature.cpp',
+ 'src/osmscout/feature/RoundaboutFeature.cpp',
+ 'src/osmscout/feature/SidewayFeature.cpp',
+ 'src/osmscout/feature/TunnelFeature.cpp',
+ 'src/osmscout/feature/WebsiteFeature.cpp',
+ 'src/osmscout/feature/WidthFeature.cpp',
+ 'src/osmscout/navigation/Agents.cpp',
+ 'src/osmscout/navigation/BearingAgent.cpp',
+ 'src/osmscout/navigation/DataAgent.cpp',
+ 'src/osmscout/navigation/PositionAgent.cpp',
+ 'src/osmscout/navigation/RouteStateAgent.cpp',
+ 'src/osmscout/navigation/RouteInstructionAgent.cpp',
+ 'src/osmscout/navigation/Engine.cpp',
+ 'src/osmscout/navigation/ArrivalEstimateAgent.cpp',
+ 'src/osmscout/navigation/SpeedAgent.cpp',
+ 'src/osmscout/navigation/VoiceInstructionAgent.cpp',
+ 'src/osmscout/navigation/LaneAgent.cpp',
'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/routing/RouteDescription.cpp',
+ 'src/osmscout/routing/RouteDescriptionPostprocessor.cpp',
+ 'src/osmscout/routing/RouteData.cpp',
+ 'src/osmscout/routing/RouteNode.cpp',
+ 'src/osmscout/routing/RouteNodeDataFile.cpp',
+ 'src/osmscout/routing/RoutePostprocessor.cpp',
+ 'src/osmscout/routing/RoutingDB.cpp',
+ 'src/osmscout/routing/RoutingProfile.cpp',
+ 'src/osmscout/routing/RoutingService.cpp',
+ 'src/osmscout/routing/AbstractRoutingService.cpp',
+ 'src/osmscout/routing/SimpleRoutingService.cpp',
+ 'src/osmscout/routing/MultiDBRoutingService.cpp',
+ 'src/osmscout/routing/TurnRestriction.cpp',
+ 'src/osmscout/routing/MultiDBRoutingState.cpp',
'src/osmscout/system/SSEMath.cpp',
'src/osmscout/util/Breaker.cpp',
'src/osmscout/util/Bearing.cpp',
@@ -45,31 +103,6 @@
'src/osmscout/util/TagErrorReporter.cpp',
'src/osmscout/util/utf8helper.cpp',
'src/osmscout/util/utf8helper_charmap.cpp',
- 'src/osmscout/routing/RouteDescription.cpp',
- 'src/osmscout/routing/RouteDescriptionPostprocessor.cpp',
- 'src/osmscout/routing/RouteData.cpp',
- 'src/osmscout/routing/RouteNode.cpp',
- 'src/osmscout/routing/RouteNodeDataFile.cpp',
- 'src/osmscout/routing/RoutePostprocessor.cpp',
- 'src/osmscout/routing/RoutingDB.cpp',
- 'src/osmscout/routing/RoutingProfile.cpp',
- 'src/osmscout/routing/RoutingService.cpp',
- 'src/osmscout/routing/AbstractRoutingService.cpp',
- 'src/osmscout/routing/SimpleRoutingService.cpp',
- 'src/osmscout/routing/MultiDBRoutingService.cpp',
- 'src/osmscout/routing/TurnRestriction.cpp',
- 'src/osmscout/routing/MultiDBRoutingState.cpp',
- 'src/osmscout/navigation/Agents.cpp',
- 'src/osmscout/navigation/BearingAgent.cpp',
- 'src/osmscout/navigation/DataAgent.cpp',
- 'src/osmscout/navigation/PositionAgent.cpp',
- 'src/osmscout/navigation/RouteStateAgent.cpp',
- 'src/osmscout/navigation/RouteInstructionAgent.cpp',
- 'src/osmscout/navigation/Engine.cpp',
- 'src/osmscout/navigation/ArrivalEstimateAgent.cpp',
- 'src/osmscout/navigation/SpeedAgent.cpp',
- 'src/osmscout/navigation/VoiceInstructionAgent.cpp',
- 'src/osmscout/navigation/LaneAgent.cpp',
'src/osmscout/Area.cpp',
'src/osmscout/AreaDataFile.cpp',
'src/osmscout/AreaAreaIndex.cpp',
@@ -110,7 +143,6 @@
'src/osmscout/Tag.cpp',
'src/osmscout/TypeConfig.cpp',
'src/osmscout/TypeFeature.cpp',
- 'src/osmscout/TypeFeatures.cpp',
'src/osmscout/TypeInfoSet.cpp',
'src/osmscout/FeatureReader.cpp',
'src/osmscout/OSMScoutTypes.cpp',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/LocationDescriptionService.cpp
^
|
@@ -21,11 +21,16 @@
#include <algorithm>
+#include <osmscout/FeatureReader.h>
+
+#include <osmscout/feature/AddressFeature.h>
+#include <osmscout/feature/AdminLevelFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/RefFeature.h>
+
#include <osmscout/util/Geometry.h>
#include <osmscout/util/Logger.h>
#include <osmscout/util/String.h>
-#include <osmscout/TypeFeatures.h>
-#include <osmscout/FeatureReader.h>
#include <osmscout/system/Math.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/LocationService.cpp
^
|
@@ -25,7 +25,6 @@
#include <osmscout/util/Logger.h>
#include <osmscout/util/String.h>
-#include <osmscout/TypeFeatures.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/TypeConfig.cpp
^
|
@@ -21,7 +21,39 @@
#include <algorithm>
-#include <osmscout/TypeFeatures.h>
+#include <osmscout/feature/AccessFeature.h>
+#include <osmscout/feature/AccessRestrictedFeature.h>
+#include <osmscout/feature/AddressFeature.h>
+#include <osmscout/feature/AdminLevelFeature.h>
+#include <osmscout/feature/BridgeFeature.h>
+#include <osmscout/feature/BuildingFeature.h>
+#include <osmscout/feature/ClockwiseDirectionFeature.h>
+#include <osmscout/feature/ColorFeature.h>
+#include <osmscout/feature/ConstructionYearFeature.h>
+#include <osmscout/feature/DestinationFeature.h>
+#include <osmscout/feature/EleFeature.h>
+#include <osmscout/feature/EmbankmentFeature.h>
+#include <osmscout/feature/FromToFeature.h>
+#include <osmscout/feature/GradeFeature.h>
+#include <osmscout/feature/IsInFeature.h>
+#include <osmscout/feature/LanesFeature.h>
+#include <osmscout/feature/LayerFeature.h>
+#include <osmscout/feature/LocationFeature.h>
+#include <osmscout/feature/MaxSpeedFeature.h>
+#include <osmscout/feature/NameFeature.h>
+#include <osmscout/feature/NameAltFeature.h>
+#include <osmscout/feature/NameShortFeature.h>
+#include <osmscout/feature/NetworkFeature.h>
+#include <osmscout/feature/OpeningHoursFeature.h>
+#include <osmscout/feature/OperatorFeature.h>
+#include <osmscout/feature/PhoneFeature.h>
+#include <osmscout/feature/PostalCodeFeature.h>
+#include <osmscout/feature/RefFeature.h>
+#include <osmscout/feature/RoundaboutFeature.h>
+#include <osmscout/feature/SidewayFeature.h>
+#include <osmscout/feature/TunnelFeature.h>
+#include <osmscout/feature/WebsiteFeature.h>
+#include <osmscout/feature/WidthFeature.h>
#include <osmscout/system/Assert.h>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/AccessFeature.cpp
^
|
@@ -0,0 +1,308 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/AccessFeature.h>
+
+namespace osmscout {
+
+ void AccessFeatureValue::Read(FileScanner& scanner)
+ {
+ access=scanner.ReadUInt8();
+ }
+
+ void AccessFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(access);
+ }
+
+ AccessFeatureValue& AccessFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const AccessFeatureValue&>(other);
+
+ access=otherValue.access;
+ }
+
+ return *this;
+ }
+
+ bool AccessFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const AccessFeatureValue&>(other);
+
+ return access==otherValue.access;
+ }
+
+ const char* const AccessFeature::NAME = "Access";
+
+ void AccessFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagOneway=tagRegistry.RegisterTag("oneway");
+ tagJunction=tagRegistry.RegisterTag("junction");
+
+ tagAccess=tagRegistry.RegisterTag("access");
+ tagAccessForward=tagRegistry.RegisterTag("access:forward");
+ tagAccessBackward=tagRegistry.RegisterTag("access:backward");
+
+ tagFoot=tagRegistry.RegisterTag("foot");
+ tagFootForward=tagRegistry.RegisterTag("foot:forward");
+ tagFootBackward=tagRegistry.RegisterTag("foot:backward");
+
+ tagBicycle=tagRegistry.RegisterTag("bicycle");
+ tagBicycleForward=tagRegistry.RegisterTag("bicycle:forward");
+ tagBicycleBackward=tagRegistry.RegisterTag("bicycle:backward");
+
+ tagMotorVehicle=tagRegistry.RegisterTag("motor_vehicle");
+ tagMotorVehicleForward=tagRegistry.RegisterTag("motor_vehicle:forward");
+ tagMotorVehicleBackward=tagRegistry.RegisterTag("motor_vehicle:backward");
+
+ tagMotorcar=tagRegistry.RegisterTag("motorcar");
+ tagMotorcarForward=tagRegistry.RegisterTag("motorcar:forward");
+ tagMotorcarBackward=tagRegistry.RegisterTag("motorcar:backward");
+ }
+
+ std::string AccessFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t AccessFeature::GetValueAlignment() const
+ {
+ return alignof(AccessFeatureValue);
+ }
+
+ size_t AccessFeature::GetValueSize() const
+ {
+ return sizeof(AccessFeatureValue);
+ }
+
+ FeatureValue* AccessFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) AccessFeatureValue();
+ }
+
+ void AccessFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ uint8_t access=0u;
+
+ if (feature.GetType()->CanRouteFoot()) {
+ access|=(AccessFeatureValue::footForward|AccessFeatureValue::footBackward);
+ }
+
+ if (feature.GetType()->CanRouteBicycle()) {
+ access|=(AccessFeatureValue::bicycleForward|AccessFeatureValue::bicycleBackward);
+ }
+
+ if (feature.GetType()->CanRouteCar()) {
+ access|=(AccessFeatureValue::carForward|AccessFeatureValue::carBackward);
+ }
+
+ uint8_t defaultAccess=access;
+
+ // Flag access
+
+ auto accessValue=tags.find(tagAccess);
+
+ if (accessValue!=tags.end() &&
+ accessValue->second=="no") {
+ // Everything is forbidden and possible later positive restrictions added again
+ access=0u;
+
+ // In any other case this is a general access restriction for all vehicles that
+ // does not change any of our existing flags, so we ignore it.
+ }
+
+ // Flag access:forward/access:backward
+
+ auto accessForwardValue=tags.find(tagAccessForward);
+ auto accessBackwardValue=tags.find(tagAccessBackward);
+
+ if (accessForwardValue!=tags.end()) {
+ access&=~(AccessFeatureValue::footForward|AccessFeatureValue::bicycleForward|AccessFeatureValue::carForward);
+
+ if (!(accessForwardValue->second=="no")) {
+ access|=(AccessFeatureValue::footForward|AccessFeatureValue::bicycleForward|AccessFeatureValue::carForward);
+ }
+ }
+ else if (accessBackwardValue!=tags.end()) {
+ access&=~(AccessFeatureValue::footBackward|AccessFeatureValue::bicycleBackward|AccessFeatureValue::carBackward);
+
+ if (!(accessBackwardValue->second=="no")) {
+ access|=(AccessFeatureValue::footBackward|AccessFeatureValue::bicycleBackward|AccessFeatureValue::carBackward);
+ }
+ }
+
+ // Flag oneway & junction
+ auto onewayValue=tags.find(tagOneway);
+ auto junctionValue=tags.find(tagJunction);
+
+ if (onewayValue!=tags.end()) {
+ if (onewayValue->second=="-1") {
+ access&=~(AccessFeatureValue::bicycleForward|AccessFeatureValue::carForward|AccessFeatureValue::onewayForward);
+ access|=AccessFeatureValue::onewayBackward;
+ }
+ else if (!(onewayValue->second=="no" || onewayValue->second=="false" || onewayValue->second=="0")) {
+ access&=~(AccessFeatureValue::bicycleBackward|AccessFeatureValue::carBackward|AccessFeatureValue::onewayBackward);
+ access|=AccessFeatureValue::onewayForward;
+ }
+ }
+ else if (junctionValue!=tags.end()
+ && junctionValue->second=="roundabout") {
+ access&=~(AccessFeatureValue::bicycleBackward|AccessFeatureValue::carBackward|AccessFeatureValue::onewayBackward);
+ access|=(AccessFeatureValue::bicycleForward|AccessFeatureValue::carForward|AccessFeatureValue::onewayForward);
+ }
+
+ // Flags foot, bicycle, motor_vehicle, motorcar
+
+ auto accessFootValue=tags.find(tagFoot);
+
+ if (accessFootValue!=tags.end()) {
+ access&=~(AccessFeatureValue::footForward|AccessFeatureValue::footBackward);
+
+ if (!(accessFootValue->second=="no")) {
+ access|=(AccessFeatureValue::footForward|AccessFeatureValue::footBackward);
+ }
+ }
+
+ auto accessBicycleValue=tags.find(tagBicycle);
+
+ if (accessBicycleValue!=tags.end()) {
+ access&=~(AccessFeatureValue::bicycleForward|AccessFeatureValue::bicycleBackward);
+
+ if (!(accessBicycleValue->second=="no")) {
+ if ((access & AccessFeatureValue::onewayBackward)==0) {
+ access|=(AccessFeatureValue::bicycleForward);
+ }
+ if ((access & AccessFeatureValue::onewayForward)==0) {
+ access|=(AccessFeatureValue::bicycleBackward);
+ }
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/AccessRestrictedFeature.cpp
^
|
@@ -0,0 +1,148 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/AccessRestrictedFeature.h>
+
+namespace osmscout {
+
+ void AccessRestrictedFeatureValue::Read(FileScanner& scanner)
+ {
+ access=scanner.ReadUInt8();
+ }
+
+ void AccessRestrictedFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(access);
+ }
+
+ AccessRestrictedFeatureValue& AccessRestrictedFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const AccessRestrictedFeatureValue&>(other);
+
+ access=otherValue.access;
+ }
+
+ return *this;
+ }
+
+ bool AccessRestrictedFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const AccessRestrictedFeatureValue&>(other);
+
+ return access==otherValue.access;
+ }
+
+ const char* const AccessRestrictedFeature::NAME = "AccessRestricted";
+
+ void AccessRestrictedFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagAccess=tagRegistry.RegisterTag("access");
+ tagFoot=tagRegistry.RegisterTag("foot");
+ tagBicycle=tagRegistry.RegisterTag("bicycle");
+ tagMotorVehicle=tagRegistry.RegisterTag("motor_vehicle");
+ }
+
+ std::string AccessRestrictedFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t AccessRestrictedFeature::GetValueAlignment() const
+ {
+ return alignof(AccessRestrictedFeatureValue);
+ }
+
+ size_t AccessRestrictedFeature::GetValueSize() const
+ {
+ return sizeof(AccessRestrictedFeatureValue);
+ }
+
+ FeatureValue* AccessRestrictedFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) AccessRestrictedFeatureValue();
+ }
+
+ void AccessRestrictedFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ uint8_t access=AccessRestrictedFeatureValue::foot|AccessRestrictedFeatureValue::bicycle|AccessRestrictedFeatureValue::car;
+ uint8_t defaultAccess=AccessRestrictedFeatureValue::foot|AccessRestrictedFeatureValue::bicycle|AccessRestrictedFeatureValue::car;
+
+ auto accessValue=tags.find(tagAccess);
+
+ if (accessValue!=tags.end()) {
+
+ if (accessValue->second=="delivery" ||
+ accessValue->second=="destination" ||
+ accessValue->second=="private") {
+ access&=~(AccessRestrictedFeatureValue::foot|AccessRestrictedFeatureValue::bicycle|AccessRestrictedFeatureValue::car);
+ }
+ }
+
+ auto accessFootValue=tags.find(tagFoot);
+
+ if (accessFootValue!=tags.end()) {
+ if (accessFootValue->second=="delivery" ||
+ accessFootValue->second=="destination" ||
+ accessFootValue->second=="private") {
+ access&=~AccessRestrictedFeatureValue::foot;
+ }
+ else {
+ access|=AccessRestrictedFeatureValue::foot;
+ }
+ }
+
+ auto accessBicycleValue=tags.find(tagBicycle);
+
+ if (accessBicycleValue!=tags.end()) {
+ if (accessBicycleValue->second=="delivery" ||
+ accessBicycleValue->second=="destination" ||
+ accessBicycleValue->second=="private") {
+ access&=~AccessRestrictedFeatureValue::bicycle;
+ }
+ else {
+ access|=AccessRestrictedFeatureValue::bicycle;
+ }
+ }
+
+ auto accessCarValue=tags.find(tagMotorVehicle);
+
+ if (accessCarValue!=tags.end()) {
+ if (accessCarValue->second=="delivery" ||
+ accessCarValue->second=="destination" ||
+ accessCarValue->second=="private") {
+ access&=~AccessRestrictedFeatureValue::car;
+ }
+ else {
+ access|=AccessRestrictedFeatureValue::car;
+ }
+ }
+
+ if (access!=defaultAccess) {
+ auto* value=static_cast<AccessRestrictedFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetAccess(access);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/AddressFeature.cpp
^
|
@@ -0,0 +1,121 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/AddressFeature.h>
+
+namespace osmscout {
+
+ void AddressFeatureValue::Read(FileScanner& scanner)
+ {
+ address=scanner.ReadString();
+ }
+
+ void AddressFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(address);
+ }
+
+ AddressFeatureValue& AddressFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const AddressFeatureValue&>(other);
+
+ address=otherValue.address;
+ }
+
+ return *this;
+ }
+
+ bool AddressFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const AddressFeatureValue&>(other);
+
+ return address==otherValue.address;
+ }
+
+ const char* const AddressFeature::NAME = "Address";
+ const char* const AddressFeature::NAME_LABEL = "name";
+ const size_t AddressFeature::NAME_LABEL_INDEX = 0;
+
+
+ AddressFeature::AddressFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,
+ NAME_LABEL);
+ }
+
+ void AddressFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagAddrHouseNr=tagRegistry.RegisterTag("addr:housenumber");
+ tagAddrStreet=tagRegistry.RegisterTag("addr:street");
+ tagAddrPlace=tagRegistry.RegisterTag("addr:place");
+ }
+
+ std::string AddressFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t AddressFeature::GetValueAlignment() const
+ {
+ return alignof(AddressFeatureValue);
+ }
+
+ size_t AddressFeature::GetValueSize() const
+ {
+ return sizeof(AddressFeatureValue);
+ }
+
+ FeatureValue* AddressFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) AddressFeatureValue();
+ }
+
+ void AddressFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto street=tags.find(tagAddrStreet);
+
+ if (street==tags.end()) {
+ // We are cheating here, but from library view, there is no
+ // difference in addr:street or addr:place. It is just a address.
+ street=tags.find(tagAddrPlace);
+ if (street==tags.end()) {
+ return;
+ }
+ }
+
+ auto houseNr=tags.find(tagAddrHouseNr);
+
+ if (houseNr==tags.end()) {
+ return;
+ }
+
+ if (!street->second.empty() &&
+ !houseNr->second.empty()) {
+ auto* value=static_cast<AddressFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetAddress(houseNr->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/AdminLevelFeature.cpp
^
|
@@ -0,0 +1,114 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/AdminLevelFeature.h>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void AdminLevelFeatureValue::Read(FileScanner& scanner)
+ {
+ adminLevel=scanner.ReadUInt8();
+ isIn=scanner.ReadString();
+ }
+
+ void AdminLevelFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(adminLevel);
+ writer.Write(isIn);
+ }
+
+ AdminLevelFeatureValue& AdminLevelFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const AdminLevelFeatureValue&>(other);
+
+ adminLevel=otherValue.adminLevel;
+ isIn=otherValue.isIn;
+ }
+
+ return *this;
+ }
+
+ bool AdminLevelFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const AdminLevelFeatureValue&>(other);
+
+ return adminLevel==otherValue.adminLevel && isIn==otherValue.isIn;
+ }
+
+ const char* const AdminLevelFeature::NAME = "AdminLevel";
+
+ void AdminLevelFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagAdminLevel=tagRegistry.RegisterTag("admin_level");
+ tagIsIn=tagRegistry.RegisterTag("is_in");
+ }
+
+ std::string AdminLevelFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t AdminLevelFeature::GetValueAlignment() const
+ {
+ return alignof(AdminLevelFeatureValue);
+ }
+
+ size_t AdminLevelFeature::GetValueSize() const
+ {
+ return sizeof(AdminLevelFeatureValue);
+ }
+
+ FeatureValue* AdminLevelFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) AdminLevelFeatureValue();
+ }
+
+ void AdminLevelFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto adminLevel=tags.find(tagAdminLevel);
+
+ if (adminLevel!=tags.end()) {
+ uint8_t adminLevelValue;
+
+ if (StringToNumber(adminLevel->second,
+ adminLevelValue)) {
+ auto* value=static_cast<AdminLevelFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetAdminLevel(adminLevelValue);
+
+ auto isIn=tags.find(tagIsIn);
+
+ if (isIn!=tags.end()) {
+ value->SetIsIn(isIn->second);
+ }
+ }
+ else {
+ errorReporter.ReportTag(object,tags,std::string("Admin level is not numeric '")+adminLevel->second+"'!");
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/BridgeFeature.cpp
^
|
@@ -0,0 +1,52 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/BridgeFeature.h>
+
+namespace osmscout {
+
+ const char* const BridgeFeature::NAME = "Bridge";
+
+ void BridgeFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagBridge=tagRegistry.RegisterTag("bridge");
+ }
+
+ std::string BridgeFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ void BridgeFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto bridge=tags.find(tagBridge);
+
+ if (bridge!=tags.end() &&
+ !(bridge->second=="no" ||
+ bridge->second=="false" ||
+ bridge->second=="0")) {
+ buffer.AllocateValue(feature.GetIndex());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/BuildingFeature.cpp
^
|
@@ -0,0 +1,52 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/BuildingFeature.h>
+
+namespace osmscout {
+
+ const char* const BuildingFeature::NAME = "Building";
+
+ void BuildingFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagBuilding=tagRegistry.RegisterTag("building");
+ }
+
+ std::string BuildingFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ void BuildingFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto building=tags.find(tagBuilding);
+
+ if (building!=tags.end() &&
+ !(building->second=="no" ||
+ building->second=="false" ||
+ building->second=="0")) {
+ buffer.AllocateValue(feature.GetIndex());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/ClockwiseDirectionFeature.cpp
^
|
@@ -0,0 +1,50 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/ClockwiseDirectionFeature.h>
+
+namespace osmscout {
+
+ const char* const ClockwiseDirectionFeature::NAME = "ClockwiseDirection";
+
+ void ClockwiseDirectionFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagDirection=tagRegistry.RegisterTag("direction");
+ }
+
+ std::string ClockwiseDirectionFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ void ClockwiseDirectionFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto junction=tags.find(tagDirection);
+
+ if (junction!=tags.end() &&
+ junction->second=="clockwise") {
+ buffer.AllocateValue(feature.GetIndex());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/ColorFeature.cpp
^
|
@@ -0,0 +1,122 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/ColorFeature.h>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void ColorFeatureValue::Read(FileScanner& scanner)
+ {
+ color=scanner.ReadColor();
+ }
+
+ void ColorFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(color);
+ }
+
+ ColorFeatureValue& ColorFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const ColorFeatureValue&>(other);
+
+ color=otherValue.color;
+ }
+
+ return *this;
+ }
+
+ bool ColorFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const ColorFeatureValue&>(other);
+
+ return color==otherValue.color;
+ }
+
+ const char* const ColorFeature::NAME = "Color";
+ const char* const ColorFeature::NUMBER_LABEL = "color";
+ const size_t ColorFeature::NUMBER_LABEL_INDEX = 0;
+
+ ColorFeature::ColorFeature()
+ {
+ RegisterLabel(NUMBER_LABEL_INDEX,NUMBER_LABEL);
+ }
+
+ void ColorFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagColor=tagRegistry.RegisterTag("colour");
+ tagSymbol=tagRegistry.RegisterTag("osmc:symbol");
+ }
+
+ std::string ColorFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t ColorFeature::GetValueAlignment() const
+ {
+ return alignof(ColorFeatureValue);
+ }
+
+ size_t ColorFeature::GetValueSize() const
+ {
+ return sizeof(ColorFeatureValue);
+ }
+
+ FeatureValue* ColorFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) ColorFeatureValue();
+ }
+
+ void ColorFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ using namespace std::string_literals;
+
+ std::string colorString;
+ if (auto color=tags.find(tagColor);
+ color!=tags.end() && !color->second.empty()) {
+
+ colorString=color->second;
+ } else if (auto symbol=tags.find(tagSymbol);
+ symbol!=tags.end() && !symbol->second.empty()) {
+
+ colorString=GetFirstInStringList(symbol->second, ":"s);
+ }
+
+ if (!colorString.empty()){
+ colorString=UTF8StringToLower(colorString);
+ Color color;
+ if (!Color::FromHexString(colorString, color) &&
+ !Color::FromW3CKeywordString(colorString, color)) {
+ errorReporter.ReportTag(object,tags,"Not a valid color value ("s + colorString + ")"s);
+ return;
+ }
+
+ auto* value = static_cast<ColorFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+ value->SetColor(color);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/ConstructionYearFeature.cpp
^
|
@@ -0,0 +1,209 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/ConstructionYearFeature.h>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void ConstructionYearFeatureValue::Read(FileScanner& scanner)
+ {
+ startYear=scanner.ReadInt32();
+ endYear=scanner.ReadInt32();
+ }
+
+ void ConstructionYearFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(startYear);
+ writer.Write(endYear);
+ }
+
+ ConstructionYearFeatureValue& ConstructionYearFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const ConstructionYearFeatureValue&>(other);
+
+ startYear=otherValue.startYear;
+ endYear=otherValue.endYear;
+ }
+
+ return *this;
+ }
+
+ bool ConstructionYearFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const ConstructionYearFeatureValue&>(other);
+
+ return startYear==otherValue.startYear &&
+ endYear==otherValue.endYear;
+ }
+
+ const char* const ConstructionYearFeature::NAME = "ConstructionYear";
+ const char* const ConstructionYearFeature::YEAR_LABEL = "year";
+ const size_t ConstructionYearFeature::YEAR_LABEL_INDEX = 0;
+
+ ConstructionYearFeature::ConstructionYearFeature()
+ {
+ RegisterLabel(YEAR_LABEL_INDEX,YEAR_LABEL);
+ }
+
+ void ConstructionYearFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagConstructionYear=tagRegistry.RegisterTag("year_of_construction");
+ tagStartDate=tagRegistry.RegisterTag("start_date");
+ }
+
+ std::string ConstructionYearFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t ConstructionYearFeature::GetValueAlignment() const
+ {
+ return alignof(ConstructionYearFeatureValue);
+ }
+
+ size_t ConstructionYearFeature::GetValueSize() const
+ {
+ return sizeof(ConstructionYearFeatureValue);
+ }
+
+ FeatureValue* ConstructionYearFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) ConstructionYearFeatureValue();
+ }
+
+ void ConstructionYearFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto constructionYearTag=tags.find(tagConstructionYear);
+
+ std::string strValue;
+
+ if (constructionYearTag!=tags.end()) {
+ strValue=constructionYearTag->second;
+ }
+ else {
+ auto startDateTag=tags.find(tagStartDate);
+
+ if (startDateTag!=tags.end()) {
+ strValue=startDateTag->second;
+ }
+ else {
+ return;
+ }
+ }
+
+ int startYear;
+ int endYear;
+
+ if (strValue[0]=='~') {
+ strValue=strValue.substr(1);
+ }
+
+
+ if (osmscout::StringToNumber(strValue,startYear)) {
+ auto* value=dynamic_cast<ConstructionYearFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetStartYear(startYear);
+ value->SetEndYear(startYear);
+
+ return;
+ }
+ auto pos=strValue.find('-');
+
+ if (pos!=std::string::npos) {
+ std::string startValue=strValue.substr(0,pos);
+ std::string endValue=strValue.substr(pos+1);
+
+ if (!startValue.empty() &&
+ !endValue.empty() &&
+ osmscout::StringToNumber(startValue,startYear) &&
+ osmscout::StringToNumber(endValue,endYear)) {
+
+ auto* value=static_cast<ConstructionYearFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetStartYear(startYear);
+ value->SetEndYear(endYear);
+ }
+
+ return;
+ }
+
+ pos=strValue.find('/');
+
+ if (pos!=std::string::npos) {
+ std::string startValue=strValue.substr(0,pos);
+ std::string endValue=strValue.substr(pos+1);
+
+ if (!startValue.empty() &&
+ !endValue.empty() &&
+ osmscout::StringToNumber(startValue,startYear) &&
+ osmscout::StringToNumber(endValue,endYear)) {
+
+ auto* value=static_cast<ConstructionYearFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetStartYear(startYear);
+ value->SetEndYear(endYear);
+ }
+
+ return;
+ }
+
+ pos=strValue.find("..");
+
+ if (pos!=std::string::npos) {
+ std::string startValue=strValue.substr(0,pos);
+ std::string endValue=strValue.substr(pos+2);
+
+ if (!startValue.empty() &&
+ !endValue.empty() &&
+ osmscout::StringToNumber(startValue,startYear) &&
+ osmscout::StringToNumber(endValue,endYear)) {
+
+ auto* value=static_cast<ConstructionYearFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetStartYear(startYear);
+ value->SetEndYear(endYear);
+ }
+
+ return;
+ }
+
+ if (strValue[0]=='C') {
+ std::string startValue=strValue.substr(1);
+
+ if (osmscout::StringToNumber(startValue,startYear)) {
+ auto* value=static_cast<ConstructionYearFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/DestinationFeature.cpp
^
|
@@ -0,0 +1,116 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/DestinationFeature.h>
+
+namespace osmscout {
+
+ void DestinationFeatureValue::Read(FileScanner& scanner)
+ {
+ destination=scanner.ReadString();
+ }
+
+ void DestinationFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(destination);
+ }
+
+ DestinationFeatureValue& DestinationFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const DestinationFeatureValue&>(other);
+
+ destination=otherValue.destination;
+ }
+
+ return *this;
+ }
+
+ bool DestinationFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const DestinationFeatureValue&>(other);
+
+ return destination==otherValue.destination;
+ }
+
+ const char* const DestinationFeature::NAME = "Destination";
+ const char* const DestinationFeature::NAME_LABEL = "label";
+ const size_t DestinationFeature::NAME_LABEL_INDEX = 0;
+
+ DestinationFeature::DestinationFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,
+ NAME_LABEL);
+ }
+
+ void DestinationFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagDestination=tagRegistry.RegisterTag("destination");
+ tagDestinationRef=tagRegistry.RegisterTag("destination:ref");
+ tagDestinationForward=tagRegistry.RegisterTag("destination:forward");
+ }
+
+ std::string DestinationFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t DestinationFeature::GetValueAlignment() const
+ {
+ return alignof(DestinationFeatureValue);
+ }
+
+ size_t DestinationFeature::GetValueSize() const
+ {
+ return sizeof(DestinationFeatureValue);
+ }
+
+ FeatureValue* DestinationFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) DestinationFeatureValue();
+ }
+
+ void DestinationFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto destination=tags.find(tagDestination);
+
+ if (destination==tags.end()) {
+ destination=tags.find(tagDestinationForward);
+ }
+
+ if (destination==tags.end()) {
+ destination=tags.find(tagDestinationRef);
+ }
+
+ if (destination==tags.end()) {
+ return;
+ }
+
+ if (!destination->second.empty()) {
+ auto* value=static_cast<DestinationFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetDestination(destination->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/EleFeature.cpp
^
|
@@ -0,0 +1,190 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/EleFeature.h>
+
+#include <sstream>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void EleFeatureValue::Read(FileScanner& scanner)
+ {
+ if (scanner.GetFileFormatVersion() < 25) {
+ ele = scanner.ReadUInt32Number();
+ } else {
+ ele = scanner.ReadInt16Number();
+ }
+ }
+
+ void EleFeatureValue::Write(FileWriter& writer)
+ {
+ writer.WriteNumber(ele);
+ }
+
+ EleFeatureValue& EleFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const EleFeatureValue&>(other);
+
+ ele=otherValue.ele;
+ }
+
+ return *this;
+ }
+
+ std::string EleFeatureValue::GetLabel(const Locale &locale, size_t labelIndex) const
+ {
+ DistanceUnitSystem units;
+ if (labelIndex==EleFeature::IN_LOCALE_UNIT_LABEL_INDEX){
+ units=locale.GetDistanceUnits();
+ } else if (labelIndex==EleFeature::IN_METER_LABEL_INDEX){
+ units=DistanceUnitSystem::Metrics;
+ } else {
+ assert(labelIndex==EleFeature::IN_FEET_LABEL_INDEX);
+ units=DistanceUnitSystem::Imperial;
+ }
+
+ int value;
+ std::string unitsStr;
+ if (units == DistanceUnitSystem::Imperial){
+ value=std::round(Meters(ele).As<Feet>());
+ unitsStr="ft";
+ }else{
+ value=ele;
+ unitsStr="m";
+ }
+
+ std::stringstream ss;
+ ss << NumberToString(value, locale);
+ ss << locale.GetUnitsSeparator();
+ ss << unitsStr;
+ return ss.str();
+ }
+
+ bool EleFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const EleFeatureValue&>(other);
+
+ return ele==otherValue.ele;
+ }
+
+ const char* const EleFeature::NAME = "Ele";
+
+ const char* const EleFeature::IN_METER_LABEL = "inMeter";
+ const size_t EleFeature::IN_METER_LABEL_INDEX = 0;
+
+ const char* const EleFeature::IN_FEET_LABEL = "inFeet";
+ const size_t EleFeature::IN_FEET_LABEL_INDEX = 1;
+
+ const char* const EleFeature::IN_LOCALE_UNIT_LABEL = "inLocaleUnit";
+ const size_t EleFeature::IN_LOCALE_UNIT_LABEL_INDEX = 2;
+
+ EleFeature::EleFeature()
+ {
+ RegisterLabel(IN_METER_LABEL_INDEX,
+ IN_METER_LABEL);
+ RegisterLabel(IN_FEET_LABEL_INDEX,
+ IN_FEET_LABEL);
+ RegisterLabel(IN_LOCALE_UNIT_LABEL_INDEX,
+ IN_LOCALE_UNIT_LABEL);
+ }
+
+ void EleFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagEle=tagRegistry.RegisterTag("ele");
+ }
+
+ std::string EleFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t EleFeature::GetValueAlignment() const
+ {
+ return alignof(EleFeatureValue);
+ }
+
+ size_t EleFeature::GetValueSize() const
+ {
+ return sizeof(EleFeatureValue);
+ }
+
+ FeatureValue* EleFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) EleFeatureValue();
+ }
+
+ void EleFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto ele=tags.find(tagEle);
+
+ if (ele==tags.end()) {
+ return;
+ }
+
+ std::string eleString=ele->second;
+ double e;
+ size_t pos=0;
+ size_t count=0;
+
+ // We expect that float values use '.' as separator, but many values use ',' instead.
+ // Try to fix this if string looks reasonable
+ for (size_t i=0; i<eleString.length() && count<=1; i++) {
+ if (eleString[i]==',') {
+ pos=i;
+ count++;
+ }
+ }
+
+ if (count==1) {
+ eleString[pos]='.';
+ }
+
+ // Some ele tag values add an 'm' to hint that the unit is meter, remove it.
+ if (eleString.length()>=2) {
+ if (eleString[eleString.length()-1]=='m' &&
+ ((eleString[eleString.length()-2]>='0' &&
+ eleString[eleString.length()-2]<='9') ||
+ eleString[eleString.length()-2]<=' ')) {
+ 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<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(int16_t(floor(e+0.5)));
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/EmbankmentFeature.cpp
^
|
@@ -0,0 +1,52 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/EmbankmentFeature.h>
+
+namespace osmscout {
+
+ const char* const EmbankmentFeature::NAME = "Embankment";
+
+ void EmbankmentFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagEmbankment=tagRegistry.RegisterTag("embankment");
+ }
+
+ std::string EmbankmentFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ void EmbankmentFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto embankment=tags.find(tagEmbankment);
+
+ if (embankment!=tags.end() &&
+ !(embankment->second=="no" ||
+ embankment->second=="false" ||
+ embankment->second=="0")) {
+ buffer.AllocateValue(feature.GetIndex());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/FromToFeature.cpp
^
|
@@ -0,0 +1,114 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/FromToFeature.h>
+
+namespace osmscout {
+
+ void FromToFeatureValue::Read(FileScanner& scanner)
+ {
+ from=scanner.ReadString();
+ to=scanner.ReadString();
+ }
+
+ void FromToFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(from);
+ writer.Write(to);
+ }
+
+ FromToFeatureValue& FromToFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const FromToFeatureValue&>(other);
+
+ from=otherValue.from;
+ to=otherValue.to;
+ }
+
+ return *this;
+ }
+
+ bool FromToFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const FromToFeatureValue&>(other);
+
+ return from==otherValue.from &&
+ to==otherValue.to;
+ }
+
+ const char* const FromToFeature::NAME = "FromTo";
+ const char* const FromToFeature::NUMBER_LABEL = "number";
+ const size_t FromToFeature::NUMBER_LABEL_INDEX = 0;
+
+ FromToFeature::FromToFeature()
+ {
+ RegisterLabel(NUMBER_LABEL_INDEX,NUMBER_LABEL);
+ }
+
+ void FromToFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagFrom=tagRegistry.RegisterTag("from");
+ tagTo=tagRegistry.RegisterTag("to");
+ }
+
+ std::string FromToFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t FromToFeature::GetValueAlignment() const
+ {
+ return alignof(FromToFeatureValue);
+ }
+
+ size_t FromToFeature::GetValueSize() const
+ {
+ return sizeof(FromToFeatureValue);
+ }
+
+ FeatureValue* FromToFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) FromToFeatureValue();
+ }
+
+ void FromToFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto from=tags.find(tagFrom);
+ auto to=tags.find(tagTo);
+
+ if ((from!=tags.end() && !from->second.empty()) ||
+ (to!=tags.end() && !to->second.empty())) {
+ auto* value = static_cast<FromToFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ if (from!=tags.end()) {
+ value->SetFrom(from->second);
+ }
+
+ if (to!=tags.end()) {
+ value->SetTo(to->second);
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/GradeFeature.cpp
^
|
@@ -0,0 +1,149 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/GradeFeature.h>
+
+namespace osmscout {
+
+ void GradeFeatureValue::Read(FileScanner& scanner)
+ {
+ grade=scanner.ReadUInt8();
+ }
+
+ void GradeFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(grade);
+ }
+
+ GradeFeatureValue& GradeFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const GradeFeatureValue&>(other);
+
+ grade=otherValue.grade;
+ }
+
+ return *this;
+ }
+
+ bool GradeFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const GradeFeatureValue&>(other);
+
+ return grade==otherValue.grade;
+ }
+
+ const char* const GradeFeature::NAME = "Grade";
+
+ void GradeFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagSurface=tagRegistry.RegisterTag("surface");
+ tagTrackType=tagRegistry.RegisterTag("tracktype");
+ }
+
+ std::string GradeFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t GradeFeature::GetValueAlignment() const
+ {
+ return alignof(GradeFeatureValue);
+ }
+
+ size_t GradeFeature::GetValueSize() const
+ {
+ return sizeof(GradeFeatureValue);
+ }
+
+ FeatureValue* GradeFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) GradeFeatureValue();
+ }
+
+ void GradeFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto tracktype=tags.find(tagTrackType);
+
+ if (tracktype!=tags.end()) {
+ if (tracktype->second=="grade1") {
+ auto* value=static_cast<GradeFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetGrade(1);
+
+ return;
+ }
+
+ if (tracktype->second=="grade2") {
+ auto* value=static_cast<GradeFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetGrade(2);
+
+ return;
+ }
+
+ if (tracktype->second=="grade3") {
+ auto* value=static_cast<GradeFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetGrade(3);
+
+ return;
+ }
+
+ if (tracktype->second=="grade4") {
+ auto* value=static_cast<GradeFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetGrade(4);
+
+ return;
+ }
+
+ if (tracktype->second=="grade5") {
+ auto* value=static_cast<GradeFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetGrade(5);
+
+ return;
+ }
+
+ errorReporter.ReportTag(object,tags,std::string("Unsupported tracktype value '")+tracktype->second+"'");
+ }
+
+ auto surface=tags.find(tagSurface);
+
+ if (surface!=tags.end()) {
+ size_t grade;
+
+ if (tagRegistry.GetGradeForSurface(surface->second,
+ grade)) {
+ auto* value=static_cast<GradeFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetGrade((uint8_t)grade);
+ }
+ else {
+ errorReporter.ReportTag(object,tags,std::string("Unknown surface type '")+surface->second+"' !");
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/IsInFeature.cpp
^
|
@@ -0,0 +1,93 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/IsInFeature.h>
+
+namespace osmscout {
+
+ void IsInFeatureValue::Read(FileScanner& scanner)
+ {
+ isIn=scanner.ReadString();
+ }
+
+ void IsInFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(isIn);
+ }
+
+ IsInFeatureValue& IsInFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const IsInFeatureValue&>(other);
+
+ isIn=otherValue.isIn;
+ }
+
+ return *this;
+ }
+
+ bool IsInFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const IsInFeatureValue&>(other);
+
+ return isIn==otherValue.isIn;
+ }
+
+ const char* const IsInFeature::NAME = "IsIn";
+
+ void IsInFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagIsIn=tagRegistry.RegisterTag("is_in");
+ }
+
+ std::string IsInFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t IsInFeature::GetValueAlignment() const
+ {
+ return alignof(IsInFeatureValue);
+ }
+
+ size_t IsInFeature::GetValueSize() const
+ {
+ return sizeof(IsInFeatureValue);
+ }
+
+ FeatureValue* IsInFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) IsInFeatureValue();
+ }
+
+ void IsInFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto isIn=tags.find(tagIsIn);
+
+ if (isIn!=tags.end() && !isIn->second.empty()) {
+ auto* value=static_cast<IsInFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+ value->SetIsIn(isIn->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/LanesFeature.cpp
^
|
@@ -0,0 +1,407 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/LanesFeature.h>
+
+#include <osmscout/util/String.h>
+
+
+namespace osmscout {
+
+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) {
+ 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();
+ }
+ }
+
+ void LanesFeatureValue::Write(FileWriter& writer)
+ {
+ if (turnForward.empty() &&
+ turnBackward.empty() &&
+ destinationForward.empty() &&
+ destinationBackward.empty()) {
+ lanes=lanes & uint8_t(~0x01u);
+ }
+ else {
+ lanes=lanes | 0x01u;
+ }
+
+ 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(TurnsToStr(turnForward));
+ writer.Write(TurnsToStr(turnBackward));
+ writer.Write(destinationForward);
+ writer.Write(destinationBackward);
+ }
+ }
+
+ LanesFeatureValue& LanesFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const LanesFeatureValue&>(other);
+
+ lanes=otherValue.lanes;
+ turnForward=otherValue.turnForward;
+ turnBackward=otherValue.turnBackward;
+ destinationForward=otherValue.destinationForward;
+ destinationBackward=otherValue.destinationBackward;
+ }
+
+ return *this;
+ }
+
+ bool LanesFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const LanesFeatureValue&>(other);
+
+ return lanes==otherValue.lanes &&
+ turnForward==otherValue.turnForward &&
+ turnBackward==otherValue.turnBackward &&
+ destinationForward==otherValue.destinationForward &&
+ destinationBackward==otherValue.destinationBackward;
+ }
+
+ uint8_t LanesFeatureValue::GetLanes() const
+ {
+ return GetForwardLanes() + GetBackwardLanes();
+ }
+
+ const char* const LanesFeature::NAME = "Lanes";
+ const char* const LanesFeature::NAME_LABEL = "label";
+ const size_t LanesFeature::NAME_LABEL_INDEX = 0;
+
+ LanesFeature::LanesFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,
+ NAME_LABEL);
+ }
+
+ void LanesFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagOneway=tagRegistry.RegisterTag("oneway");
+ tagLanes=tagRegistry.RegisterTag("lanes");
+ tagLanesForward=tagRegistry.RegisterTag("lanes:forward");
+ tagLanesBackward=tagRegistry.RegisterTag("lanes:backward");
+ tagTurnLanes=tagRegistry.RegisterTag("turn:lanes");
+ tagTurnLanesForward=tagRegistry.RegisterTag("turn:lanes:forward");
+ tagTurnLanesBackward=tagRegistry.RegisterTag("turn:lanes:backward");
+ tagDestinationLanes=tagRegistry.RegisterTag("destination:lanes");
+ tagDestinationLanesForward=tagRegistry.RegisterTag("destination:lanes:forward");
+ tagDestinationLanesBackward=tagRegistry.RegisterTag("destination:lanes:backward");
+ }
+
+ std::string LanesFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t LanesFeature::GetValueAlignment() const
+ {
+ return alignof(LanesFeatureValue);
+ }
+
+ size_t LanesFeature::GetValueSize() const
+ {
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/LayerFeature.cpp
^
|
@@ -0,0 +1,105 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/LayerFeature.h>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void LayerFeatureValue::Read(FileScanner& scanner)
+ {
+ layer=scanner.ReadInt8();
+ }
+
+ void LayerFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(layer);
+ }
+
+ LayerFeatureValue& LayerFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const LayerFeatureValue&>(other);
+
+ layer=otherValue.layer;
+ }
+
+ return *this;
+ }
+
+ bool LayerFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const LayerFeatureValue&>(other);
+
+ return layer==otherValue.layer;
+ }
+
+ const char* const LayerFeature::NAME = "Layer";
+
+ void LayerFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagLayer=tagRegistry.RegisterTag("layer");
+ }
+
+ std::string LayerFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t LayerFeature::GetValueAlignment() const
+ {
+ return alignof(LayerFeatureValue);
+ }
+
+ size_t LayerFeature::GetValueSize() const
+ {
+ return sizeof(LayerFeatureValue);
+ }
+
+ FeatureValue* LayerFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) LayerFeatureValue();
+ }
+
+ void LayerFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto layer=tags.find(tagLayer);
+
+ if (layer!=tags.end()) {
+ int8_t layerValue;
+
+ if (StringToNumber(layer->second,layerValue)) {
+ if (layerValue!=0) {
+ auto* value=static_cast<LayerFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetLayer(layerValue);
+ }
+ }
+ else {
+ errorReporter.ReportTag(object,tags,std::string("Layer tag value '")+layer->second+"' is not numeric!");
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/LocationFeature.cpp
^
|
@@ -0,0 +1,112 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/LocationFeature.h>
+
+namespace osmscout {
+
+ void LocationFeatureValue::Read(FileScanner& scanner)
+ {
+ location=scanner.ReadString();
+ }
+
+ void LocationFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(location);
+ }
+
+ LocationFeatureValue& LocationFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const LocationFeatureValue&>(other);
+
+ location=otherValue.location;
+ }
+
+ return *this;
+ }
+
+ bool LocationFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const LocationFeatureValue&>(other);
+
+ return location==otherValue.location;
+ }
+
+ const char* const LocationFeature::NAME = "Location";
+
+ void LocationFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagAddrHouseNr=tagRegistry.RegisterTag("addr:housenumber");
+ tagAddrStreet=tagRegistry.RegisterTag("addr:street");
+ tagAddrPlace=tagRegistry.RegisterTag("addr:place");
+ }
+
+ std::string LocationFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t LocationFeature::GetValueAlignment() const
+ {
+ return alignof(LocationFeatureValue);
+ }
+
+ size_t LocationFeature::GetValueSize() const
+ {
+ return sizeof(LocationFeatureValue);
+ }
+
+ FeatureValue* LocationFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) LocationFeatureValue();
+ }
+
+ void LocationFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto street=tags.find(tagAddrStreet);
+
+ if (street==tags.end()) {
+ // We are cheating here, but from library view, there is no
+ // difference in addr:street or addr:place. It is just a address.
+ street=tags.find(tagAddrPlace);
+ if (street==tags.end()) {
+ return;
+ }
+ }
+
+ auto houseNr=tags.find(tagAddrHouseNr);
+
+ if (houseNr==tags.end()) {
+ return;
+ }
+
+ if (!street->second.empty() &&
+ !houseNr->second.empty()) {
+ auto* value=static_cast<LocationFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetLocation(street->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/MaxSpeedFeature.cpp
^
|
@@ -0,0 +1,251 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/MaxSpeedFeature.h>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void MaxSpeedFeatureValue::Read(FileScanner& scanner)
+ {
+ maxSpeed=scanner.ReadUInt8();
+ }
+
+ void MaxSpeedFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(maxSpeed);
+ }
+
+ MaxSpeedFeatureValue& MaxSpeedFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const MaxSpeedFeatureValue&>(other);
+
+ maxSpeed=otherValue.maxSpeed;
+ }
+
+ return *this;
+ }
+
+ bool MaxSpeedFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const MaxSpeedFeatureValue&>(other);
+
+ return maxSpeed==otherValue.maxSpeed;
+ }
+
+ const char* const MaxSpeedFeature::NAME = "MaxSpeed";
+
+ void MaxSpeedFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagMaxSpeed=tagRegistry.RegisterTag("maxspeed");
+ tagMaxSpeedForward=tagRegistry.RegisterTag("maxspeed:forward");
+ tagMaxSpeedBackward=tagRegistry.RegisterTag("maxspeed:backward");
+ }
+
+ std::string MaxSpeedFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t MaxSpeedFeature::GetValueAlignment() const
+ {
+ return alignof(MaxSpeedFeatureValue);
+ }
+
+ size_t MaxSpeedFeature::GetValueSize() const
+ {
+ return sizeof(MaxSpeedFeatureValue);
+ }
+
+ FeatureValue* MaxSpeedFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) MaxSpeedFeatureValue();
+ }
+
+ bool MaxSpeedFeature::GetTagValue(TagErrorReporter& errorReporter,
+ const TagRegistry& tagRegistry,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ const std::string& input, uint8_t& speed) const
+ {
+ std::string valueString(input);
+ size_t valueNumeric;
+ bool isMph=false;
+
+ if (valueString=="signals" ||
+ valueString=="none" ||
+ valueString=="no") {
+ return false;
+ }
+
+ // "walk" should not be used, but we provide an estimation anyway,
+ // since it is likely still better than the default
+ if (valueString=="walk") {
+ speed=10;
+ return true;
+ }
+
+ size_t pos;
+
+ pos=valueString.rfind("mph");
+
+ if (pos!=std::string::npos) {
+ valueString.erase(pos);
+ isMph=true;
+ }
+ else {
+ pos=valueString.rfind("km/h");
+
+ if (pos!=std::string::npos) {
+ valueString.erase(pos);
+ isMph=false;
+ }
+ }
+
+ while (valueString.length()>0 &&
+ valueString[valueString.length()-1]==' ') {
+ valueString.erase(valueString.length()-1);
+ }
+
+ if (!StringToNumber(valueString,
+ valueNumeric)) {
+ uint8_t maxSpeedValue;
+
+ if (tagRegistry.GetMaxSpeedFromAlias(valueString,
+ maxSpeedValue)) {
+ valueNumeric=maxSpeedValue;
+ }
+ else {
+ errorReporter.ReportTag(object,tags,std::string("Max speed tag value '")+input+"' is not numeric!");
+ return false;
+ }
+ }
+
+ if (isMph) {
+ if (valueNumeric>std::numeric_limits<uint8_t>::max()/static_cast<unsigned long>(lround(1.609))) {
+
+ speed=std::numeric_limits<uint8_t>::max();
+ }
+ else {
+ speed=(uint8_t)lround(valueNumeric*1.609);
+ }
+ }
+ else {
+ if (valueNumeric>std::numeric_limits<uint8_t>::max()) {
+ speed=std::numeric_limits<uint8_t>::max();
+ }
+ else {
+ speed=(uint8_t)valueNumeric;
+ }
+ }
+
+ return true;
+ }
+
+
+ void MaxSpeedFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto maxSpeed=tags.find(tagMaxSpeed);
+ auto maxSpeedForward=tags.find(tagMaxSpeedForward);
+ auto maxSpeedBackward=tags.find(tagMaxSpeedBackward);
+
+ if (maxSpeedForward!=tags.end() &&
+ maxSpeedBackward!=tags.end()) {
+ uint8_t forwardSpeed=0;
+ uint8_t backwardSpeed=0;
+
+ if (!GetTagValue(errorReporter,
+ tagRegistry,
+ object,
+ tags,
+ maxSpeedForward->second,
+ forwardSpeed)) {
+ return;
+ }
+
+ if (!GetTagValue(errorReporter,
+ tagRegistry,
+ object,
+ tags,
+ maxSpeedBackward->second,
+ backwardSpeed)) {
+ return;
+ }
+
+ auto* featureValue=static_cast<MaxSpeedFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/NameAltFeature.cpp
^
|
@@ -0,0 +1,114 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/NameAltFeature.h>
+
+namespace osmscout {
+
+ void NameAltFeatureValue::Read(FileScanner& scanner)
+ {
+ nameAlt=scanner.ReadString();
+ }
+
+ void NameAltFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(nameAlt);
+ }
+
+ NameAltFeatureValue& NameAltFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const NameAltFeatureValue&>(other);
+
+ nameAlt=otherValue.nameAlt;
+ }
+
+ return *this;
+ }
+
+ bool NameAltFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const NameAltFeatureValue&>(other);
+
+ return nameAlt==otherValue.nameAlt;
+ }
+
+ const char* const NameAltFeature::NAME = "NameAlt";
+ const char* const NameAltFeature::NAME_LABEL = "name";
+ const size_t NameAltFeature::NAME_LABEL_INDEX = 0;
+
+ void NameAltFeature::Initialize(TagRegistry& /*tagRegistry*/)
+ {
+ // no code
+ }
+
+ NameAltFeature::NameAltFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,
+ NAME_LABEL);
+ }
+
+ std::string NameAltFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t NameAltFeature::GetValueAlignment() const
+ {
+ return alignof(NameAltFeatureValue);
+ }
+
+ size_t NameAltFeature::GetValueSize() const
+ {
+ return sizeof(NameAltFeatureValue);
+ }
+
+ FeatureValue* NameAltFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) NameAltFeatureValue();
+ }
+
+ void NameAltFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ std::string nameAlt;
+ uint32_t nameAltPriority=std::numeric_limits<uint32_t>::max();
+
+ for (const auto &tag : tags) {
+ uint32_t natPrio;
+ bool isNameAltTag=tagRegistry.IsNameAltTag(tag.first,natPrio);
+
+ if (isNameAltTag &&
+ (nameAlt.empty() || natPrio<nameAltPriority)) {
+ nameAlt=tag.second;
+ nameAltPriority=natPrio;
+ }
+ }
+
+ if (!nameAlt.empty()) {
+ auto* value=static_cast<NameAltFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetNameAlt(nameAlt);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/NameFeature.cpp
^
|
@@ -0,0 +1,116 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/NameFeature.h>
+
+namespace osmscout {
+
+ void NameFeatureValue::Read(FileScanner& scanner)
+ {
+ name=scanner.ReadString();
+ }
+
+ void NameFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(name);
+ }
+
+
+ NameFeatureValue& NameFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const NameFeatureValue&>(other);
+
+ name=otherValue.name;
+ }
+
+ return *this;
+ }
+
+ bool NameFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const NameFeatureValue&>(other);
+
+ return name==otherValue.name;
+ }
+
+ const char* const NameFeature::NAME = "Name";
+ const char* const NameFeature::NAME_LABEL = "name";
+ const size_t NameFeature::NAME_LABEL_INDEX = 0;
+
+
+ NameFeature::NameFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,
+ NAME_LABEL);
+ }
+
+ void NameFeature::Initialize(TagRegistry& /*tagRegistry*/)
+ {
+ // no code
+ }
+
+ std::string NameFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t NameFeature::GetValueAlignment() const
+ {
+ return alignof(NameFeatureValue);
+ }
+
+ size_t NameFeature::GetValueSize() const
+ {
+ return sizeof(NameFeatureValue);
+ }
+
+ FeatureValue* NameFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) NameFeatureValue();
+ }
+
+ void NameFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& tagRegistry,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ std::string name;
+ uint32_t namePriority=std::numeric_limits<uint32_t>::max();
+
+ for (const auto &tag : tags) {
+ uint32_t ntPrio;
+ bool isNameTag=tagRegistry.IsNameTag(tag.first,ntPrio);
+
+ if (isNameTag &&
+ (name.empty() || ntPrio<namePriority)) {
+ name=tag.second;
+ namePriority=ntPrio;
+ }
+ }
+
+ if (!name.empty()) {
+ auto* value=static_cast<NameFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetName(name);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/NameShortFeature.cpp
^
|
@@ -0,0 +1,103 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/NameShortFeature.h>
+
+namespace osmscout {
+
+ void NameShortFeatureValue::Read(FileScanner& scanner)
+ {
+ nameShort=scanner.ReadString();
+ }
+
+ void NameShortFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(nameShort);
+ }
+
+ NameShortFeatureValue& NameShortFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const NameShortFeatureValue&>(other);
+
+ nameShort=otherValue.nameShort;
+ }
+
+ return *this;
+ }
+
+ bool NameShortFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const NameShortFeatureValue&>(other);
+
+ return nameShort==otherValue.nameShort;
+ }
+
+ const char* const NameShortFeature::NAME = "ShortName";
+ const char* const NameShortFeature::NAME_LABEL = "name";
+ const size_t NameShortFeature::NAME_LABEL_INDEX = 0;
+
+ NameShortFeature::NameShortFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,
+ NAME_LABEL);
+ }
+
+ void NameShortFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagShortName=tagRegistry.RegisterTag("short_name");
+ }
+
+ std::string NameShortFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t NameShortFeature::GetValueAlignment() const
+ {
+ return alignof(NameShortFeatureValue);
+ }
+
+ size_t NameShortFeature::GetValueSize() const
+ {
+ return sizeof(NameShortFeatureValue);
+ }
+
+ FeatureValue* NameShortFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) NameShortFeatureValue();
+ }
+
+ void NameShortFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto shortName=tags.find(tagShortName);
+
+ if (shortName!=tags.end() &&
+ !shortName->second.empty()) {
+ auto* value=static_cast<NameShortFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetNameShort(shortName->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/NetworkFeature.cpp
^
|
@@ -0,0 +1,101 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/NetworkFeature.h>
+
+namespace osmscout {
+
+ void NetworkFeatureValue::Read(FileScanner& scanner)
+ {
+ network=scanner.ReadString();
+ }
+
+ void NetworkFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(network);
+ }
+
+ NetworkFeatureValue& NetworkFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const NetworkFeatureValue&>(other);
+
+ network=otherValue.network;
+ }
+
+ return *this;
+ }
+
+ bool NetworkFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const NetworkFeatureValue&>(other);
+
+ return network==otherValue.network;
+ }
+
+ const char* const NetworkFeature::NAME = "Network";
+ const char* const NetworkFeature::NAME_LABEL = "name";
+ const size_t NetworkFeature::NAME_LABEL_INDEX = 0;
+
+ NetworkFeature::NetworkFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,NAME_LABEL);
+ }
+
+ void NetworkFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagNetwork=tagRegistry.RegisterTag("network");
+ }
+
+ std::string NetworkFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t NetworkFeature::GetValueAlignment() const
+ {
+ return alignof(NetworkFeatureValue);
+ }
+
+ size_t NetworkFeature::GetValueSize() const
+ {
+ return sizeof(NetworkFeatureValue);
+ }
+
+ FeatureValue* NetworkFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) NetworkFeatureValue();
+ }
+
+ void NetworkFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto network= tags.find(tagNetwork);
+
+ if (network!=tags.end() && !network->second.empty()) {
+ auto* value = static_cast<NetworkFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetNetwork(network->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/OpeningHoursFeature.cpp
^
|
@@ -0,0 +1,106 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/OpeningHoursFeature.h>
+
+namespace osmscout {
+
+ 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;
+ }
+
+ bool OpeningHoursFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const OpeningHoursFeatureValue&>(other);
+
+ return value==otherValue.value;
+ }
+
+ const char* const OpeningHoursFeature::NAME = "OpeningHours";
+ const char* const OpeningHoursFeature::LABEL = "opening hours";
+ const size_t OpeningHoursFeature::LABEL_INDEX = 0;
+
+ OpeningHoursFeature::OpeningHoursFeature()
+ {
+ RegisterLabel(LABEL_INDEX,LABEL);
+ }
+
+ void OpeningHoursFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagOpeningHours=tagRegistry.RegisterTag("opening_hours");
+ }
+
+ std::string OpeningHoursFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t OpeningHoursFeature::GetValueAlignment() const
+ {
+ return alignof(OpeningHoursFeatureValue);
+ }
+
+ size_t OpeningHoursFeature::GetValueSize() const
+ {
+ return sizeof(OpeningHoursFeatureValue);
+ }
+
+ FeatureValue* OpeningHoursFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) OpeningHoursFeatureValue();
+ }
+
+ void OpeningHoursFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ using namespace std::string_literals;
+
+ std::string colorString;
+ if (auto v=tags.find(tagOpeningHours);
+ v!=tags.end() && !v->second.empty()) {
+
+ size_t idx = feature.GetIndex();
+ FeatureValue* fv = buffer.AllocateValue(idx);
+ auto* value = static_cast<OpeningHoursFeatureValue*>(fv);
+
+ value->SetValue(v->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/OperatorFeature.cpp
^
|
@@ -0,0 +1,101 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/OperatorFeature.h>
+
+namespace osmscout {
+
+ void OperatorFeatureValue::Read(FileScanner& scanner)
+ {
+ op=scanner.ReadString();
+ }
+
+ void OperatorFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(op);
+ }
+
+ OperatorFeatureValue& OperatorFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const OperatorFeatureValue&>(other);
+
+ op=otherValue.op;
+ }
+
+ return *this;
+ }
+
+ bool OperatorFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const OperatorFeatureValue&>(other);
+
+ return op==otherValue.op;
+ }
+
+ const char* const OperatorFeature::NAME = "Operator";
+ const char* const OperatorFeature::NAME_LABEL = "name";
+ const size_t OperatorFeature::NAME_LABEL_INDEX = 0;
+
+ OperatorFeature::OperatorFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,NAME_LABEL);
+ }
+
+ void OperatorFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagOperator=tagRegistry.RegisterTag("operator");
+ }
+
+ std::string OperatorFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t OperatorFeature::GetValueAlignment() const
+ {
+ return alignof(OperatorFeatureValue);
+ }
+
+ size_t OperatorFeature::GetValueSize() const
+ {
+ return sizeof(OperatorFeatureValue);
+ }
+
+ FeatureValue* OperatorFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) OperatorFeatureValue();
+ }
+
+ void OperatorFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto op = tags.find(tagOperator);
+
+ if (op != tags.end() && !op->second.empty()) {
+ auto* value = static_cast<OperatorFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetOperator(op->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/PhoneFeature.cpp
^
|
@@ -0,0 +1,145 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/PhoneFeature.h>
+
+#include <set>
+
+namespace osmscout {
+
+ void PhoneFeatureValue::Read(FileScanner& scanner)
+ {
+ phone=scanner.ReadString();
+ }
+
+ void PhoneFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(phone);
+ }
+
+ PhoneFeatureValue& PhoneFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const PhoneFeatureValue&>(other);
+
+ phone=otherValue.phone;
+ }
+
+ return *this;
+ }
+
+ bool PhoneFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const PhoneFeatureValue&>(other);
+
+ return phone==otherValue.phone;
+ }
+
+ const char* const PhoneFeature::NAME = "Phone";
+ const char* const PhoneFeature::NUMBER_LABEL = "number";
+ const size_t PhoneFeature::NUMBER_LABEL_INDEX = 0;
+
+ PhoneFeature::PhoneFeature()
+ {
+ RegisterLabel(NUMBER_LABEL_INDEX,NUMBER_LABEL);
+ }
+
+ void PhoneFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagPhone=tagRegistry.RegisterTag("phone");
+ tagContactPhone=tagRegistry.RegisterTag("contact:phone");
+ tagContactMobile=tagRegistry.RegisterTag("contact:mobile");
+ }
+
+ std::string PhoneFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t PhoneFeature::GetValueAlignment() const
+ {
+ return alignof(PhoneFeatureValue);
+ }
+
+ size_t PhoneFeature::GetValueSize() const
+ {
+ return sizeof(PhoneFeatureValue);
+ }
+
+ FeatureValue* PhoneFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) PhoneFeatureValue();
+ }
+
+ void PhoneFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ // ignore ways for now
+ if (object.GetType() == OSMRefType::osmRefWay) {
+ return;
+ }
+
+ std::string strValue;
+
+ // object may hold multiple phone tags - phone, contact:phone, contact:mobile
+ // we will append all unique values to one string separated by semicolon
+ // note: when some tag contains multiple phones separated by semicolon, deduplication is not working
+ std::set<std::string,std::less<>> knownPhones;
+ std::vector<TagId> phoneTags{tagPhone, tagContactPhone, tagContactMobile};
+ for (auto tagId:phoneTags) {
+ auto phone = tags.find(tagId);
+ if (phone == tags.end()) {
+ continue;
+ }
+
+ std::string phoneStr=phone->second;
+ // remove invalid characters from phone number [0123456789+;,] http://wiki.openstreetmap.org/wiki/Key:phone
+ // - there can be multiple phone numbers separated by semicolon (some mappers use comma)
+ phoneStr.erase(
+ std::remove_if(phoneStr.begin(), phoneStr.end(), [](char x){return (x<'0'||x>'9') && x!='+' && x!=';' && x!=',';}),
+ phoneStr.end());
+
+ if (phoneStr.empty() || knownPhones.find(phoneStr) != knownPhones.end()) {
+ continue;
+ }
+ if (!strValue.empty()) {
+ strValue += ";";
+ }
+ strValue += phoneStr;
+ knownPhones.insert(phoneStr);
+ }
+
+ try {
+ if (!strValue.empty()) {
+ size_t idx = feature.GetIndex();
+ FeatureValue* fv = buffer.AllocateValue(idx);
+ auto* value = static_cast<PhoneFeatureValue*>(fv);
+
+ value->SetPhone(strValue);
+ }
+ }
+ catch (const std::exception &e) {
+ errorReporter.ReportTag(object,tags,std::string("Phone parse exception: ")+e.what());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/PostalCodeFeature.cpp
^
|
@@ -0,0 +1,122 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/PostalCodeFeature.h>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void PostalCodeFeatureValue::Read(FileScanner& scanner)
+ {
+ postalCode=scanner.ReadString();
+ }
+
+ void PostalCodeFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(postalCode);
+ }
+
+ PostalCodeFeatureValue& PostalCodeFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const PostalCodeFeatureValue&>(other);
+
+ postalCode=otherValue.postalCode;
+ }
+
+ return *this;
+ }
+
+ bool PostalCodeFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const PostalCodeFeatureValue&>(other);
+
+ return postalCode==otherValue.postalCode;
+ }
+
+ const char* const PostalCodeFeature::NAME = "PostalCode";
+ const char* const PostalCodeFeature::NAME_LABEL = "name";
+ const size_t PostalCodeFeature::NAME_LABEL_INDEX = 0;
+
+ PostalCodeFeature::PostalCodeFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,NAME_LABEL);
+ }
+
+ void PostalCodeFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagPostalCode=tagRegistry.RegisterTag("postal_code");
+ tagAddrPostCode=tagRegistry.RegisterTag("addr:postcode");
+ }
+
+ std::string PostalCodeFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t PostalCodeFeature::GetValueAlignment() const
+ {
+ return alignof(PostalCodeFeatureValue);
+ }
+
+ size_t PostalCodeFeature::GetValueSize() const
+ {
+ return sizeof(PostalCodeFeatureValue);
+ }
+
+ FeatureValue* PostalCodeFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) PostalCodeFeatureValue();
+ }
+
+ void PostalCodeFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto postalCode=tags.find(tagPostalCode);
+ auto addrPostCode=tags.find(tagAddrPostCode);
+
+ std::string postalCodeValue;
+
+ if (postalCode!=tags.end()) {
+ postalCodeValue = postalCode->second;
+ }
+
+ if (addrPostCode!=tags.end()) {
+ postalCodeValue = addrPostCode->second;
+ }
+
+ try {
+ if (!postalCodeValue.empty()) {
+ size_t idx = feature.GetIndex();
+ FeatureValue* fv = buffer.AllocateValue(idx);
+ auto* value=static_cast<PostalCodeFeatureValue*>(fv);
+
+ value->SetPostalCode(postalCodeValue);
+ }
+ }
+ catch (const std::exception &e) {
+ errorReporter.ReportTag(object,tags,std::string("Postal code parse exception: ")+e.what());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/RefFeature.cpp
^
|
@@ -0,0 +1,103 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/RefFeature.h>
+
+namespace osmscout {
+
+ void RefFeatureValue::Read(FileScanner& scanner)
+ {
+ ref=scanner.ReadString();
+ }
+
+ void RefFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(ref);
+ }
+
+ RefFeatureValue& RefFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const RefFeatureValue&>(other);
+
+ ref=otherValue.ref;
+ }
+
+ return *this;
+ }
+
+ bool RefFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const RefFeatureValue&>(other);
+
+ return ref==otherValue.ref;
+ }
+
+ const char* const RefFeature::NAME = "Ref";
+ const char* const RefFeature::NAME_LABEL = "name";
+ const size_t RefFeature::NAME_LABEL_INDEX = 0;
+
+ RefFeature::RefFeature()
+ {
+ RegisterLabel(NAME_LABEL_INDEX,
+ NAME_LABEL);
+ }
+
+ void RefFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagRef=tagRegistry.RegisterTag("ref");
+ }
+
+ std::string RefFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t RefFeature::GetValueAlignment() const
+ {
+ return alignof(RefFeatureValue);
+ }
+
+ size_t RefFeature::GetValueSize() const
+ {
+ return sizeof(RefFeatureValue);
+ }
+
+ FeatureValue* RefFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) RefFeatureValue();
+ }
+
+ void RefFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto ref=tags.find(tagRef);
+
+ if (ref!=tags.end() &&
+ !ref->second.empty()) {
+ auto* value=static_cast<RefFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetRef(ref->second);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/RoundaboutFeature.cpp
^
|
@@ -0,0 +1,50 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/RoundaboutFeature.h>
+
+namespace osmscout {
+
+ const char* const RoundaboutFeature::NAME = "Roundabout";
+
+ void RoundaboutFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagJunction=tagRegistry.RegisterTag("junction");
+ }
+
+ std::string RoundaboutFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ void RoundaboutFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto junction=tags.find(tagJunction);
+
+ if (junction!=tags.end() &&
+ junction->second=="roundabout") {
+ buffer.AllocateValue(feature.GetIndex());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/SidewayFeature.cpp
^
|
@@ -0,0 +1,168 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/SidewayFeature.h>
+
+namespace osmscout {
+
+ void SidewayFeatureValue::Read(FileScanner& scanner)
+ {
+ featureSet=scanner.ReadUInt8();
+ }
+
+ void SidewayFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(featureSet);
+ }
+
+ SidewayFeatureValue& SidewayFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const SidewayFeatureValue&>(other);
+
+ featureSet=otherValue.featureSet;
+ }
+
+ return *this;
+ }
+
+ bool SidewayFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const SidewayFeatureValue&>(other);
+
+ return featureSet==otherValue.featureSet;
+ }
+
+ const char* const SidewayFeature::NAME = "Sideway";
+
+ SidewayFeature::SidewayFeature()
+ {
+ RegisterFlag((size_t)FeatureFlags::sidewalkTrackLeft,"sidewalkTrackLeft");
+ RegisterFlag((size_t)FeatureFlags::sidewalkTrackRight,"sidewalkTrackRight");
+
+ RegisterFlag((size_t)FeatureFlags::cyclewayLaneLeft,"cyclewayLaneLeft");
+ RegisterFlag((size_t)FeatureFlags::cyclewayLaneRight,"cyclewayLaneRight");
+ RegisterFlag((size_t)FeatureFlags::cyclewayTrackLeft,"cyclewayTrackLeft");
+ RegisterFlag((size_t)FeatureFlags::cyclewayTrackRight,"cyclewayTrackRight");
+ }
+
+ void SidewayFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagSidewalk=tagRegistry.RegisterTag("sidewalk");
+ tagCyclewayLeft=tagRegistry.RegisterTag("cycleway:left");
+ tagCyclewayLeftSegregated=tagRegistry.RegisterTag("cycleway:left:segregated");
+ tagCyclewayRight=tagRegistry.RegisterTag("cycleway:right");
+ tagCyclewayRightSegregated=tagRegistry.RegisterTag("cycleway:right:segregated");
+ }
+
+ std::string SidewayFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t SidewayFeature::GetValueAlignment() const
+ {
+ return alignof(SidewayFeatureValue);
+ }
+
+ size_t SidewayFeature::GetValueSize() const
+ {
+ return sizeof(SidewayFeatureValue);
+ }
+
+ FeatureValue* SidewayFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) SidewayFeatureValue();
+ }
+
+ void SidewayFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ uint8_t featureSet=0;
+ auto sidewalkTag=tags.find(tagSidewalk);
+ auto cyclewayLeftTag=tags.find(tagCyclewayLeft);
+ auto cyclewayRightTag=tags.find(tagCyclewayRight);
+ auto cyclewayLeftSegregatedTag=tags.find(tagCyclewayLeftSegregated);
+ auto cyclewayRightSegregatedTag=tags.find(tagCyclewayRightSegregated);
+
+ bool hasSidewalkTrackLeft=sidewalkTag!=tags.end() &&
+ (sidewalkTag->second=="left" ||
+ sidewalkTag->second=="both");
+
+ bool hasSidewalkTrackRight=sidewalkTag!=tags.end() &&
+ (sidewalkTag->second=="right" ||
+ sidewalkTag->second=="both");
+
+ bool hasCyclewayLaneLeft=cyclewayLeftTag!=tags.end() &&
+ (cyclewayLeftTag->second=="lane" ||
+ cyclewayLeftTag->second=="shared_lane");
+
+ bool hasCyclewayLaneRight=cyclewayRightTag!=tags.end() &&
+ (cyclewayRightTag->second=="lane" ||
+ cyclewayRightTag->second=="shared_lane");
+
+ bool hasCyclewayTrackLeft=cyclewayLeftTag!=tags.end() &&
+ cyclewayLeftTag->second=="track";
+
+ bool hasCyclewayTrackRight=cyclewayRightTag!=tags.end() &&
+ cyclewayRightTag->second=="track";
+
+ bool hasCyclewayLeftSegregated=cyclewayLeftSegregatedTag!=tags.end();
+ bool hasCyclewayRightSegregated=cyclewayRightSegregatedTag!=tags.end();
+
+ if (hasSidewalkTrackLeft) {
+ featureSet|=SidewayFeatureValue::sidewalkTrackLeft;
+ }
+ if (hasSidewalkTrackRight) {
+ featureSet|=SidewayFeatureValue::sidewalkTrackRight;
+ }
+
+ if (hasCyclewayLaneLeft) {
+ featureSet|=SidewayFeatureValue::cyclewayLaneLeft;
+ }
+ if (hasCyclewayLaneRight) {
+ featureSet|=SidewayFeatureValue::cyclewayLaneRight;
+ }
+
+ if (hasCyclewayTrackLeft) {
+ featureSet|=SidewayFeatureValue::cyclewayTrackLeft;
+
+ if (hasCyclewayLeftSegregated) {
+ featureSet|=SidewayFeatureValue::sidewalkTrackLeft;
+ }
+ }
+ if (hasCyclewayTrackRight) {
+ featureSet|=SidewayFeatureValue::cyclewayTrackRight;
+
+ if (hasCyclewayRightSegregated) {
+ featureSet|=SidewayFeatureValue::sidewalkTrackRight;
+ }
+ }
+
+ if (featureSet!=0) {
+ auto* value=static_cast<SidewayFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetFeatureSet(featureSet);
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/TunnelFeature.cpp
^
|
@@ -0,0 +1,53 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/TunnelFeature.h>
+
+namespace osmscout {
+
+ const char* const TunnelFeature::NAME = "Tunnel";
+
+ void TunnelFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagTunnel=tagRegistry.RegisterTag("tunnel");
+ }
+
+ std::string TunnelFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ void TunnelFeature::Parse(TagErrorReporter& /*errorReporter*/,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& /*object*/,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto tunnel=tags.find(tagTunnel);
+
+ if (tunnel!=tags.end() &&
+ !(tunnel->second=="no" ||
+ tunnel->second=="false" ||
+ tunnel->second=="0")) {
+ buffer.AllocateValue(feature.GetIndex());
+ }
+ }
+
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/WebsiteFeature.cpp
^
|
@@ -0,0 +1,123 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/WebsiteFeature.h>
+
+namespace osmscout {
+
+ void WebsiteFeatureValue::Read(FileScanner& scanner)
+ {
+ website=scanner.ReadString();
+ }
+
+ void WebsiteFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(website);
+ }
+
+ WebsiteFeatureValue& WebsiteFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const WebsiteFeatureValue&>(other);
+
+ website=otherValue.website;
+ }
+
+ return *this;
+ }
+
+ bool WebsiteFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const WebsiteFeatureValue&>(other);
+
+ return website==otherValue.website;
+ }
+
+ const char* const WebsiteFeature::NAME = "Website";
+ const char* const WebsiteFeature::URL_LABEL = "url";
+ const size_t WebsiteFeature::URL_LABEL_INDEX = 0;
+
+ WebsiteFeature::WebsiteFeature()
+ {
+ RegisterLabel(URL_LABEL_INDEX,URL_LABEL);
+ }
+
+ void WebsiteFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagWebsite=tagRegistry.RegisterTag("website");
+ tagContactWebsite=tagRegistry.RegisterTag("contact:website");
+ }
+
+ std::string WebsiteFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t WebsiteFeature::GetValueAlignment() const
+ {
+ return alignof(WebsiteFeatureValue);
+ }
+
+ size_t WebsiteFeature::GetValueSize() const
+ {
+ return sizeof(WebsiteFeatureValue);
+ }
+
+ FeatureValue* WebsiteFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) WebsiteFeatureValue();
+ }
+
+ void WebsiteFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ // ignore ways for now
+ if (object.GetType() == OSMRefType::osmRefWay) {
+ return;
+ }
+
+ std::string strValue;
+
+ std::vector<TagId> websiteTags{tagWebsite, tagContactWebsite};
+ for (auto tagId : websiteTags) {
+ auto website = tags.find(tagId);
+ if (website != tags.end()) {
+ strValue = website->second;
+ break; // use the first one
+ }
+ }
+
+ try {
+ if (!strValue.empty()) {
+ size_t idx = feature.GetIndex();
+ FeatureValue* fv = buffer.AllocateValue(idx);
+ auto* value=static_cast<WebsiteFeatureValue*>(fv);
+
+ value->SetWebsite(strValue);
+ }
+ }
+ catch (const std::exception &e) {
+ errorReporter.ReportTag(object,tags,std::string("Website parse exception: ")+e.what());
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/feature/WidthFeature.cpp
^
|
@@ -0,0 +1,140 @@
+/*
+This source is part of the libosmscout library
+Copyright (C) 2014 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/feature/WidthFeature.h>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+ void WidthFeatureValue::Read(FileScanner& scanner)
+ {
+ width=scanner.ReadUInt8();
+ }
+
+ void WidthFeatureValue::Write(FileWriter& writer)
+ {
+ writer.Write(width);
+ }
+
+ WidthFeatureValue& WidthFeatureValue::operator=(const FeatureValue& other)
+ {
+ if (this!=&other) {
+ const auto& otherValue=static_cast<const WidthFeatureValue&>(other);
+
+ width=otherValue.width;
+ }
+
+ return *this;
+ }
+
+ bool WidthFeatureValue::operator==(const FeatureValue& other) const
+ {
+ const auto& otherValue=static_cast<const WidthFeatureValue&>(other);
+
+ return width==otherValue.width;
+ }
+
+ const char* const WidthFeature::NAME = "Width";
+
+ void WidthFeature::Initialize(TagRegistry& tagRegistry)
+ {
+ tagWidth=tagRegistry.RegisterTag("width");
+ }
+
+ std::string WidthFeature::GetName() const
+ {
+ return NAME;
+ }
+
+ size_t WidthFeature::GetValueAlignment() const
+ {
+ return alignof(WidthFeatureValue);
+ }
+
+ size_t WidthFeature::GetValueSize() const
+ {
+ return sizeof(WidthFeatureValue);
+ }
+
+ FeatureValue* WidthFeature::AllocateValue(void* buffer)
+ {
+ return new (buffer) WidthFeatureValue();
+ }
+
+ void WidthFeature::Parse(TagErrorReporter& errorReporter,
+ const TagRegistry& /*tagRegistry*/,
+ const FeatureInstance& feature,
+ const ObjectOSMRef& object,
+ const TagMap& tags,
+ FeatureValueBuffer& buffer) const
+ {
+ auto width=tags.find(tagWidth);
+
+ if (width==tags.end()) {
+ return;
+ }
+
+ std::string widthString=width->second;
+ double w;
+ size_t pos=0;
+ 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
+ for (size_t i=0; i<widthString.length() && count<=1; i++) {
+ if (widthString[i]==',') {
+ pos=i;
+ count++;
+ }
+ }
+
+ if (count==1) {
+ widthString[pos]='.';
+ }
+
+ // Some width tagvalues add an 'm' to hint that the unit is meter, remove it.
+ if (widthString.length()>=2) {
+ if (widthString[widthString.length()-1]=='m' &&
+ ((widthString[widthString.length()-2]>='0' &&
+ widthString[widthString.length()-2]<='9') ||
+ widthString[widthString.length()-2]<=' ')) {
+ widthString.erase(widthString.length()-1);
+ }
+
+ // Trim possible trailing spaces
+ while (widthString.length()>0 &&
+ widthString[widthString.length()-1]==' ') {
+ widthString.erase(widthString.length()-1);
+ }
+ }
+
+ if (!StringToNumber(widthString,w)) {
+ errorReporter.ReportTag(object,tags,std::string("Width tag value '")+width->second+"' is no double!");
+ }
+ else if (w<0 || w>255.5) {
+ errorReporter.ReportTag(object,tags,std::string("Width tag value '")+width->second+"' value is too small or too big!");
+ }
+ else {
+ auto* value=static_cast<WidthFeatureValue*>(buffer.AllocateValue(feature.GetIndex()));
+
+ value->SetWidth((uint8_t)floor(w+0.5));
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/navigation/PositionAgent.cpp
^
|
@@ -18,6 +18,9 @@
*/
#include <osmscout/navigation/PositionAgent.h>
+
+#include <osmscout/feature/TunnelFeature.h>
+
#include <osmscout/navigation/DataAgent.h>
#include <chrono>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/navigation/SpeedAgent.cpp
^
|
@@ -18,8 +18,10 @@
*/
#include <osmscout/navigation/SpeedAgent.h>
+
+#include <osmscout/feature/MaxSpeedFeature.h>
+
#include <osmscout/navigation/PositionAgent.h>
-#include <osmscout/FeatureReader.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/navigation/VoiceInstructionAgent.cpp
^
|
@@ -32,6 +32,7 @@
Distance distanceFromStart;
Distance stopAfter;
Distance distance;
+ std::optional<Distance> roundaboutEnter; //<! distance of roundabout enter before nextMessage
public:
VoiceInstructionAgent::MessageStruct nextMessage;
@@ -90,12 +91,28 @@
OnMotorwayLeave(directionDescription);
}
+ void OnRoundaboutEnter([[maybe_unused]] const RouteDescription::RoundaboutEnterDescriptionRef &roundaboutEnterDescription,
+ [[maybe_unused]] const RouteDescription::CrossingWaysDescriptionRef &crossingWaysDescription) override
+ {
+ if (!roundaboutEnter) {
+ roundaboutEnter = distance;
+ }
+ }
+
void OnRoundaboutLeave(const osmscout::RouteDescription::RoundaboutLeaveDescriptionRef& roundaboutLeaveDescription,
[[maybe_unused]] const osmscout::RouteDescription::NameDescriptionRef& nameDescription) override
{
assert(roundaboutLeaveDescription);
-
using MessageType = VoiceInstructionAgent::MessageType;
+
+ if (!roundaboutEnter) {
+ if (!nextMessage) {
+ // we are on the roundabout right now, be silent until we leave it
+ nextMessage = VoiceInstructionAgent::MessageStruct{MessageType::Silent, distance};
+ }
+ return;
+ }
+
MessageType type = MessageType::NoMessage;
switch (roundaboutLeaveDescription->GetExitCount()){
case 1:
@@ -120,11 +137,13 @@
// it is not correct, but what else we may say?
type = MessageType::LeaveRbExit6;
}
+ // say the message before entering the roundabout
if (!nextMessage){
- nextMessage = VoiceInstructionAgent::MessageStruct{type, distance};
+ nextMessage = VoiceInstructionAgent::MessageStruct{type, *roundaboutEnter};
} else if (!thenMessage){
- thenMessage = VoiceInstructionAgent::MessageStruct{type, distance};
+ thenMessage = VoiceInstructionAgent::MessageStruct{type, *roundaboutEnter};
}
+ roundaboutEnter = std::nullopt;
}
void OnTargetReached(const osmscout::RouteDescription::TargetDescriptionRef& /*targetDescription*/) override
@@ -188,33 +207,32 @@
}
};
-void VoiceInstructionAgent::toSamples(std::vector<VoiceInstructionMessage::VoiceSample> &samples, const MessageType &type)
+void VoiceInstructionAgent::toSamples(std::vector<VoiceInstructionMessage::VoiceSample> &samples, const MessageType &type, bool shortRoundaboutMessage)
{
using VoiceSample = VoiceInstructionMessage::VoiceSample;
+
+ if (!shortRoundaboutMessage && type>=MessageType::LeaveRbExit1 && type<=MessageType::LeaveRbExit6) {
+ samples.push_back(VoiceSample::RbCross);
+ }
+
switch (type) {
case MessageType::LeaveRbExit1:
- samples.push_back(VoiceSample::RbCross);
samples.push_back(VoiceSample::RbExit1);
break;
case MessageType::LeaveRbExit2:
- samples.push_back(VoiceSample::RbCross);
samples.push_back(VoiceSample::RbExit2);
break;
case MessageType::LeaveRbExit3:
- samples.push_back(VoiceSample::RbCross);
samples.push_back(VoiceSample::RbExit3);
break;
case MessageType::LeaveRbExit4:
- samples.push_back(VoiceSample::RbCross);
samples.push_back(VoiceSample::RbExit4);
break;
case MessageType::LeaveRbExit5:
- samples.push_back(VoiceSample::RbCross);
samples.push_back(VoiceSample::RbExit5);
break;
case MessageType::LeaveRbExit6:
- samples.push_back(VoiceSample::RbCross);
samples.push_back(VoiceSample::RbExit6);
break;
@@ -262,6 +280,11 @@
std::vector<VoiceInstructionMessage::VoiceSample> samples;
assert(message);
+
+ if (message.type == MessageType::Silent) {
+ return samples;
+ }
+
// distance from our position to next message
Distance nextMessageDistance = (message.distance - distanceFromStart);
double distanceInUnits = (units == DistanceUnitSystem::Metrics) ? nextMessageDistance.AsMeter() : nextMessageDistance.As<Yard>();
@@ -270,7 +293,13 @@
return samples;
}
- if (distanceInUnits > 50){
+ // We are close to roundabout, we will use short roundabout message in such case.
+ bool shortRoundaboutMessage = message.type >= MessageType::LeaveRbExit1 && message.type <= MessageType::LeaveRbExit6 &&
+ distanceInUnits < 120;
+
+ if (bool skipDistanceInformation = (distanceInUnits < 80 && vehicle == vehicleCar);
+ !skipDistanceInformation){
+
samples.push_back(VoiceSample::After);
if (distanceInUnits > 800){
samples.push_back(VoiceSample::Distance800);
@@ -296,12 +325,12 @@
samples.push_back(units == DistanceUnitSystem::Metrics ? VoiceSample::Meters : VoiceSample::Yards);
}
- toSamples(samples, message.type);
+ toSamples(samples, message.type, shortRoundaboutMessage);
if (then){
auto thenDistance = then.distance - message.distance;
- if (thenDistance <= Meters(200)) { // ignore then messsage otherwise
+ if (thenDistance <= Meters(200)) { // ignore then message otherwise
samples.push_back(VoiceSample::Then);
- toSamples(samples, then.type);
+ toSamples(samples, then.type, true);
}
}
return samples;
@@ -316,6 +345,7 @@
// reset state
lastMessage.type=MessageType::NoMessage;
lastMessagePosition=Distance::Zero();
+ vehicle=routeUpdateMessage->vehicle;
return result;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/projection/MercatorProjection.cpp
^
|
@@ -124,14 +124,6 @@
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);
@@ -139,6 +131,20 @@
// evaluate bounding box, crop bounding box to valid Mercator area
boundingBox=GeoBox(topLeft,bottomRight);
+
+ if (angle!=0.0) {
+ // be aware that top-left, bottom-right bounding box may not include top-right and bottom-left coordinates when projection is rotated
+ GeoCoord topRight;
+
+ PixelToGeo((double)width,0.0,topRight);
+
+ GeoCoord bottomLeft;
+
+ PixelToGeo(0.0,(double)height,bottomLeft);
+
+ boundingBox.Include(GeoBox(topRight, bottomLeft));
+ }
+
boundingBox.CropTo(GeoBox(GeoCoord(MinLat,MinLon),
GeoCoord(MaxLat,MaxLon)));
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/SimpleRoutingService.cpp
^
|
@@ -23,14 +23,15 @@
#include <osmscout/system/Assert.h>
-#include <osmscout/util/Geometry.h>
-#include <osmscout/util/Logger.h>
-#include <osmscout/util/StopClock.h>
+#include <osmscout/feature/NameFeature.h>
#include <osmscout/routing/RoutingService.h>
#include <osmscout/routing/SimpleRoutingService.h>
#include <osmscout/routing/RoutingProfile.h>
+#include <osmscout/util/Geometry.h>
+#include <osmscout/util/Logger.h>
+#include <osmscout/util/StopClock.h>
//#define DEBUG_ROUTING
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/OpeningHours.cpp
^
|
@@ -80,7 +80,7 @@
if (dayStr.find('-') != std::string::npos) {
// dayDescription is day interval (Mo-Su)
- auto daysIntervalParts = SplitString(dayStr, "-", 2);
+ auto daysIntervalParts = SplitString(dayStr, "-");
if (daysIntervalParts.size() != 2) {
log.Warn() << "Cannot parse day description: " << dayDescription;
return std::nullopt;
@@ -109,7 +109,7 @@
// example: 08:00
std::optional<OpeningHours::DayTime> ParseTime(const std::string &timeStr)
{
- auto timesStr=SplitString(timeStr, ":", 2);
+ auto timesStr=SplitString(timeStr, ":");
if (timesStr.size()!=2) {
log.Warn() << "Cannot parse time: " << timeStr;
return std::nullopt;
@@ -133,7 +133,7 @@
// example: 08:00-12:00
std::optional<OpeningHours::TimeInterval> ParseTimeRange(const std::string &rangeStr)
{
- auto timesStr=SplitString(rangeStr, "-", 2);
+ auto timesStr=SplitString(rangeStr, "-");
if (timesStr.size()!=2) {
log.Warn() << "Cannot parse time interval: " << rangeStr;
return std::nullopt;
@@ -149,7 +149,11 @@
return OpeningHours::TimeInterval{*from, *to};
}
-// example: 08:00-12:00,13:00-17:30
+// examples:
+// 08:00-12:00
+// 08:00-12:00,13:00-17:30
+// 08:00-12:00, 13:00-17:30
+// off
std::optional<std::vector<OpeningHours::TimeInterval>> ParseTimeDescription(const std::string &timeDescription) {
std::vector<OpeningHours::TimeInterval> result;
if (timeDescription=="off") {
@@ -157,7 +161,7 @@
}
auto rangesStr=SplitString(timeDescription, ",");
for (const auto &rangeStr:rangesStr) {
- auto range=ParseTimeRange(rangeStr);
+ auto range=ParseTimeRange(Trim(rangeStr));
if (!range) {
return std::nullopt;
}
@@ -185,16 +189,16 @@
auto rulesStr = SplitString(str, ";");
for (std::string &ruleStr:rulesStr){
ruleStr=Trim(ruleStr);
- auto ruleSplit=SplitString(ruleStr, " ", 2);
- if (ruleSplit.size()!=2) {
+ auto ruleSplit=SplitStringToPair(ruleStr, " ");
+ if (!ruleSplit.has_value()) {
log.Warn() << "Cannot parse opening hours rule: " << ruleStr;
return std::nullopt;
}
- auto days=ParseDayDescription(ruleSplit.front());
+ auto days=ParseDayDescription(std::get<0>(ruleSplit.value()));
if (!days) {
return std::nullopt;
}
- auto timeIntervals=ParseTimeDescription(ruleSplit.back());
+ auto timeIntervals=ParseTimeDescription(std::get<1>(ruleSplit.value()));
if (!timeIntervals) {
return std::nullopt;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/String.cpp
^
|
@@ -425,6 +425,20 @@
return result;
}
+ std::optional<std::pair<std::string,std::string>> SplitStringToPair(const std::string& str,
+ const std::string& separator)
+ {
+ assert(!separator.empty());
+
+ std::string::size_type pos = str.find(separator);
+
+ if (pos == std::string::npos) {
+ return std::nullopt;
+ }
+ return std::make_pair(str.substr(0, pos),
+ str.substr(pos + separator.length()));
+ }
+
std::string GetFirstInStringList(const std::string& stringList,
const std::string& divider)
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/maps/.gitignore
^
|
@@ -7,6 +7,7 @@
/*.zip
/*.poly
/*.shp
+/*/*.hgt
# Libosmscout Databases
/*/*.txt
@@ -15,6 +16,7 @@
/*/*.idmap
/*/*.tmp
/*/*.html
+/*/*.dot
# Shapefiles
/*/*.cpg
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/meson.build
^
|
@@ -428,9 +428,9 @@
subdir('Tests')
endif
-if buildBinding
+#if buildBinding
# subdir('libosmscout-binding')
-endif
+#endif
run_target('cppcheck', command : ['scripts/cppcheck.sh',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/meson_options.txt
^
|
@@ -1,17 +1,15 @@
-option('openmp', type: 'boolean', value: 'true', description: 'use OpenMP if available')
-
-option('enableGpx', type: 'boolean', value: 'true', description: 'Build GPX library')
-option('enableImport', type: 'boolean', value: 'true', description: 'Build import library')
-option('enableTests', type: 'boolean', value: 'true', description: 'Build tests')
-option('enableMapAgg', type: 'boolean', value: 'true', description: 'Build AGG backend')
-option('enableMapCairo', type: 'boolean', value: 'true', description: 'Build Cairo backend')
-option('enableMapDirectX', type: 'boolean', value: 'true', description: 'Build DirectX backend')
-option('enableMapIOSX', type: 'boolean', value: 'true', description: 'Build iOS/OS X backend')
-option('enableMapOpenGL', type: 'boolean', value: 'true', description: 'Build OpenGL backend')
-option('enableMapQt', type: 'boolean', value: 'true', description: 'Build Qt backend')
-option('enableMapSvg', type: 'boolean', value: 'true', description: 'Build SVG backend')
-option('enableClientQt', type: 'boolean', value: 'true', description: 'Build Qt/QML library')
-option('enableXML', type: 'boolean', value: 'true', description: 'Use libxml2')
-option('qtVersion', type: 'integer', value: '5', min: 5, max: 6, description: 'QT version to use (5 or 6)')
-
+option('openmp', type: 'boolean', value: true, description: 'use OpenMP if available')
+option('enableGpx', type: 'boolean', value: true, description: 'Build GPX library')
+option('enableImport', type: 'boolean', value: true, description: 'Build import library')
+option('enableTests', type: 'boolean', value: true, description: 'Build tests')
+option('enableMapAgg', type: 'boolean', value: true, description: 'Build AGG backend')
+option('enableMapCairo', type: 'boolean', value: true, description: 'Build Cairo backend')
+option('enableMapDirectX', type: 'boolean', value: true, description: 'Build DirectX backend')
+option('enableMapIOSX', type: 'boolean', value: true, description: 'Build iOS/OS X backend')
+option('enableMapOpenGL', type: 'boolean', value: true, description: 'Build OpenGL backend')
+option('enableMapQt', type: 'boolean', value: true, description: 'Build Qt backend')
+option('enableMapSvg', type: 'boolean', value: true, description: 'Build SVG backend')
+option('enableClientQt', type: 'boolean', value: true, description: 'Build Qt/QML library')
+option('enableXML', type: 'boolean', value: true, description: 'Use libxml2')
+option('qtVersion', type: 'integer', value: 5, min: 5, max: 6, description: 'QT version to use (5 or 6)')
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/dependencies/libosmscout/stylesheets/map.ost
^
|
@@ -429,11 +429,11 @@
{Bridge, Tunnel}
//
- // Other public transport (not railway)
+ // Other public transport (not railway or ferry_terminal)
//
TYPE highway_bus_stop
- = NODE ("highway"=="bus_stop" OR (!("bus" IN ["no", "false", "0"]) AND ("public_transport" IN ["platform", "stop_position"])))
+ = NODE ("highway"=="bus_stop" OR (!("bus" IN ["no", "false", "0"]) AND !("amenity"=="ferry_terminal") AND ("public_transport" IN ["platform", "stop_position"])))
{Name, NameAlt}
TYPE public_transport_platform
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/graphics/cover-2.30.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.30.tar.bz2/pics/cover.jpg
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/qml/custom/OpeningHoursRow.qml
^
|
@@ -37,12 +37,12 @@
width: parent.width
height: openingHoursIcon.height
+ visible: openingHours!=""
IconButton {
id: openingHoursIcon
icon.source: "image://theme/icon-m-clock"
- visible: openingHours!=""
}
Label {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/qml/custom/POIIcon.qml
^
|
@@ -111,6 +111,7 @@
'historic': 'square-stroked',
'shop': 'shop',
+ 'shop_building': 'shop',
'christian_church_building':'religious-christian',
'christian_church': 'religious-christian',
'jewish_synagogue_building': 'religious-jewish',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/qml/pages/Collection.qml
^
|
@@ -678,7 +678,7 @@
collectionModel.editTrack(itemId, name, description, trackType);
} else { // collection
console.log("Edit collection " + itemId + ": " + name + " / " + description);
- collectionListModel.editCollection(itemId, collectionModel.collectionVisible, name, description, type);
+ collectionListModel.editCollection(itemId, collectionModel.collectionVisible, name, description);
}
parent.focus = true;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/qml/pages/Search.qml
^
|
@@ -696,8 +696,6 @@
lat: searchCenterLat
lon: searchCenterLon
- resultLimit: 100
-
// compute rank for location, it should be in range 0~1
function locationRank(loc){
if (loc.type=="coordinate"){
@@ -883,6 +881,7 @@
}
Column{
Label {
+ id: entryLabel
font.pixelSize: Theme.fontSizeExtraLarge
wrapMode: Text.Wrap
color: Theme.highlightColor
@@ -938,6 +937,20 @@
id: websiteRow
website: model.website
}
+ OpeningHoursRow {
+ id: openingHoursRow
+ openingHours: model.openingHours
+ MouseArea {
+ onClicked: {
+ pageStack.push(Qt.resolvedUrl("OpeningHours.qml"), {
+ "name": entryLabel.text,
+ "type": model.type,
+ "openingHours": model.openingHours
+ });
+ }
+ anchors.fill: parent
+ }
+ }
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.30.tar.bz2/translations/de.ts
^
|
@@ -979,7 +979,7 @@
<name>OpeningHours</name>
<message>
<source>Opening hours</source>
- <translation type="unfinished"></translation>
+ <translation>Öffnungszeiten</translation>
</message>
</context>
<context>
@@ -987,27 +987,27 @@
<message>
<source>closed</source>
<extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
+ <translation>geschlossen</translation>
</message>
<message>
<source>Public holiday</source>
<extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
+ <translation>gesetzlicher Feiertag</translation>
</message>
<message>
<source>School holiday</source>
<extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
+ <translation>Schulferien</translation>
</message>
<message>
<source>PH</source>
<extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
+ <translation>GF</translation>
</message>
<message>
<source>SH</source>
<extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
+ <translation>SF</translation>
</message>
</context>
<context>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.changes.in
^
|
@@ -592,3 +592,12 @@
- fix infinite loop in router when entering mini roundabout from oneway
- fix routing via junctions with turn restrictions
- support for simple POI opening hours
+
+* 2023-05-31 Lukáš Karas <lukas.karas@centrum.cz> 2.30
+- update translations (German)
+- fix search of generic phrases, like "Billa" in Germany - up to 2k entries is loaded from database, search model expose 100 nearest
+- show opening hours in search result detail
+- better error handling in opening hours parsing
+- fix rendering when map is rotated (during navigation), 2.29 regression
+- briefer navigation voice instruction just before turn
+- fix collection edit dialog
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.yaml
^
|
@@ -1,6 +1,6 @@
Name: harbour-osmscout
Summary: OSMScout for Sailfish
-Version: 2.29
+Version: 2.30
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
|