sldpatch.patch
src/app/legend/qgslegend.cpp (working copy) | ||
---|---|---|
714 | 714 |
{ |
715 | 715 |
QgsRasterLayerProperties *rlp = NULL; // See note above about reusing this |
716 | 716 |
if ( rlp ) |
717 |
{ |
|
717 |
{
|
|
718 | 718 |
rlp->sync(); |
719 | 719 |
} |
720 | 720 |
else |
721 | 721 |
{ |
722 | 722 |
rlp = new QgsRasterLayerProperties( ml ); |
723 |
connect( rlp, SIGNAL( refreshLegend( QString, bool ) ), this, SLOT( refreshLayerSymbology( QString, bool ) ) ); |
|
723 |
connect( rlp, SIGNAL( refreshLegend( QString, bool ) ), this, SLOT( refreshLayerSymbology( QString, bool ) ) ); |
|
724 |
|
|
724 | 725 |
} |
726 |
|
|
725 | 727 |
rlp->exec(); |
726 | 728 |
delete rlp; // delete since dialog cannot be reused without updating code |
727 | 729 |
} |
... | ... | |
738 | 740 |
{ |
739 | 741 |
vlp = new QgsVectorLayerProperties( vlayer ); |
740 | 742 |
connect( vlp, SIGNAL( refreshLegend( QString, bool ) ), this, SLOT( refreshLayerSymbology( QString, bool ) ) ); |
743 |
//the following line is neccesary to avoid qgis hanging in windows |
|
744 |
QString fix="quick fix"; |
|
741 | 745 |
} |
742 | 746 |
vlp->exec(); |
743 | 747 |
delete vlp; // delete since dialog cannot be reused without updating code |
... | ... | |
1476 | 1480 | |
1477 | 1481 | |
1478 | 1482 |
void QgsLegend::refreshLayerSymbology( QString key, bool expandItem ) |
1479 |
{ |
|
1483 |
{
|
|
1480 | 1484 |
QgsLegendLayer* theLegendLayer = findLegendLayer( key ); |
1481 | 1485 |
if ( !theLegendLayer ) |
1482 | 1486 |
{ |
src/app/qgisapp.cpp (working copy) | ||
---|---|---|
2719 | 2719 | |
2720 | 2720 |
if ( wmss->exec() ) |
2721 | 2721 |
{ |
2722 |
QMap<QString,QString> parameters; |
|
2722 | 2723 | |
2724 |
parameters.clear(); |
|
2725 |
parameters.insert("connection",wmss->connectionInfo()); |
|
2726 |
parameters.insert("basename",(wmss->selectedLayers().join( "/" ))); |
|
2727 |
parameters.insert("provider","wms"); |
|
2728 |
parameters.insert("layers",wmss->selectedLayers().join("/")); |
|
2729 |
parameters.insert("styles",wmss->selectedStylesForSelectedLayers().join("/")); |
|
2730 |
parameters.insert("format",wmss->selectedImageEncoding()); |
|
2731 |
parameters.insert("crs",wmss->selectedCrs()); |
|
2732 |
parameters.insert("sld",wmss->sldURL()); |
|
2733 |
parameters.insert("sld_body",wmss->sldBody()); |
|
2734 |
addRasterLayer(parameters); |
|
2735 | ||
2736 |
/*QgsRasterLayer* QgisApp::addRasterLayer( QString const & rasterLayerPath, |
|
2737 |
QString const & baseName, |
|
2738 |
QString const & providerKey, |
|
2739 |
QStringList const & layers, |
|
2740 |
QStringList const & styles, |
|
2741 |
QString const & format, |
|
2742 |
QString const & crs ) |
|
2723 | 2743 |
addRasterLayer( wmss->connectionInfo(), |
2724 |
/*wmss->connName()*/wmss->selectedLayers().join( "/" ),
|
|
2744 |
wmss->selectedLayers().join( "/" ),
|
|
2725 | 2745 |
"wms", |
2726 | 2746 |
wmss->selectedLayers(), |
2727 | 2747 |
wmss->selectedStylesForSelectedLayers(), |
2728 | 2748 |
wmss->selectedImageEncoding(), |
2729 |
wmss->selectedCrs() ); |
|
2749 |
wmss->selectedCrs() );*/
|
|
2730 | 2750 |
} |
2731 | 2751 |
} |
2732 | 2752 | |
... | ... | |
5864 | 5884 | |
5865 | 5885 |
} // QgisApp::addRasterLayer |
5866 | 5886 | |
5887 |
/*fred*/ |
|
5888 |
QgsRasterLayer* QgisApp::addRasterLayer( QMap<QString,QString> theWmsLayerProperties) |
|
5889 |
{ |
|
5890 |
if ( mMapCanvas && mMapCanvas->isDrawing() ) |
|
5891 |
{ |
|
5892 |
return 0; |
|
5893 |
} |
|
5894 |
mMapCanvas->freeze(); |
|
5895 |
|
|
5896 |
// create the layer |
|
5897 |
QgsRasterLayer *layer; |
|
5898 |
|
|
5899 |
/*QgsDebugMsg( "Creating new raster layer using " + rasterLayerPath |
|
5900 |
+ " with baseName of " + baseName |
|
5901 |
+ " and layer list of " + layers.join( ", " ) |
|
5902 |
+ " and style list of " + styles.join( ", " ) |
|
5903 |
+ " and format of " + format |
|
5904 |
+ " and providerKey of " + providerKey |
|
5905 |
+ " and CRS of " + crs );*/ |
|
5906 |
QString rasterLayerPath=theWmsLayerProperties.value("connection"); |
|
5907 |
QString baseName=theWmsLayerProperties.value("basename"); |
|
5908 |
layer = new QgsRasterLayer(rasterLayerPath,baseName,theWmsLayerProperties); |
|
5909 |
//layer = new QgsRasterLayer( 0, rasterLayerPath, baseName, providerKey, layers, styles, format, crs ); |
|
5867 | 5910 | |
5911 |
QgsDebugMsg( "Constructed new layer." ); |
|
5868 | 5912 | |
5913 |
if ( layer && layer->isValid() ) |
|
5914 |
{ |
|
5915 |
addRasterLayer( layer ); |
|
5916 | ||
5917 |
statusBar()->showMessage( mMapCanvas->extent().toString( 2 ) ); |
|
5918 | ||
5919 |
} |
|
5920 |
else |
|
5921 |
{ |
|
5922 |
QMessageBox::critical( this, tr( "Layer is not valid" ), |
|
5923 |
tr( "The layer is not a valid layer and can not be added to the map" ) ); |
|
5924 |
} |
|
5925 | ||
5926 |
// update UI |
|
5927 |
qApp->processEvents(); |
|
5928 |
// draw the map |
|
5929 |
mMapCanvas->freeze( false ); |
|
5930 |
mMapCanvas->refresh(); |
|
5931 |
return layer; |
|
5932 |
} |
|
5933 |
/*fred*/ |
|
5869 | 5934 |
/** Add a raster layer directly without prompting user for location |
5870 | 5935 |
The caller must provide information compatible with the provider plugin |
5871 | 5936 |
using the rasterLayerPath and baseName. The provider can use these |
src/app/qgisapp.h (working copy) | ||
---|---|---|
99 | 99 |
*/ |
100 | 100 |
bool addRasterLayers( QStringList const & theLayerQStringList, bool guiWarning = true ); |
101 | 101 | |
102 |
/** Open a raster layer using the Raster Data Provider. |
|
103 |
* This method use a map to pass all the neccesary wms properties |
|
104 |
*/ |
|
105 |
QgsRasterLayer* addRasterLayer( QMap<QString,QString> theWmsLayerProperties); |
|
106 | ||
102 | 107 |
/** Open a raster layer using the Raster Data Provider. |
103 | 108 |
* Note this is included to support WMS layers only at this stage, |
104 | 109 |
* GDAL layer support via a Provider is not yet implemented. |
src/app/qgsrasterlayerproperties.cpp (working copy) | ||
---|---|---|
57 | 57 |
mRasterLayer( dynamic_cast<QgsRasterLayer*>( lyr ) ) |
58 | 58 |
{ |
59 | 59 | |
60 |
|
|
61 | ||
60 | 62 |
ignoreSpinBoxEvent = false; //Short circuit signal loop between min max field and stdDev spin box |
61 | 63 |
mGrayMinimumMaximumEstimated = true; |
62 | 64 |
mRGBMinimumMaximumEstimated = true; |
... | ... | |
75 | 77 |
} |
76 | 78 | |
77 | 79 |
setupUi( this ); |
80 |
// disable SLD tab |
|
81 |
tabBar->setTabEnabled( tabBar->indexOf( tabSLD ), FALSE ); |
|
82 | ||
78 | 83 |
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); |
79 | 84 |
connect( this, SIGNAL( accepted() ), this, SLOT( apply() ) ); |
80 | 85 |
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) ); |
... | ... | |
269 | 274 |
// Only do pyramids if dealing directly with GDAL. |
270 | 275 |
if ( mRasterLayerIsGdal ) |
271 | 276 |
{ |
277 |
|
|
272 | 278 |
QgsRasterLayer::RasterPyramidList myPyramidList = mRasterLayer->buildPyramidList(); |
273 | 279 |
QgsRasterLayer::RasterPyramidList::iterator myRasterPyramidIterator; |
274 | 280 | |
... | ... | |
297 | 303 | |
298 | 304 |
// disable Histogram tab completely |
299 | 305 |
tabBar->setTabEnabled( tabBar->indexOf( tabPageHistogram ), FALSE ); |
306 |
// enable SLD tab |
|
307 |
tabBar->setTabEnabled( tabBar->indexOf( tabSLD ), TRUE ); |
|
300 | 308 |
} |
301 | 309 | |
302 | 310 |
leSpatialRefSys->setText( mRasterLayer->srs().toProj4() ); |
... | ... | |
837 | 845 |
txtbMetadata->document()->setDefaultStyleSheet( myStyle ); |
838 | 846 |
txtbMetadata->setHtml( mRasterLayer->metadata() ); |
839 | 847 | |
848 | ||
849 |
QgsDebugMsg( "populate sld tab" ); |
|
850 |
/* |
|
851 |
* SLD Tab |
|
852 |
*/ |
|
853 |
if ( mRasterLayerIsWms ){ |
|
854 |
sldURLEdit->setText(mRasterLayer->dataProvider()->sldURL()); |
|
855 |
sldBodyText->clear(); |
|
856 |
sldBodyText->appendPlainText(mRasterLayer->dataProvider()->sldBody()); |
|
857 |
} |
|
858 | ||
840 | 859 |
} // QgsRasterLayerProperties::sync() |
841 | 860 | |
842 | 861 |
void QgsRasterLayerProperties::syncColormapTab() |
... | ... | |
1413 | 1432 |
QgsDebugMsg( "color ramp was NOT set because RasterShaderFunction was NULL" ); |
1414 | 1433 |
} |
1415 | 1434 |
} |
1435 |
/*fred*/ |
|
1436 |
QgsDebugMsg( "processing sld tab" ); |
|
1437 |
if ( mRasterLayerIsWms ){ |
|
1438 |
mRasterLayer->dataProvider()->setSLDURL(sldURLEdit->text()); |
|
1439 |
mRasterLayer->dataProvider()->setSLDBody(sldBodyText->toPlainText()); |
|
1440 |
} |
|
1441 |
/*fred*/ |
|
1416 | 1442 | |
1417 | 1443 |
QgsDebugMsg( "processing general tab" ); |
1418 | 1444 |
/* |
src/app/qgsserversourceselect.cpp (working copy) | ||
---|---|---|
656 | 656 |
} |
657 | 657 |
} |
658 | 658 | |
659 |
QString QgsServerSourceSelect::sldURL() |
|
660 |
{ |
|
661 |
return sldUrlText->text(); |
|
662 |
} |
|
663 | ||
664 |
QString QgsServerSourceSelect::sldBody() |
|
665 |
{ |
|
666 |
return sldBodyEdit->toPlainText(); |
|
667 |
} |
|
668 | ||
659 | 669 |
void QgsServerSourceSelect::serverChanged() |
660 | 670 |
{ |
661 | 671 |
// Remember which server was selected. |
src/app/qgsserversourceselect.h (working copy) | ||
---|---|---|
81 | 81 | |
82 | 82 |
//! String containing the selected WMS-format CRS |
83 | 83 |
QString selectedCrs(); |
84 |
|
|
85 |
//! String containing a url pointing to external sld document |
|
86 |
QString sldURL(); |
|
84 | 87 | |
88 |
//! String containing an SLD document |
|
89 |
QString sldBody(); |
|
85 | 90 |
//! Stores which server is now selected. |
86 | 91 |
void serverChanged(); |
87 | 92 |
src/core/qgsrasterdataprovider.h (working copy) | ||
---|---|---|
82 | 82 |
*/ |
83 | 83 |
virtual void setImageCrs( QString const & crs ) = 0; |
84 | 84 | |
85 |
/** |
|
86 |
* Set the url of sld document |
|
87 |
* Added in qgis version 1.2 |
|
88 |
*/ |
|
89 |
virtual void setSLDURL( QString const & sldURL ) = 0; |
|
90 |
/** |
|
91 |
* Retrieves the url of sld document |
|
92 |
* Added in qgis version 1.2 |
|
93 |
*/ |
|
94 |
virtual QString sldURL()=0; |
|
95 |
/** |
|
96 |
* Set the sld document body |
|
97 |
* Added in qgis version 1.2 |
|
98 |
*/ |
|
99 |
virtual void setSLDBody( QString const & sldBody ) = 0; |
|
85 | 100 | |
101 |
/** |
|
102 |
* Retrieves the sld document body |
|
103 |
* Added in qgis version 1.2 |
|
104 |
*/ |
|
105 |
virtual QString sldBody() = 0; |
|
86 | 106 |
// TODO: Document this better. |
87 | 107 |
/** \brief Renders the layer as an image |
88 | 108 |
*/ |
src/core/raster/qgsrasterlayer.cpp (working copy) | ||
---|---|---|
61 | 61 |
#include <QRegExp> |
62 | 62 |
#include <QSlider> |
63 | 63 |
#include <QSettings> |
64 |
#include <QUrl> |
|
64 | 65 |
#include "qgslogger.h" |
65 | 66 |
// workaround for MSVC compiler which already has defined macro max |
66 | 67 |
// that interferes with calling std::numeric_limits<int>::max |
... | ... | |
186 | 187 |
// if we're given a provider type, try to create and bind one to this layer |
187 | 188 |
if ( ! providerKey.isEmpty() ) |
188 | 189 |
{ |
189 |
setDataProvider( providerKey, layers, styles, format, crs ); |
|
190 |
setDataProvider( providerKey, layers, styles, format, crs,"","" );
|
|
190 | 191 |
} |
191 | 192 | |
192 | 193 |
// Default for the popup menu |
... | ... | |
213 | 214 |
emit statusChanged( tr( "QgsRasterLayer created" ) ); |
214 | 215 |
} // QgsRasterLayer ctor |
215 | 216 | |
217 |
//fred |
|
218 |
QgsRasterLayer::QgsRasterLayer( QString const & rasterLayerPath, |
|
219 |
QString const & baseName, |
|
220 |
QMap<QString,QString> theWmsProperties) |
|
221 |
: QgsMapLayer( RasterLayer, baseName, rasterLayerPath ), |
|
222 |
mStandardDeviations( 0 ), |
|
223 |
mDataProvider( 0 ), |
|
224 |
mEditable( false ), |
|
225 |
mWidth( std::numeric_limits<int>::max() ), |
|
226 |
mHeight( std::numeric_limits<int>::max() ), |
|
227 |
mInvertColor( false ), |
|
228 |
mModified( false ), |
|
229 |
mProviderKey( "wms" ) |
|
230 |
{ |
|
231 |
/*QgsDebugMsg( "(8 arguments) starting. with layer list of " + |
|
232 |
layers.join( ", " ) + " and style list of " + styles.join( ", " ) + " and format of " + |
|
233 |
format + " and CRS of " + crs );*/ |
|
234 | ||
235 |
mRasterShader = new QgsRasterShader(); |
|
236 | ||
237 |
// Initialise the affine transform matrix |
|
238 |
mGeoTransform[0] = 0; |
|
239 |
mGeoTransform[1] = 1; |
|
240 |
mGeoTransform[2] = 0; |
|
241 |
mGeoTransform[3] = 0; |
|
242 |
mGeoTransform[4] = 0; |
|
243 |
mGeoTransform[5] = -1; |
|
244 | ||
245 |
QStringList layers=theWmsProperties.value("layers").split("/"); |
|
246 |
QStringList styles=theWmsProperties.value("styles").split("/"); |
|
247 |
QString format=theWmsProperties.value("format"); |
|
248 |
QString crs=theWmsProperties.value("crs"); |
|
249 |
QString sld=theWmsProperties.value("sld"); |
|
250 |
QString sldbody=theWmsProperties.value("sld_body"); |
|
251 |
setDataProvider( "wms", |
|
252 |
layers, |
|
253 |
styles, |
|
254 |
format, |
|
255 |
crs, |
|
256 |
sld, |
|
257 |
sldbody); |
|
258 |
|
|
259 |
connect( |
|
260 |
mDataProvider, SIGNAL( statusChanged( QString ) ), |
|
261 |
this, SLOT( showStatusMessage( QString ) ) |
|
262 |
); |
|
263 |
|
|
264 | ||
265 |
emit statusChanged( tr( "QgsRasterLayer created" ) ); |
|
266 |
} // QgsRasterLayer ctor |
|
267 |
//fred |
|
268 | ||
216 | 269 |
QgsRasterLayer::~QgsRasterLayer() |
217 | 270 |
{ |
218 | 271 | |
... | ... | |
3094 | 3147 |
QStringList const & layers, |
3095 | 3148 |
QStringList const & styles, |
3096 | 3149 |
QString const & format, |
3097 |
QString const & crs ) |
|
3150 |
QString const & crs, |
|
3151 |
QString const &sldurl, |
|
3152 |
QString const &sldbody) |
|
3098 | 3153 |
{ |
3099 | 3154 |
// XXX should I check for and possibly delete any pre-existing providers? |
3100 | 3155 |
// XXX How often will that scenario occur? |
... | ... | |
3161 | 3216 |
mDataProvider->addLayers( layers, styles ); |
3162 | 3217 |
mDataProvider->setImageEncoding( format ); |
3163 | 3218 |
mDataProvider->setImageCrs( crs ); |
3219 |
|
|
3220 |
//fred |
|
3221 |
mDataProvider->setSLDURL(sldurl); |
|
3222 |
mDataProvider->setSLDBody(sldbody); |
|
3164 | 3223 | |
3165 | 3224 |
// get the extent |
3166 | 3225 |
QgsRectangle mbr = mDataProvider->extent(); |
... | ... | |
3818 | 3877 | |
3819 | 3878 |
// Collect CRS |
3820 | 3879 |
QString crs = QString( "EPSG:%1" ).arg( srs().epsg() ); |
3880 |
//fix here to save and load slds in project |
|
3881 |
|
|
3882 |
// Collect SLDURL |
|
3883 |
QString mySLDUrl = rpNode.namedItem( "wmsSLDURL" ).toElement().text(); |
|
3821 | 3884 | |
3822 |
setDataProvider( mProviderKey, layers, styles, format, crs ); |
|
3885 | ||
3886 |
// Collect |
|
3887 |
QString mySLDBody = rpNode.namedItem( "wmsSLDBody" ).toElement().text(); |
|
3888 |
QUrl myUrl; |
|
3889 |
myUrl.addEncodedQueryItem("sld_body",mySLDBody.toLocal8Bit()); |
|
3890 |
QString sldBody(myUrl.queryItemValue("sld_body")); |
|
3891 |
|
|
3892 |
setDataProvider( mProviderKey, layers, styles, format, crs, mySLDUrl, sldBody ); |
|
3823 | 3893 |
} |
3824 | 3894 |
else |
3825 | 3895 |
{ |
... | ... | |
3898 | 3968 |
formatElement.appendChild( formatText ); |
3899 | 3969 |
rasterPropertiesElement.appendChild( formatElement ); |
3900 | 3970 | |
3971 |
//sld-url |
|
3972 |
QDomElement sldURLElement = document.createElement( "wmsSLDURL" ); |
|
3973 |
QDomText sldURLText = |
|
3974 |
document.createTextNode( mDataProvider->sldURL() ); |
|
3975 |
sldURLElement.appendChild( sldURLText ); |
|
3976 |
rasterPropertiesElement.appendChild( sldURLElement ); |
|
3977 | ||
3978 |
//sld-body |
|
3979 |
QString mySLDBody=mDataProvider->sldBody().trimmed(); |
|
3980 |
QUrl myUrl; |
|
3981 |
myUrl.addQueryItem("sld_body",mySLDBody); |
|
3982 |
QString mySLD_Body(myUrl.encodedQueryItemValue("sld_body")); |
|
3983 |
QDomElement sldBodyElement = document.createElement( "wmsSLDBody" ); |
|
3984 |
QDomText sldBodyText = |
|
3985 |
document.createTextNode( mySLD_Body ); |
|
3986 |
sldBodyElement.appendChild( sldBodyText ); |
|
3987 |
rasterPropertiesElement.appendChild( sldBodyElement ); |
|
3988 | ||
3901 | 3989 |
} |
3902 | 3990 | |
3903 | 3991 |
// <mDrawingStyle> |
src/core/raster/qgsrasterlayer.h (working copy) | ||
---|---|---|
208 | 208 |
const QStringList & layers = QStringList(), |
209 | 209 |
const QStringList & styles = QStringList(), |
210 | 210 |
const QString & format = QString(), |
211 |
const QString & crs = QString() );
|
|
211 |
const QString & crs = QString()); |
|
212 | 212 | |
213 |
QgsRasterLayer( QString const & rasterLayerPath, |
|
214 |
QString const & baseName, |
|
215 |
QMap<QString,QString> theWmsProperties); |
|
213 | 216 | |
217 | ||
214 | 218 |
/** \brief The destructor */ |
215 | 219 |
~QgsRasterLayer(); |
216 | 220 | |
... | ... | |
365 | 369 |
const QStringList & layers, |
366 | 370 |
const QStringList & styles, |
367 | 371 |
const QString & format, |
368 |
const QString & crs ); |
|
372 |
const QString & crs, |
|
373 |
const QString & sldurl, |
|
374 |
const QString & sldbody); |
|
369 | 375 | |
370 | 376 |
/** \brief Mutator for drawing style */ |
371 | 377 |
void setDrawingStyle( const DrawingStyle & theDrawingStyle ) { mDrawingStyle = theDrawingStyle; } |
src/providers/wms/qgswmsprovider.cpp (working copy) | ||
---|---|---|
70 | 70 |
mUserName = ""; |
71 | 71 |
mPassword = ""; |
72 | 72 |
setAuthentication( httpuri ); |
73 | ||
73 |
mSLDURL=""; |
|
74 |
mSLDBody=""; |
|
74 | 75 |
QgsDebugMsg( "QgsWmsProvider: constructing with uri '" + httpuri + "'." ); |
75 | 76 | |
76 | 77 |
// assume this is a valid layer until we determine otherwise |
... | ... | |
288 | 289 |
return imageMimeType; |
289 | 290 |
} |
290 | 291 | |
292 |
void QgsWmsProvider::setSLDURL( QString const & sldURL ) |
|
293 |
{ |
|
294 |
mSLDURL=sldURL; |
|
295 |
} |
|
291 | 296 | |
297 |
QString QgsWmsProvider::sldURL() |
|
298 |
{ |
|
299 |
return mSLDURL; |
|
300 |
} |
|
301 | ||
302 |
void QgsWmsProvider::setSLDBody( QString const & sldBody ) |
|
303 |
{ |
|
304 |
mSLDBody=sldBody.trimmed(); |
|
305 |
//encode the url |
|
306 |
QUrl myUrl; |
|
307 |
myUrl.addQueryItem("sld_body",mSLDBody); |
|
308 |
QString mySLD_Body(myUrl.encodedQueryItemValue("sld_body")); |
|
309 |
mSLDBody=mySLD_Body; |
|
310 |
} |
|
311 | ||
312 |
QString QgsWmsProvider::sldBody() |
|
313 |
{ |
|
314 |
QUrl myUrl; |
|
315 |
myUrl.addEncodedQueryItem("sld_body",mSLDBody.toLocal8Bit()); |
|
316 |
QString mySLD_Body(myUrl.queryItemValue("sld_body")); |
|
317 |
return mySLD_Body; |
|
318 |
} |
|
319 | ||
320 | ||
292 | 321 |
void QgsWmsProvider::setImageEncoding( QString const & mimeType ) |
293 | 322 |
{ |
294 | 323 |
QgsDebugMsg( "Setting image encoding to " + mimeType + "." ); |
... | ... | |
454 | 483 |
url += "&"; |
455 | 484 |
url += "FORMAT=" + imageMimeType; |
456 | 485 | |
486 |
//set SLD parameter |
|
487 |
if((!mSLDURL.isEmpty())&&(!mSLDURL.isNull())) |
|
488 |
{ |
|
489 |
url += "&"; |
|
490 |
url += "SLD=" + mSLDURL; |
|
491 |
} |
|
492 | ||
493 |
//set SLD Body |
|
494 |
if((!mSLDBody.isEmpty())&&(!mSLDBody.isNull())) |
|
495 |
{ |
|
496 |
url += "&"; |
|
497 |
url += "SLD_BODY=" + mSLDBody; |
|
498 |
} |
|
457 | 499 |
//DPI parameter is accepted by QGIS mapserver (and ignored by the other WMS servers) |
458 | 500 |
if(mDpi != -1) |
459 | 501 |
{ |
... | ... | |
505 | 547 |
} |
506 | 548 | |
507 | 549 |
QByteArray imagesource; |
550 |
//QUrl myUrl(url); |
|
551 |
//QString encodedUrl(myUrl.toEncoded()); |
|
552 |
|
|
553 |
QgsDebugMsg( "Retrieving image with url : "+url); |
|
508 | 554 |
imagesource = retrieveUrl( url ); |
509 | 555 | |
510 | 556 |
if ( imagesource.isEmpty() ) |
src/providers/wms/qgswmsprovider.h (working copy) | ||
---|---|---|
416 | 416 |
void setImageEncoding( QString const & mimeType ); |
417 | 417 | |
418 | 418 |
/** |
419 |
* Set the url for sld document |
|
420 |
* added in qgis 1.2 |
|
421 |
*/ |
|
422 |
void setSLDURL( QString const & sldURL ); |
|
423 | ||
424 |
/** |
|
425 |
* Retrieves the sld url |
|
426 |
* added in qgis 1.2 |
|
427 |
*/ |
|
428 |
QString sldURL(); |
|
429 |
|
|
430 |
/** |
|
431 |
* Set the sld body |
|
432 |
* added in qgis 1.2 |
|
433 |
*/ |
|
434 |
|
|
435 |
void setSLDBody( QString const & sldBody ); |
|
436 | ||
437 |
/** |
|
438 |
* Retrieves the sld body |
|
439 |
* added in qgis 1.2 |
|
440 |
*/ |
|
441 |
QString sldBody(); |
|
442 | ||
443 |
/** |
|
419 | 444 |
* Set the image projection (in WMS CRS format) used in the transfer from the WMS server |
420 | 445 |
* |
421 | 446 |
* \note an empty crs value will result in the previous CRS being retained. |
... | ... | |
849 | 874 |
//! Password for basic http authentication |
850 | 875 |
QString mPassword; |
851 | 876 | |
877 |
//! Url pointing to remote sld document |
|
878 |
QString mSLDURL; |
|
879 | ||
880 |
//! Inline SLD |
|
881 |
QString mSLDBody; |
|
882 | ||
852 | 883 |
}; |
853 | 884 | |
854 | 885 |
#endif |
src/ui/qgsrasterlayerpropertiesbase.ui (working copy) | ||
---|---|---|
27 | 27 |
<item row="0" column="0" colspan="4" > |
28 | 28 |
<widget class="QTabWidget" name="tabBar" > |
29 | 29 |
<property name="currentIndex" > |
30 |
<number>0</number>
|
|
30 |
<number>7</number>
|
|
31 | 31 |
</property> |
32 | 32 |
<widget class="QWidget" name="tabPageSymbology" > |
33 | 33 |
<attribute name="title" > |
... | ... | |
1472 | 1472 |
</property> |
1473 | 1473 |
<item row="0" column="1" > |
1474 | 1474 |
<widget class="QPushButton" name="pbnChangeSpatialRefSys" > |
1475 |
<property name="toolTip"> |
|
1475 |
<property name="toolTip" >
|
|
1476 | 1476 |
<string>Specify the coordinate reference system of the layer's geometry.</string> |
1477 | 1477 |
</property> |
1478 |
<property name="whatsThis"> |
|
1478 |
<property name="whatsThis" >
|
|
1479 | 1479 |
<string>Specify the coordinate reference system of the layer's geometry.</string> |
1480 | 1480 |
</property> |
1481 | 1481 |
<property name="text" > |
... | ... | |
1676 | 1676 |
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> |
1677 | 1677 |
<html><head><meta name="qrichtext" content="1" /><style type="text/css"> |
1678 | 1678 |
p, li { white-space: pre-wrap; } |
1679 |
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
|
1680 |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"></p></body></html></string> |
|
1679 |
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
|
1680 |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p></body></html></string>
|
|
1681 | 1681 |
</property> |
1682 | 1682 |
</widget> |
1683 | 1683 |
</item> |
... | ... | |
1903 | 1903 |
</item> |
1904 | 1904 |
</layout> |
1905 | 1905 |
</widget> |
1906 |
<widget class="QWidget" name="tabSLD" > |
|
1907 |
<attribute name="title" > |
|
1908 |
<string>SLD</string> |
|
1909 |
</attribute> |
|
1910 |
<layout class="QGridLayout" name="gridLayout_2" > |
|
1911 |
<item row="0" column="0" > |
|
1912 |
<layout class="QGridLayout" name="gridLayout" > |
|
1913 |
<item row="0" column="0" > |
|
1914 |
<widget class="QLabel" name="label_6" > |
|
1915 |
<property name="text" > |
|
1916 |
<string>Style Layer Descriptor URL :</string> |
|
1917 |
</property> |
|
1918 |
</widget> |
|
1919 |
</item> |
|
1920 |
<item row="0" column="1" > |
|
1921 |
<widget class="QLineEdit" name="sldURLEdit" /> |
|
1922 |
</item> |
|
1923 |
<item row="1" column="0" colspan="2" > |
|
1924 |
<widget class="QLabel" name="label_7" > |
|
1925 |
<property name="text" > |
|
1926 |
<string>Style Layer Descriptor Body :</string> |
|
1927 |
</property> |
|
1928 |
</widget> |
|
1929 |
</item> |
|
1930 |
<item row="2" column="0" colspan="2" > |
|
1931 |
<widget class="QPlainTextEdit" name="sldBodyText" /> |
|
1932 |
</item> |
|
1933 |
</layout> |
|
1934 |
</item> |
|
1935 |
</layout> |
|
1936 |
</widget> |
|
1906 | 1937 |
</widget> |
1907 | 1938 |
</item> |
1908 | 1939 |
<item row="1" column="0" > |
src/ui/qgsserversourceselectbase.ui (working copy) | ||
---|---|---|
6 | 6 |
<x>0</x> |
7 | 7 |
<y>0</y> |
8 | 8 |
<width>600</width> |
9 |
<height>481</height>
|
|
9 |
<height>630</height>
|
|
10 | 10 |
</rect> |
11 | 11 |
</property> |
12 | 12 |
<property name="windowTitle" > |
... | ... | |
23 | 23 |
<property name="modal" > |
24 | 24 |
<bool>true</bool> |
25 | 25 |
</property> |
26 |
<layout class="QGridLayout" > |
|
26 |
<layout class="QGridLayout" name="gridLayout_2" >
|
|
27 | 27 |
<item row="0" column="0" colspan="4" > |
28 | 28 |
<widget class="QTabWidget" name="tabWidget" > |
29 | 29 |
<property name="currentIndex" > |
... | ... | |
254 | 254 |
</widget> |
255 | 255 |
</item> |
256 | 256 |
<item row="1" column="0" colspan="4" > |
257 |
<widget class="QGroupBox" name="groupBox" > |
|
258 |
<property name="minimumSize" > |
|
259 |
<size> |
|
260 |
<width>581</width> |
|
261 |
<height>141</height> |
|
262 |
</size> |
|
263 |
</property> |
|
264 |
<property name="title" > |
|
265 |
<string>Style Layer Descriptor</string> |
|
266 |
</property> |
|
267 |
<widget class="QLineEdit" name="sldUrlText" > |
|
268 |
<property name="geometry" > |
|
269 |
<rect> |
|
270 |
<x>60</x> |
|
271 |
<y>20</y> |
|
272 |
<width>511</width> |
|
273 |
<height>20</height> |
|
274 |
</rect> |
|
275 |
</property> |
|
276 |
</widget> |
|
277 |
<widget class="QTextEdit" name="sldBodyEdit" > |
|
278 |
<property name="geometry" > |
|
279 |
<rect> |
|
280 |
<x>60</x> |
|
281 |
<y>50</y> |
|
282 |
<width>511</width> |
|
283 |
<height>81</height> |
|
284 |
</rect> |
|
285 |
</property> |
|
286 |
</widget> |
|
287 |
<widget class="QLabel" name="label" > |
|
288 |
<property name="geometry" > |
|
289 |
<rect> |
|
290 |
<x>10</x> |
|
291 |
<y>20</y> |
|
292 |
<width>46</width> |
|
293 |
<height>14</height> |
|
294 |
</rect> |
|
295 |
</property> |
|
296 |
<property name="text" > |
|
297 |
<string>URL :</string> |
|
298 |
</property> |
|
299 |
</widget> |
|
300 |
<widget class="QLabel" name="label_2" > |
|
301 |
<property name="geometry" > |
|
302 |
<rect> |
|
303 |
<x>10</x> |
|
304 |
<y>50</y> |
|
305 |
<width>46</width> |
|
306 |
<height>14</height> |
|
307 |
</rect> |
|
308 |
</property> |
|
309 |
<property name="text" > |
|
310 |
<string>Body :</string> |
|
311 |
</property> |
|
312 |
</widget> |
|
313 |
</widget> |
|
314 |
</item> |
|
315 |
<item row="2" column="0" colspan="4" > |
|
257 | 316 |
<widget class="QGroupBox" name="btnGrpImageEncoding" > |
258 | 317 |
<property name="sizePolicy" > |
259 | 318 |
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" > |
... | ... | |
272 | 331 |
</property> |
273 | 332 |
</widget> |
274 | 333 |
</item> |
275 |
<item row="2" column="0" colspan="4" >
|
|
334 |
<item row="3" column="0" colspan="4" >
|
|
276 | 335 |
<widget class="QGroupBox" name="gbCRS" > |
277 | 336 |
<property name="title" > |
278 | 337 |
<string>Coordinate Reference System</string> |
... | ... | |
314 | 373 |
</layout> |
315 | 374 |
</widget> |
316 | 375 |
</item> |
317 |
<item row="3" column="0" >
|
|
376 |
<item row="4" column="0" >
|
|
318 | 377 |
<widget class="QPushButton" name="btnHelp" > |
319 | 378 |
<property name="enabled" > |
320 | 379 |
<bool>true</bool> |
... | ... | |
330 | 389 |
</property> |
331 | 390 |
</widget> |
332 | 391 |
</item> |
333 |
<item row="3" column="1" >
|
|
392 |
<item row="4" column="1" >
|
|
334 | 393 |
<spacer> |
335 | 394 |
<property name="orientation" > |
336 | 395 |
<enum>Qt::Horizontal</enum> |
... | ... | |
346 | 405 |
</property> |
347 | 406 |
</spacer> |
348 | 407 |
</item> |
349 |
<item row="3" column="2" >
|
|
408 |
<item row="4" column="2" >
|
|
350 | 409 |
<widget class="QPushButton" name="btnAdd" > |
351 | 410 |
<property name="enabled" > |
352 | 411 |
<bool>false</bool> |
... | ... | |
365 | 424 |
</property> |
366 | 425 |
</widget> |
367 | 426 |
</item> |
368 |
<item row="3" column="3" >
|
|
427 |
<item row="4" column="3" >
|
|
369 | 428 |
<widget class="QPushButton" name="btnCancel" > |
370 | 429 |
<property name="text" > |
371 | 430 |
<string>C&lose</string> |
... | ... | |
378 | 437 |
</property> |
379 | 438 |
</widget> |
380 | 439 |
</item> |
381 |
<item row="4" column="0" colspan="4" >
|
|
440 |
<item row="5" column="0" colspan="4" >
|
|
382 | 441 |
<widget class="QLabel" name="labelStatus" > |
383 | 442 |
<property name="sizePolicy" > |
384 | 443 |
<sizepolicy vsizetype="Preferred" hsizetype="Ignored" > |