Skip to content

Commit 7ddadbf

Browse files
committed
WCS support
1 parent 7d500ea commit 7ddadbf

File tree

7 files changed

+45
-1
lines changed

7 files changed

+45
-1
lines changed

images/images.qrc

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<file>themes/default/mActionAddRing.png</file>
3434
<file>themes/default/mActionAddSpatiaLiteLayer.png</file>
3535
<file>themes/default/mActionAddVertex.png</file>
36+
<file>themes/default/mActionAddWcsLayer.png</file>
3637
<file>themes/default/mActionAddWmsLayer.png</file>
3738
<file>themes/default/mActionAlignBottom.png</file>
3839
<file>themes/default/mActionAlignHCenter.png</file>
2.01 KB
Loading

src/app/qgisapp.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ void QgisApp::createActions()
888888
connect( mActionAddSpatiaLiteLayer, SIGNAL( triggered() ), this, SLOT( addSpatiaLiteLayer() ) );
889889
connect( mActionAddMssqlLayer, SIGNAL( triggered() ), this, SLOT( addMssqlLayer() ) );
890890
connect( mActionAddWmsLayer, SIGNAL( triggered() ), this, SLOT( addWmsLayer() ) );
891+
connect( mActionAddWcsLayer, SIGNAL( triggered() ), this, SLOT( addWcsLayer() ) );
891892
connect( mActionAddWfsLayer, SIGNAL( triggered() ), this, SLOT( addWfsLayer() ) );
892893
connect( mActionOpenTable, SIGNAL( triggered() ), this, SLOT( attributeTable() ) );
893894
connect( mActionToggleEditing, SIGNAL( triggered() ), this, SLOT( toggleEditing() ) );
@@ -1583,6 +1584,7 @@ void QgisApp::setTheme( QString theThemeName )
15831584
mActionNewBookmark->setIcon( getThemeIcon( "/mActionNewBookmark.png" ) );
15841585
mActionCustomProjection->setIcon( getThemeIcon( "/mActionCustomProjection.png" ) );
15851586
mActionAddWmsLayer->setIcon( getThemeIcon( "/mActionAddWmsLayer.png" ) );
1587+
mActionAddWcsLayer->setIcon( getThemeIcon( "/mActionAddWcsLayer.png" ) );
15861588
mActionAddWfsLayer->setIcon( getThemeIcon( "/mActionAddWfsLayer.png" ) );
15871589
mActionAddToOverview->setIcon( getThemeIcon( "/mActionInOverview.png" ) );
15881590
mActionAnnotation->setIcon( getThemeIcon( "/mActionAnnotation.png" ) );
@@ -2632,6 +2634,27 @@ void QgisApp::addWmsLayer()
26322634
delete wmss;
26332635
}
26342636

