summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshat Tandon <akshat.tandon@research.iiit.ac.in>2016-07-19 19:42:15 (GMT)
committerAkshat Tandon <akshat.tandon@research.iiit.ac.in>2016-07-19 20:34:49 (GMT)
commita70e7d5b96e451ec9ca81cd01a50d4d32fcca685 (patch)
tree25d2a5657e4376325198c910f5ae9fe894b57071
parentc136126c70de748843bb819751cbf53946f4183a (diff)
Added vector rendering support for bathymetry
Reviewers: nienhueser, rahn Differential Revision: https://phabricator.kde.org/D2228
-rw-r--r--src/lib/marble/StyleBuilder.cpp15
-rw-r--r--src/lib/marble/declarative/Placemark.cpp1
-rw-r--r--src/lib/marble/geodata/data/GeoDataFeature.h1
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.cpp1
-rw-r--r--tools/shp2osm/polyshp2osm.py5
5 files changed, 19 insertions, 4 deletions
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index c13983b..7d11483 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -166,6 +166,8 @@ StyleBuilder::Private::Private() :
m_defaultMinZoomLevels[GeoDataFeature::Landmass] = 0;
m_defaultMinZoomLevels[GeoDataFeature::UrbanArea] = 3;
m_defaultMinZoomLevels[GeoDataFeature::InternationalDateLine] = 1;
+ m_defaultMinZoomLevels[GeoDataFeature::Bathymetry] = 1;
+
m_defaultMinZoomLevels[GeoDataFeature::AdminLevel1] = 0;
m_defaultMinZoomLevels[GeoDataFeature::AdminLevel2] = 1;
@@ -720,6 +722,7 @@ void StyleBuilder::Private::initializeDefaultStyles()
m_defaultStyle[GeoDataFeature::Landmass] = StyleBuilder::Private::createWayStyle( "#F1EEE8", "#F1EEE8", true, true );
m_defaultStyle[GeoDataFeature::UrbanArea] = StyleBuilder::Private::createWayStyle( "#E6E3DD", "#E6E3DD", true, true );
m_defaultStyle[GeoDataFeature::InternationalDateLine] = StyleBuilder::Private::createStyle( 1.0, 0.0, "#000000", "#000000", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false );
+ m_defaultStyle[GeoDataFeature::Bathymetry] = StyleBuilder::Private::createWayStyle( "#a5c9c9", "#a5c9c9", true, true );
m_defaultStyle[GeoDataFeature::AdminLevel1] = StyleBuilder::Private::createStyle(0.0, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::CustomDashLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 );
m_defaultStyle[GeoDataFeature::AdminLevel2] = StyleBuilder::Private::createStyle(2.0, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 );
@@ -884,7 +887,13 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
adjustStyle = true;
}
}
- if(visualCategory == GeoDataFeature::AmenityGraveyard || visualCategory == GeoDataFeature::LanduseCemetery) {
+ else if (visualCategory == GeoDataFeature::Bathymetry) {
+ if( osmData.containsTagKey("depth") ){
+ // Style according to depth
+
+ }
+ }
+ else if(visualCategory == GeoDataFeature::AmenityGraveyard || visualCategory == GeoDataFeature::LanduseCemetery) {
if( osmData.containsTag("religion","jewish") ){
polyStyle.setTexturePath(MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_jewish.png"));
adjustStyle = true;
@@ -1022,6 +1031,7 @@ QStringList StyleBuilder::renderOrder() const
paintLayerOrder << Private::createPaintLayerItem("Polygon", (GeoDataFeature::GeoDataVisualCategory)i);
}
}
+ paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::Bathymetry);
paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalBeach);
paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalWetland);
paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalGlacier);
@@ -1095,7 +1105,7 @@ QStringList StyleBuilder::renderOrder() const
for ( int i = GeoDataFeature::AdminLevel1; i <= GeoDataFeature::AdminLevel11; i++ ) {
paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "label");
}
-
+ paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::Bathymetry);
paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::AmenityGraveyard);
paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalWood);
paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalBeach);
@@ -1425,6 +1435,7 @@ QString StyleBuilder::visualCategoryName(GeoDataFeature::GeoDataVisualCategory c
visualCategoryNames[GeoDataFeature::Landmass] = "Landmass";
visualCategoryNames[GeoDataFeature::UrbanArea] = "UrbanArea";
visualCategoryNames[GeoDataFeature::InternationalDateLine] = "InternationalDateLine";
+ visualCategoryNames[GeoDataFeature::Bathymetry] = "Bathymetry";
visualCategoryNames[GeoDataFeature::AdminLevel1] = "AdminLevel1";
visualCategoryNames[GeoDataFeature::AdminLevel2] = "AdminLevel2";
visualCategoryNames[GeoDataFeature::AdminLevel3] = "AdminLevel3";
diff --git a/src/lib/marble/declarative/Placemark.cpp b/src/lib/marble/declarative/Placemark.cpp
index ae495a1..d05bfda 100644
--- a/src/lib/marble/declarative/Placemark.cpp
+++ b/src/lib/marble/declarative/Placemark.cpp
@@ -445,6 +445,7 @@ QString Placemark::categoryName(GeoDataFeature::GeoDataVisualCategory category)
case GeoDataFeature::Landmass: return tr("Land Mass");
case GeoDataFeature::UrbanArea: return tr("Urban Area");
case GeoDataFeature::InternationalDateLine: return tr("International Date Line");
+ case GeoDataFeature::Bathymetry: return tr("Bathymetry");
case GeoDataFeature::Valley: return tr("Valley");
case GeoDataFeature::OtherTerrain: return tr("Terrain");
case GeoDataFeature::Crater: return tr("Crater");
diff --git a/src/lib/marble/geodata/data/GeoDataFeature.h b/src/lib/marble/geodata/data/GeoDataFeature.h
index 25d1442..e36f751 100644
--- a/src/lib/marble/geodata/data/GeoDataFeature.h
+++ b/src/lib/marble/geodata/data/GeoDataFeature.h
@@ -416,6 +416,7 @@ class GEODATA_EXPORT GeoDataFeature : public GeoDataObject
Landmass,
UrbanArea,
InternationalDateLine,
+ Bathymetry,
// Important: Make sure that this is always the last
// item and just use it to specify the array size
diff --git a/src/lib/marble/osm/OsmPresetLibrary.cpp b/src/lib/marble/osm/OsmPresetLibrary.cpp
index 1786755..40e4407 100644
--- a/src/lib/marble/osm/OsmPresetLibrary.cpp
+++ b/src/lib/marble/osm/OsmPresetLibrary.cpp
@@ -329,6 +329,7 @@ void OsmPresetLibrary::initializeOsmVisualCategories()
s_visualCategories[ OsmTag( "marble_land", "landmass" ) ] = GeoDataFeature::Landmass;
s_visualCategories[ OsmTag( "settlement", "yes" ) ] = GeoDataFeature::UrbanArea;
s_visualCategories[ OsmTag( "marble_line", "date" ) ] = GeoDataFeature::InternationalDateLine;
+ s_visualCategories[ OsmTag( "marble:feature", "bathymetry" ) ] = GeoDataFeature::Bathymetry;
// Default for buildings
foreach(const QString &value, buildingValues() ) {
diff --git a/tools/shp2osm/polyshp2osm.py b/tools/shp2osm/polyshp2osm.py
index ea3e4e2..fa9e8cf 100644
--- a/tools/shp2osm/polyshp2osm.py
+++ b/tools/shp2osm/polyshp2osm.py
@@ -115,7 +115,7 @@ def purpose(data):
if 'prim_purp' in data:
if data['prim_purp'] in keys:
return keys[data['prim_purp']]
-
+
def road_map(data):
keys = {
@@ -273,7 +273,8 @@ def feature_class(data):
'1st Order Admin Lines': [('boundary', 'administrative'), ('admin_level', '4')],
'Claim': [('boundary', 'administrative'), ('admin_level', '4')],
'Airport': [('aeroway', 'aerodrome')],
- 'Date line': [('marble_line', 'date')]
+ 'Date line': [('marble_line', 'date')],
+ 'Bathymetry': [('marble:feature', 'bathymetry'), ('depth', data['depth'])]
}
if 'featurecla' in data:
if data['featurecla'] in feat_dict: