QStringList QgsWCSSourceSelect::selectedLayersCrses() { QString identifier = selectedIdentifier(); if ( identifier.isEmpty() ) { return QStringList(); } QgsWcsCoverageSummary c = mCapabilities.coverage( identifier ); if ( !c.valid ) { return QStringList(); } return c.supportedCrs; }
QStringList QgsWCSSourceSelect::selectedLayersTimes() { QString identifier = selectedIdentifier(); if ( identifier.isEmpty() ) { return QStringList(); } QgsWcsCoverageSummary c = mCapabilities.coverage( identifier ); if ( !c.valid ) { return QStringList(); } QgsDebugMsg( "times = " + c.times.join( "," ) ); return c.times; }
QStringList QgsWCSSourceSelect::selectedLayersFormats() { QgsDebugMsg( "entered" ); QString identifier = selectedIdentifier(); if ( identifier.isEmpty() ) { return QStringList(); } QgsWcsCoverageSummary c = mCapabilities.coverage( identifier ); if ( !c.valid ) { return QStringList(); } QgsDebugMsg( "supportedFormat = " + c.supportedFormat.join( "," ) ); return c.supportedFormat; }
void QgsWCSSourceSelect::mLayersTreeWidget_itemSelectionChanged() { QString identifier = selectedIdentifier(); if ( identifier.isEmpty() ) { return; } mCapabilities.describeCoverage( identifier ); populateTimes(); populateFormats(); populateCrs(); updateButtons(); emit enableButtons( true ); }
void QgsWCSSourceSelect::on_mLayersTreeWidget_itemSelectionChanged() { QgsDebugMsg( "entered" ); QString identifier = selectedIdentifier(); if ( identifier.isEmpty() ) { return; } mCapabilities.describeCoverage( identifier ); populateTimes(); populateFormats(); populateCRS(); updateButtons(); mAddButton->setEnabled( true ); }
void QgsWCSSourceSelect::addClicked() { QgsDebugMsg( "entered" ); QgsDataSourceURI uri = mUri; QString identifier = selectedIdentifier(); if ( identifier.isEmpty() ) { return; } uri.setParam( "identifier", identifier ); // Set crs only if necessary (multiple offered), so that we can decide in the // provider if WCS 1.0 with RESPONSE_CRS has to be used. Not perfect, they can // add more CRS in future and URI will be saved in project without any. // TODO: consider again, currently if crs in url is used to set WCS coverage CRS, // without that param user is asked for CRS //if ( selectedLayersCRSs().size() > 1 ) //{ uri.setParam( "crs", selectedCRS() ); //} QgsDebugMsg( "selectedFormat = " + selectedFormat() ); if ( !selectedFormat().isEmpty() ) { uri.setParam( "format", selectedFormat() ); } QgsDebugMsg( "selectedTime = " + selectedTime() ); if ( !selectedTime().isEmpty() ) { uri.setParam( "time", selectedTime() ); } QString cache; QgsDebugMsg( QString( "selectedCacheLoadControl = %1" ).arg( selectedCacheLoadControl() ) ); cache = QgsNetworkAccessManager::cacheLoadControlName( selectedCacheLoadControl() ); uri.setParam( "cache", cache ); emit addRasterLayer( uri.encodedUri(), identifier, "wcs" ); }