2637+
void QgisApp::addWcsLayer()
2638+
{
2639+
if ( mMapCanvas && mMapCanvas->isDrawing() )
2640+
{
2641+
return;
2642+
}
2643+
QgsDebugMsg( "about to addWcsLayer" );
2644+
2645+
// TODO: QDialog for now, switch to QWidget in future
2646+
QDialog *wcss = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( QString( "gdal" ), this ) );
2647+
if ( !wcss )
2648+
{
2649+
QMessageBox::warning( this, tr( "WCS" ), tr( "Cannot get WCS select dialog from provider." ) );
2650+
return;
2651+
}
2652+
connect( wcss , SIGNAL( addRasterLayer( QString const &, QString const &, QString const & ) ),
2653+
this , SLOT( addRasterLayer( QString const &, QString const &, QString const & ) ) );
2654+
wcss->exec();
2655+
delete wcss;
2656+
}
2657+
26352658
void QgisApp::addWfsLayer()
26362659
{
26372660
if ( !mMapCanvas )

src/app/qgisapp.h

+3
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
280280
QAction *actionAddPgLayer() { return mActionAddPgLayer; }
281281
QAction *actionAddSpatiaLiteLayer() { return mActionAddSpatiaLiteLayer; };
282282
QAction *actionAddWmsLayer() { return mActionAddWmsLayer; }
283+
QAction *actionAddWcsLayer() { return mActionAddWcsLayer; }
283284
QAction *actionAddWfsLayer() { return mActionAddWfsLayer; }
284285
QAction *actionOpenTable() { return mActionOpenTable; }
285286
QAction *actionToggleEditing() { return mActionToggleEditing; }
@@ -763,6 +764,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
763764
void fileExit();
764765
//! Add a WMS layer to the map
765766
void addWmsLayer();
767+
//! Add a WCS layer to the map
768+
void addWcsLayer();
766769
//! Add a WFS layer to the map
767770
void addWfsLayer();
768771
//! Set map tool to Zoom out

src/core/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ SET(QGIS_CORE_SRCS
7676
qgsmessagelog.cpp
7777
qgscredentials.cpp
7878
qgsoverlayobject.cpp
79+
qgsowsconnection.cpp
7980
qgspalgeometry.cpp
8081
qgspallabeling.cpp
8182
qgspalobjectpositionmanager.cpp
@@ -326,6 +327,7 @@ SET(QGIS_CORE_HDRS
326327
qgsmimedatautils.h
327328
qgscredentials.h
328329
qgsoverlayobjectpositionmanager.h
330+
qgsowsconnection.h
329331
qgspallabeling.h
330332
qgspalobjectpositionmanager.h
331333
qgspluginlayer.h

src/gui/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ qgsnewhttpconnection.cpp
6565
qgsnewvectorlayerdialog.cpp
6666
qgsnumericsortlistviewitem.cpp
6767
qgscredentialdialog.cpp
68+
qgsowssourceselect.cpp
6869
qgsprojectbadlayerguihandler.cpp
6970
qgsprojectionselector.cpp
7071
qgsquickprint.cpp
@@ -137,6 +138,7 @@ qgsmessagelogviewer.h
137138
qgsnewhttpconnection.h
138139
qgsnewvectorlayerdialog.h
139140
qgscredentialdialog.h
141+
qgsowssourceselect.h
140142
qgsprojectionselector.h
141143
qgsquickprint.h
142144
qgsludialog.h
@@ -172,6 +174,7 @@ qgsmaptoolpan.h
172174
qgsmaptoolzoom.h
173175
qgsmessageviewer.h
174176
qgscredentialdialog.h
177+
qgsowssourceselect.h
175178
qgsprojectionselector.h
176179
qgsrubberband.h
177180
qgsvertexmarker.h
@@ -204,6 +207,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsdetaileditemwidgetbase.h
204207
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsgenericprojectionselectorbase.h
205208
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsmessageviewer.h
206209
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsmessagelogviewer.h
210+
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsowssourceselectbase.h
207211
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgscredentialdialog.h
208212
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsprojectionselectorbase.h
209213
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsquerybuilderbase.h

src/ui/qgisapp.ui

+12-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<x>0</x>
1818
<y>0</y>
1919
<width>1052</width>
20-
<height>21</height>
20+
<height>27</height>
2121
</rect>
2222
</property>
2323
<widget class="QMenu" name="mEditMenu">
@@ -150,6 +150,7 @@
150150
<addaction name="mActionAddMssqlLayer"/>
151151
<addaction name="mActionAddWmsLayer"/>
152152
<addaction name="mActionAddLayerSeparator"/>
153+
<addaction name="mActionAddWcsLayer"/>
153154
<addaction name="mActionAddWfsLayer"/>
154155
<addaction name="separator"/>
155156
<addaction name="mActionOpenTable"/>
@@ -253,6 +254,7 @@
253254
<addaction name="mActionAddSpatiaLiteLayer"/>
254255
<addaction name="mActionAddMssqlLayer"/>
255256
<addaction name="mActionAddWmsLayer"/>
257+
<addaction name="mActionAddWcsLayer"/>
256258
<addaction name="mActionAddWfsLayer"/>
257259
<addaction name="mActionNewVectorLayer"/>
258260
<addaction name="mActionRemoveLayer"/>
@@ -1648,6 +1650,15 @@
16481650
<string>Offset Curve</string>
16491651
</property>
16501652
</action>
1653+
<action name="mActionAddWcsLayer">
1654+
<property name="icon">
1655+
<iconset resource="../../images/images.qrc">
1656+
<normaloff>:/images/themes/default/mActionAddWcsLayer.png</normaloff>:/images/themes/default/mActionAddWcsLayer.png</iconset>
1657+
</property>
1658+
<property name="text">
1659+
<string>Add WCS Layer...</string>
1660+
</property>
1661+
</action>
16511662
</widget>
16521663
<resources>
16531664
<include location="../../images/images.qrc"/>

0 commit comments

Comments
 (0)