QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgswmsparameters.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgswmsparameters.cpp
3  --------------------
4  begin : March 17, 2017
5  copyright : (C) 2017 by Paul Blottiere
6  email : paul dot blottiere at oslandia dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "qgswmsparameters.h"
19 #include "qgsdatasourceuri.h"
21 #include "qgsmessagelog.h"
22 #include "qgswmsserviceexception.h"
23 
24 const QString EXTERNAL_LAYER_PREFIX = QStringLiteral( "EXTERNAL_WMS:" );
25 
26 namespace QgsWms
27 {
28  //
29  // QgsWmsParameter
30  //
32  const QVariant::Type type,
33  const QVariant defaultValue )
34  : QgsServerParameterDefinition( type, defaultValue )
35  , mName( name )
36  {
37  }
38 
40  {
42  }
43 
45  {
46  const QString msg = QString( "%1 ('%2') cannot be converted into %3" ).arg( name( mName ), toString(), typeName() );
48  }
49 
50  QStringList QgsWmsParameter::toStyleList( const char delimiter ) const
51  {
52  return QgsServerParameterDefinition::toStringList( delimiter, false );
53  }
54 
55  QList<QgsGeometry> QgsWmsParameter::toGeomList( const char delimiter ) const
56  {
57  bool ok = true;
58  const QList<QgsGeometry> geoms = QgsServerParameterDefinition::toGeomList( ok, delimiter );
59 
60  if ( !ok )
61  {
62  const QString msg = QString( "%1 ('%2') cannot be converted into a list of geometries" ).arg( name( mName ), toString() );
64  }
65 
66  return geoms;
67  }
68 
70  {
71  bool ok = true;
73 
74  if ( !ok )
75  {
76  const QString msg = QString( "%1 ('%2') cannot be converted into a rectangle" ).arg( name( mName ), toString() );
78  }
79 
80  return rect;
81  }
82 
84  {
85  bool ok = false;
86  const int val = QgsServerParameterDefinition::toInt( ok );
87 
88  if ( !ok )
89  {
90  raiseError();
91  }
92 
93  return val;
94  }
95 
96  QString QgsWmsParameter::loadUrl() const
97  {
98  // Check URL -- it will be used in error messages
99  const QUrl url = toUrl();
100 
101  bool ok = false;
102  const QString content = QgsServerParameterDefinition::loadUrl( ok );
103 
104  if ( !ok )
105  {
106  const QString msg = QString( "%1 request error for %2" ).arg( name( mName ), url.toString() );
108  }
109 
110  return content;
111  }
112 
114  {
115  bool ok = false;
116  const QUrl url = QgsServerParameterDefinition::toUrl( ok );
117 
118  if ( !ok )
119  {
120  raiseError();
121  }
122 
123  return url;
124  }
125 
127  {
128  bool ok = false;
129  const QColor col = QgsServerParameterDefinition::toColor( ok );
130 
131  if ( !ok )
132  {
133  raiseError();
134  }
135 
136  return col;
137  }
138 
139  QList<QColor> QgsWmsParameter::toColorList( const char delimiter ) const
140  {
141  bool ok = false;
142  const QList<QColor> vals = QgsServerParameterDefinition::toColorList( ok, delimiter );
143 
144  if ( !ok )
145  {
146  const QString msg = QString( "%1 ('%2') cannot be converted into a list of colors" ).arg( name( mName ), toString() );
148  }
149 
150  return vals;
151  }
152 
153  QList<int> QgsWmsParameter::toIntList( const char delimiter ) const
154  {
155  bool ok = false;
156  const QList<int> vals = QgsServerParameterDefinition::toIntList( ok, delimiter );
157 
158  if ( !ok )
159  {
160  const QString msg = QString( "%1 ('%2') cannot be converted into a list of int" ).arg( name( mName ), toString() );
162  }
163 
164  return vals;
165  }
166 
167  QList<double> QgsWmsParameter::toDoubleList( const char delimiter ) const
168  {
169  bool ok = false;
170  const QList<double> vals = QgsServerParameterDefinition::toDoubleList( ok, delimiter );
171 
172  if ( !ok )
173  {
174  const QString msg = QString( "%1 ('%2') cannot be converted into a list of float" ).arg( name( mName ), toString() );
176  }
177 
178  return vals;
179  }
180 
182  {
183  bool ok = false;
184  const double val = QgsServerParameterDefinition::toDouble( ok );
185 
186  if ( !ok )
187  {
188  raiseError();
189  }
190 
191  return val;
192  }
193 
194  QString QgsWmsParameter::name() const
195  {
196  return QgsWmsParameter::name( mName );
197  }
198 
200  {
201  const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameter::Name>() );
202  return metaEnum.valueToKey( name );
203  }
204 
206  {
207  const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameter::Name>() );
208  return ( QgsWmsParameter::Name ) metaEnum.keyToValue( name.toUpper().toStdString().c_str() );
209  }
210 
211  //
212  // QgsWmsParameters
213  //
216  {
217  // Available version number
218  mVersions.append( QgsProjectVersion( 1, 1, 1 ) );
219  mVersions.append( QgsProjectVersion( 1, 3, 0 ) );
220 
221  // WMS parameters definition
223  QVariant::Int,
224  QVariant( 0 ) );
225  save( pQuality );
226 
228  QVariant::Bool,
229  QVariant( false ) );
230  save( pTiled );
231 
233  QVariant::Double,
234  QVariant( 2.0 ) );
235  save( pBoxSpace );
236 
238  QVariant::Double,
239  QVariant( 2.0 ) );
240  save( pSymbSpace );
241 
242  const QgsWmsParameter pLayerSpace( QgsWmsParameter::LAYERSPACE,
243  QVariant::Double,
244  QVariant( 3.0 ) );
245  save( pLayerSpace );
246 
248  QVariant::Double,
249  QVariant( 3.0 ) );
250  save( pTitleSpace );
251 
253  QVariant::Double,
254  QVariant( 4.0 ) );
255  save( pSymbHeight );
256 
258  QVariant::Double,
259  QVariant( 7.0 ) );
260  save( pSymbWidth );
261 
263  QVariant::Double,
264  QVariant( 2.0 ) );
265  save( pIcLabelSpace );
266 
267  const QgsWmsParameter pItFontFamily( QgsWmsParameter::ITEMFONTFAMILY );
268  save( pItFontFamily );
269 
271  QVariant::Bool,
272  QVariant( false ) );
273  save( pItFontBold );
274 
276  QVariant::Bool,
277  QVariant( false ) );
278  save( pItFontItalic );
279 
281  QVariant::Double,
282  QVariant( -1 ) );
283  save( pItFontSize );
284 
286  QVariant::String,
287  QVariant( "black" ) );
288  save( pItFontColor );
289 
290  const QgsWmsParameter pHighlightGeom( QgsWmsParameter::HIGHLIGHT_GEOM );
291  save( pHighlightGeom );
292 
293  const QgsWmsParameter pShowFeatureCount( QgsWmsParameter::SHOWFEATURECOUNT,
294  QVariant::Bool,
295  QVariant( false ) );
296  save( pShowFeatureCount );
297 
298  const QgsWmsParameter pHighlightSymbol( QgsWmsParameter::HIGHLIGHT_SYMBOL );
299  save( pHighlightSymbol );
300 
302  save( pHighlightLabel );
303 
305  QVariant::String,
306  QVariant( "black" ) );
307  save( pHighlightColor );
308 
309  const QgsWmsParameter pHighlightFontSize( QgsWmsParameter::HIGHLIGHT_LABELSIZE );
310  save( pHighlightFontSize );
311 
312  const QgsWmsParameter pHighlightFontWeight( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT );
313  save( pHighlightFontWeight );
314 
316  save( pHighlightFont );
317 
319  QVariant::String,
320  QVariant( "black" ) );
321  save( pHighlightBufferColor );
322 
323  const QgsWmsParameter pHighlightBufferSize( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE );
324  save( pHighlightBufferSize );
325 
327  save( pCRS );
328 
330  save( pSRS );
331 
333  QVariant::String,
334  QVariant( "png" ) );
335  save( pFormat );
336 
337  const QgsWmsParameter pInfoFormat( QgsWmsParameter::INFO_FORMAT );
338  save( pInfoFormat );
339 
341  QVariant::Int,
342  QVariant( -1 ) );
343  save( pI );
344 
346  QVariant::Int,
347  QVariant( -1 ) );
348  save( pJ );
349 
351  QVariant::Int,
352  QVariant( -1 ) );
353  save( pX );
354 
356  QVariant::Int,
357  QVariant( -1 ) );
358  save( pY );
359 
360  const QgsWmsParameter pRule( QgsWmsParameter::RULE );
361  save( pRule );
362 
364  QVariant::Bool,
365  QVariant( true ) );
366  save( pRuleLabel );
367 
369  QVariant::Double,
370  QVariant( -1 ) );
371  save( pScale );
372 
374  QVariant::Int,
375  QVariant( 0 ) );
376  save( pHeight );
377 
379  QVariant::Int,
380  QVariant( 0 ) );
381  save( pWidth );
382 
384  QVariant::Int,
385  QVariant( 0 ) );
386  save( pSrcHeight );
387 
389  QVariant::Int,
390  QVariant( 0 ) );
391  save( pSrcWidth );
392 
393  const QgsWmsParameter pBbox( QgsWmsParameter::BBOX );
394  save( pBbox );
395 
397  save( pSld );
398 
399  const QgsWmsParameter pSldBody( QgsWmsParameter::SLD_BODY );
400  save( pSldBody );
401 
402  const QgsWmsParameter pLayer( QgsWmsParameter::LAYER );
403  save( pLayer );
404 
405  const QgsWmsParameter pLayers( QgsWmsParameter::LAYERS );
406  save( pLayers );
407 
408  const QgsWmsParameter pQueryLayers( QgsWmsParameter::QUERY_LAYERS );
409  save( pQueryLayers );
410 
411  const QgsWmsParameter pFeatureCount( QgsWmsParameter::FEATURE_COUNT,
412  QVariant::Int,
413  QVariant( 1 ) );
414  save( pFeatureCount );
415 
416  const QgsWmsParameter pLayerTitle( QgsWmsParameter::LAYERTITLE,
417  QVariant::Bool,
418  QVariant( true ) );
419  save( pLayerTitle );
420 
421  const QgsWmsParameter pLayerFtFamily( QgsWmsParameter::LAYERFONTFAMILY );
422  save( pLayerFtFamily );
423 
425  QVariant::Bool,
426  QVariant( false ) );
427  save( pLayerFtBold );
428 
430  QVariant::Bool,
431  QVariant( false ) );
432  save( pLayerFtItalic );
433 
435  QVariant::Double,
436  QVariant( -1 ) );
437  save( pLayerFtSize );
438 
440  QVariant::String,
441  QVariant( "black" ) );
442  save( pLayerFtColor );
443 
444  const QgsWmsParameter pStyle( QgsWmsParameter::STYLE );
445  save( pStyle );
446 
447  const QgsWmsParameter pStyles( QgsWmsParameter::STYLES );
448  save( pStyles );
449 
450  const QgsWmsParameter pOpacities( QgsWmsParameter::OPACITIES );
451  save( pOpacities );
452 
453  const QgsWmsParameter pFilter( QgsWmsParameter::FILTER );
454  save( pFilter );
455 
456  const QgsWmsParameter pFilterGeom( QgsWmsParameter::FILTER_GEOM );
457  save( pFilterGeom );
458 
460  QVariant::Double,
461  QVariant( 0.0 ) );
462  save( pPolygTol );
463 
465  QVariant::Double,
466  QVariant( 0.0 ) );
467  save( pLineTol );
468 
470  QVariant::Double,
471  QVariant( 0.0 ) );
472  save( pPointTol );
473 
474  const QgsWmsParameter pSelection( QgsWmsParameter::SELECTION );
475  save( pSelection );
476 
477  const QgsWmsParameter pWmsPrecision( QgsWmsParameter::WMS_PRECISION,
478  QVariant::Int,
479  QVariant( -1 ) );
480  save( pWmsPrecision );
481 
482  const QgsWmsParameter pTransparent( QgsWmsParameter::TRANSPARENT,
483  QVariant::Bool,
484  QVariant( false ) );
485  save( pTransparent );
486 
488  QVariant::String,
489  QVariant( "white" ) );
490  save( pBgColor );
491 
493  QVariant::Int,
494  QVariant( -1 ) );
495  save( pDpi );
496 
497  const QgsWmsParameter pTemplate( QgsWmsParameter::TEMPLATE );
498  save( pTemplate );
499 
500  const QgsWmsParameter pExtent( QgsWmsParameter::EXTENT );
501  save( pExtent );
502 
504  QVariant::Double,
505  QVariant( 0.0 ) );
506  save( pRotation );
507 
509  QVariant::Double,
510  QVariant( 0.0 ) );
511  save( pGridX );
512 
514  QVariant::Double,
515  QVariant( 0.0 ) );
516  save( pGridY );
517 
518  const QgsWmsParameter pWithGeometry( QgsWmsParameter::WITH_GEOMETRY,
519  QVariant::Bool,
520  QVariant( false ) );
521  save( pWithGeometry );
522 
524  QVariant::Bool,
525  QVariant( false ) );
526  save( pWithMapTip );
527 
528  const QgsWmsParameter pWmtver( QgsWmsParameter::WMTVER );
529  save( pWmtver );
530 
532  QVariant::StringList );
533  save( pAtlasPk );
534 
536  QVariant::String );
537  save( pFormatOpts );
538  }
539 
541  : QgsWmsParameters()
542  {
543  load( parameters.urlQuery() );
544 
545  const QString sld = mWmsParameters[ QgsWmsParameter::SLD ].toString();
546  if ( !sld.isEmpty() )
547  {
548  const QString sldBody = mWmsParameters[ QgsWmsParameter::SLD ].loadUrl();
549  if ( !sldBody.isEmpty() )
550  {
552  }
553  }
554  }
555 
557  {
558  return mWmsParameters[name];
559  }
560 
561  void QgsWmsParameters::set( QgsWmsParameter::Name name, const QVariant &value )
562  {
563  mWmsParameters[name].mValue = value;
564  }
565 
566  bool QgsWmsParameters::loadParameter( const QString &key, const QString &value )
567  {
568  bool loaded = false;
569 
570  const QRegExp composerParamRegExp( QStringLiteral( "^MAP\\d+:" ), Qt::CaseInsensitive );
571  if ( key.contains( composerParamRegExp ) )
572  {
573  const int mapId = key.midRef( 3, key.indexOf( ':' ) - 3 ).toInt();
574  const QString theKey = key.mid( key.indexOf( ':' ) + 1 );
575  const QgsWmsParameter::Name name = QgsWmsParameter::name( theKey );
576 
577  if ( name >= 0 )
578  {
579  QgsWmsParameter param = mWmsParameters[name];
580  param.mValue = value;
581  param.mId = mapId;
582 
583  if ( ! param.isValid() )
584  {
585  param.raiseError();
586  }
587 
588  save( param, true ); // multi MAP parameters for composer
589  loaded = true;
590  }
591  }
592  else
593  {
594  const QgsWmsParameter::Name name = QgsWmsParameter::name( key );
595  if ( name >= 0 )
596  {
597  mWmsParameters[name].mValue = value;
598  if ( ! mWmsParameters[name].isValid() )
599  {
600  mWmsParameters[name].raiseError();
601  }
602 
603  loaded = true;
604  }
605  else //maybe an external wms parameter?
606  {
607  int separator = key.indexOf( QLatin1Char( ':' ) );
608  if ( separator >= 1 )
609  {
610  QString id = key.left( separator );
611  QString param = key.right( key.length() - separator - 1 );
612  mExternalWMSParameters[id].insert( param, value );
613 
614  loaded = true;
615  }
616  }
617  }
618 
619  return loaded;
620  }
621 
623  {
624  log( QStringLiteral( "WMS Request parameters:" ) );
625  for ( auto parameter : mWmsParameters.toStdMap() )
626  {
627  const QString value = parameter.second.toString();
628 
629  if ( ! value.isEmpty() )
630  {
631  QString name = QgsWmsParameter::name( parameter.first );
632 
633  if ( parameter.second.mId >= 0 )
634  {
635  name = QStringLiteral( "%1:%2" ).arg( QString::number( parameter.second.mId ), name );
636  }
637 
638  log( QStringLiteral( " - %1 : %2" ).arg( name, value ) );
639  }
640  }
641 
642  if ( !version().isEmpty() )
643  log( QStringLiteral( " - VERSION : %1" ).arg( version() ) );
644  }
645 
646  void QgsWmsParameters::save( const QgsWmsParameter &parameter, bool multi )
647  {
648  if ( multi )
649  {
650  mWmsParameters.insertMulti( parameter.mName, parameter );
651  }
652  else
653  {
654  mWmsParameters[ parameter.mName ] = parameter;
655  }
656  }
657 
659  {
660  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_GEOM ].toStringList( ';' );
661  }
662 
663  QList<QgsGeometry> QgsWmsParameters::highlightGeomAsGeom() const
664  {
665  return mWmsParameters[QgsWmsParameter::HIGHLIGHT_GEOM].toGeomList( ';' );
666  }
667 
669  {
670  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_SYMBOL ].toStringList( ';' );
671  }
672 
673  QString QgsWmsParameters::crs() const
674  {
675  QString rs;
676  const QString srs = mWmsParameters[ QgsWmsParameter::SRS ].toString();
677  const QString crs = mWmsParameters[ QgsWmsParameter::CRS ].toString();
678 
679  // both SRS/CRS are supported but there's a priority according to the
680  // specified version when both are defined in the request
681  if ( !srs.isEmpty() && crs.isEmpty() )
682  rs = srs;
683  else if ( srs.isEmpty() && !crs.isEmpty() )
684  rs = crs;
685  else if ( !srs.isEmpty() && !crs.isEmpty() )
686  {
687  if ( versionAsNumber() >= QgsProjectVersion( 1, 3, 0 ) )
688  rs = crs;
689  else
690  rs = srs;
691  }
692 
693  return rs;
694  }
695 
696  QString QgsWmsParameters::bbox() const
697  {
698  return mWmsParameters[ QgsWmsParameter::BBOX ].toString();
699  }
700 
702  {
703  return mWmsParameters[ QgsWmsParameter::BBOX ].toRectangle();
704  }
705 
706  QString QgsWmsParameters::height() const
707  {
708  return mWmsParameters[ QgsWmsParameter::HEIGHT ].toString();
709  }
710 
711  QString QgsWmsParameters::width() const
712  {
713  return mWmsParameters[ QgsWmsParameter::WIDTH ].toString();
714  }
715 
717  {
718  return mWmsParameters[ QgsWmsParameter::HEIGHT ].toInt();
719  }
720 
722  {
723  return mWmsParameters[ QgsWmsParameter::WIDTH ].toInt();
724  }
725 
727  {
728  return mWmsParameters[ QgsWmsParameter::SRCHEIGHT ].toString();
729  }
730 
732  {
733  return mWmsParameters[ QgsWmsParameter::SRCWIDTH ].toString();
734  }
735 
737  {
738  return mWmsParameters[ QgsWmsParameter::SRCHEIGHT ].toInt();
739  }
740 
742  {
743  return mWmsParameters[ QgsWmsParameter::SRCWIDTH ].toInt();
744  }
745 
746  QString QgsWmsParameters::dpi() const
747  {
748  return mWmsParameters[ QgsWmsParameter::DPI ].toString();
749  }
750 
752  {
753  return mWmsParameters[ QgsWmsParameter::DPI ].toDouble();
754  }
755 
757  {
758  const QString vStr = version();
759 
761 
762  if ( vStr.isEmpty() )
763  {
764  version = QgsProjectVersion( 1, 3, 0 ); // default value
765  }
766  else if ( mVersions.contains( QgsProjectVersion( vStr ) ) )
767  {
768  version = QgsProjectVersion( vStr );
769  }
770 
771  return version;
772  }
773 
774  bool QgsWmsParameters::versionIsValid( const QString version ) const
775  {
776  return mVersions.contains( QgsProjectVersion( version ) );
777  }
778 
780  {
781  return mWmsParameters[ QgsWmsParameter::FORMAT ].toString( true );
782  }
783 
785  {
786  const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameters::Format>() );
787  return metaEnum.valueToKey( format );
788  }
789 
791  {
792  const QString fStr = formatAsString();
793 
794  Format f = Format::NONE;
795  if ( fStr.compare( QLatin1String( "image/png" ), Qt::CaseInsensitive ) == 0 ||
796  fStr.compare( QLatin1String( "png" ), Qt::CaseInsensitive ) == 0 )
797  {
798  f = Format::PNG;
799  }
800  else if ( fStr.compare( QLatin1String( "jpg" ), Qt::CaseInsensitive ) == 0
801  || fStr.compare( QLatin1String( "jpeg" ), Qt::CaseInsensitive ) == 0
802  || fStr.compare( QLatin1String( "image/jpeg" ), Qt::CaseInsensitive ) == 0 )
803  {
804  f = Format::JPG;
805  }
806  else if ( fStr.compare( QLatin1String( "image/svg" ), Qt::CaseInsensitive ) == 0 ||
807  fStr.compare( QLatin1String( "image/svg+xml" ), Qt::CaseInsensitive ) == 0 ||
808  fStr.compare( QLatin1String( "svg" ), Qt::CaseInsensitive ) == 0 )
809  {
810  f = Format::SVG;
811  }
812  else if ( fStr.compare( QLatin1String( "application/pdf" ), Qt::CaseInsensitive ) == 0 ||
813  fStr.compare( QLatin1String( "pdf" ), Qt::CaseInsensitive ) == 0 )
814  {
815  f = Format::PDF;
816  }
817  else if ( fStr.compare( QLatin1String( "application/json" ), Qt::CaseInsensitive ) == 0 ||
818  fStr.compare( QLatin1String( "json" ), Qt::CaseInsensitive ) == 0 )
819  {
820  f = Format::JSON;
821  }
822  return f;
823  }
824 
826  {
827  return mWmsParameters[ QgsWmsParameter::INFO_FORMAT ].toString();
828  }
829 
831  {
832  return infoFormat() == Format::PNG || infoFormat() == Format::JPG;
833  }
834 
836  {
837  QString fStr = infoFormatAsString();
838 
839  Format f = Format::TEXT;
840  if ( fStr.isEmpty() )
841  return f;
842 
843  if ( fStr.startsWith( QLatin1String( "text/xml" ), Qt::CaseInsensitive ) )
844  f = Format::XML;
845  else if ( fStr.startsWith( QLatin1String( "text/html" ), Qt::CaseInsensitive ) )
846  f = Format::HTML;
847  else if ( fStr.startsWith( QLatin1String( "text/plain" ), Qt::CaseInsensitive ) )
848  f = Format::TEXT;
849  else if ( fStr.startsWith( QLatin1String( "application/vnd.ogc.gml" ), Qt::CaseInsensitive ) )
850  f = Format::GML;
851  else if ( fStr.startsWith( QLatin1String( "application/json" ), Qt::CaseInsensitive )
852  || fStr.startsWith( QLatin1String( "application/geo+json" ), Qt::CaseInsensitive ) )
853  f = Format::JSON;
854  else
855  f = Format::NONE;
856 
857  return f;
858  }
859 
861  {
862  if ( infoFormat() != Format::GML )
863  return -1;
864 
865  QString fStr = infoFormatAsString();
866  if ( fStr.startsWith( QLatin1String( "application/vnd.ogc.gml/3" ), Qt::CaseInsensitive ) )
867  return 3;
868  else
869  return 2;
870  }
871 
872  QString QgsWmsParameters::i() const
873  {
874  return mWmsParameters[ QgsWmsParameter::I ].toString();
875  }
876 
877  QString QgsWmsParameters::j() const
878  {
879  return mWmsParameters[ QgsWmsParameter::J ].toString();
880  }
881 
883  {
884  return mWmsParameters[ QgsWmsParameter::I ].toInt();
885  }
886 
888  {
889  return mWmsParameters[ QgsWmsParameter::J ].toInt();
890  }
891 
892  QString QgsWmsParameters::x() const
893  {
894  return mWmsParameters[ QgsWmsParameter::X ].toString();
895  }
896 
897  QString QgsWmsParameters::y() const
898  {
899  return mWmsParameters[ QgsWmsParameter::Y ].toString();
900  }
901 
903  {
904  return mWmsParameters[ QgsWmsParameter::X ].toInt();
905  }
906 
908  {
909  return mWmsParameters[ QgsWmsParameter::Y ].toInt();
910  }
911 
912  QString QgsWmsParameters::rule() const
913  {
914  return mWmsParameters[ QgsWmsParameter::RULE ].toString();
915  }
916 
918  {
919  return mWmsParameters[ QgsWmsParameter::RULELABEL ].toString();
920  }
921 
923  {
924  return mWmsParameters[ QgsWmsParameter::RULELABEL ].toBool();
925  }
926 
928  {
929  return mWmsParameters[ QgsWmsParameter::TRANSPARENT ].toString();
930  }
931 
933  {
934  return mWmsParameters[ QgsWmsParameter::TRANSPARENT ].toBool();
935  }
936 
937  QString QgsWmsParameters::scale() const
938  {
939  return mWmsParameters[ QgsWmsParameter::SCALE ].toString();
940  }
941 
943  {
944  return mWmsParameters[ QgsWmsParameter::SCALE ].toDouble();
945  }
946 
948  {
949  return mWmsParameters[ QgsWmsParameter::IMAGE_QUALITY ].toString();
950  }
951 
953  {
954  return mWmsParameters[ QgsWmsParameter::IMAGE_QUALITY ].toInt();
955  }
956 
957  QString QgsWmsParameters::tiled() const
958  {
959  return mWmsParameters[ QgsWmsParameter::TILED ].toString();
960  }
961 
963  {
964  return mWmsParameters[ QgsWmsParameter::TILED ].toBool();
965  }
966 
968  {
969  return mWmsParameters[ QgsWmsParameter::SHOWFEATURECOUNT ].toString();
970  }
971 
973  {
974  return mWmsParameters[ QgsWmsParameter::SHOWFEATURECOUNT ].toBool();
975  }
976 
978  {
979  return mWmsParameters[ QgsWmsParameter::FEATURE_COUNT ].toString();
980  }
981 
983  {
984  return mWmsParameters[ QgsWmsParameter::FEATURE_COUNT ].toInt();
985  }
986 
988  {
989  return mWmsParameters[ QgsWmsParameter::BOXSPACE ].toString();
990  }
991 
993  {
994  return mWmsParameters[ QgsWmsParameter::BOXSPACE ].toDouble();
995  }
996 
998  {
999  return mWmsParameters[ QgsWmsParameter::LAYERSPACE ].toString();
1000  }
1001 
1003  {
1004  return mWmsParameters[ QgsWmsParameter::LAYERSPACE ].toDouble();
1005  }
1006 
1008  {
1009  return mWmsParameters[ QgsWmsParameter::LAYERTITLESPACE ].toString();
1010  }
1011 
1013  {
1014  return mWmsParameters[ QgsWmsParameter::LAYERTITLESPACE ].toDouble();
1015  }
1016 
1018  {
1019  return mWmsParameters[ QgsWmsParameter::SYMBOLSPACE ].toString();
1020  }
1021 
1023  {
1024  return mWmsParameters[ QgsWmsParameter::SYMBOLSPACE ].toDouble();
1025  }
1026 
1028  {
1029  return mWmsParameters[ QgsWmsParameter::SYMBOLHEIGHT ].toString();
1030  }
1031 
1033  {
1034  return mWmsParameters[ QgsWmsParameter::SYMBOLHEIGHT ].toDouble();
1035  }
1036 
1038  {
1039  return mWmsParameters[ QgsWmsParameter::SYMBOLWIDTH ].toString();
1040  }
1041 
1043  {
1044  return mWmsParameters[ QgsWmsParameter::SYMBOLWIDTH ].toDouble();
1045  }
1046 
1048  {
1049  return mWmsParameters[ QgsWmsParameter::ICONLABELSPACE ].toString();
1050  }
1051 
1053  {
1054  return mWmsParameters[ QgsWmsParameter::ICONLABELSPACE ].toDouble();
1055  }
1056 
1058  {
1059  return mWmsParameters[ QgsWmsParameter::LAYERFONTFAMILY ].toString();
1060  }
1061 
1063  {
1064  return mWmsParameters[ QgsWmsParameter::ITEMFONTFAMILY ].toString();
1065  }
1066 
1068  {
1069  return mWmsParameters[ QgsWmsParameter::LAYERFONTBOLD ].toString();
1070  }
1071 
1073  {
1074  return mWmsParameters[ QgsWmsParameter::LAYERFONTBOLD ].toBool();
1075  }
1076 
1078  {
1079  return mWmsParameters[ QgsWmsParameter::ITEMFONTBOLD ].toString();
1080  }
1081 
1083  {
1084  return mWmsParameters[ QgsWmsParameter::FI_POLYGON_TOLERANCE ].toString();
1085  }
1086 
1088  {
1089  return mWmsParameters[ QgsWmsParameter::FI_LINE_TOLERANCE ].toString();
1090  }
1091 
1093  {
1094  return mWmsParameters[ QgsWmsParameter::FI_POINT_TOLERANCE ].toString();
1095  }
1096 
1098  {
1099  return mWmsParameters[ QgsWmsParameter::FI_POLYGON_TOLERANCE ].toInt();
1100  }
1101 
1103  {
1104  return mWmsParameters[ QgsWmsParameter::FI_LINE_TOLERANCE ].toInt();
1105  }
1106 
1108  {
1109  return mWmsParameters[ QgsWmsParameter::FI_POINT_TOLERANCE ].toInt();
1110  }
1111 
1113  {
1114  return mWmsParameters[ QgsWmsParameter::ITEMFONTBOLD ].toBool();
1115  }
1116 
1118  {
1119  return mWmsParameters[ QgsWmsParameter::LAYERFONTITALIC ].toString();
1120  }
1121 
1123  {
1124  return mWmsParameters[ QgsWmsParameter::LAYERFONTITALIC ].toBool();
1125  }
1126 
1128  {
1129  return mWmsParameters[ QgsWmsParameter::ITEMFONTITALIC ].toString();
1130  }
1131 
1133  {
1134  return mWmsParameters[ QgsWmsParameter::ITEMFONTITALIC ].toBool();
1135  }
1136 
1138  {
1139  return mWmsParameters[ QgsWmsParameter::LAYERFONTSIZE ].toString();
1140  }
1141 
1143  {
1144  return mWmsParameters[ QgsWmsParameter::LAYERFONTSIZE ].toDouble();
1145  }
1146 
1148  {
1149  return mWmsParameters[ QgsWmsParameter::LAYERFONTCOLOR ].toString();
1150  }
1151 
1153  {
1154  return mWmsParameters[ QgsWmsParameter::LAYERFONTCOLOR ].toColor();
1155  }
1156 
1158  {
1159  return mWmsParameters[ QgsWmsParameter::ITEMFONTSIZE ].toString();
1160  }
1161 
1163  {
1164  return mWmsParameters[ QgsWmsParameter::ITEMFONTSIZE ].toDouble();
1165  }
1166 
1168  {
1169  return mWmsParameters[ QgsWmsParameter::ITEMFONTCOLOR ].toString();
1170  }
1171 
1173  {
1174  return mWmsParameters[ QgsWmsParameter::ITEMFONTCOLOR ].toColor();
1175  }
1176 
1178  {
1179  QFont font;
1180  font.fromString( "" );
1181  font.setBold( layerFontBoldAsBool() );
1182  font.setItalic( layerFontItalicAsBool() );
1183 
1184  if ( ! layerFontSize().isEmpty() )
1185  font.setPointSizeF( layerFontSizeAsDouble() );
1186 
1187  if ( !layerFontFamily().isEmpty() )
1188  font.setFamily( layerFontFamily() );
1189 
1190  return font;
1191  }
1192 
1194  {
1195  QFont font;
1196  font.fromString( "" );
1197 
1198  font.setBold( itemFontBoldAsBool() );
1199  font.setItalic( itemFontItalicAsBool() );
1200 
1201  if ( ! itemFontSize().isEmpty() )
1202  font.setPointSizeF( itemFontSizeAsDouble() );
1203 
1204  if ( !itemFontFamily().isEmpty() )
1205  font.setFamily( itemFontFamily() );
1206 
1207  return font;
1208  }
1209 
1211  {
1212  return mWmsParameters[ QgsWmsParameter::LAYERTITLE ].toString();
1213  }
1214 
1216  {
1217  return mWmsParameters[ QgsWmsParameter::LAYERTITLE ].toBool();
1218  }
1219 
1221  {
1222  QgsLegendSettings settings;
1223  settings.setTitle( QString() );
1224  settings.setBoxSpace( boxSpaceAsDouble() );
1225  settings.setSymbolSize( QSizeF( symbolWidthAsDouble(), symbolHeightAsDouble() ) );
1226 
1227  settings.rstyle( QgsLegendStyle::Style::Subgroup ).setMargin( QgsLegendStyle::Side::Top, layerSpaceAsDouble() );
1228  settings.rstyle( QgsLegendStyle::Style::Subgroup ).setMargin( QgsLegendStyle::Side::Bottom, layerTitleSpaceAsDouble() );
1229  settings.rstyle( QgsLegendStyle::Style::Subgroup ).setFont( layerFont() );
1230 
1231  if ( !itemFontColor().isEmpty() )
1232  {
1233  settings.setFontColor( itemFontColorAsColor() );
1234  }
1235 
1236  // Ok, this is tricky: because QgsLegendSettings's layerFontColor was added to the API after
1237  // fontColor, to fix regressions #21871 and #21870 and the previous behavior was to use fontColor
1238  // for the whole legend we need to preserve that behavior.
1239  // But, the 2.18 server parameters ITEMFONTCOLOR did not have effect on the layer titles too, so
1240  // we set explicitly layerFontColor to black if it's not overridden by LAYERFONTCOLOR argument.
1241  settings.setLayerFontColor( layerFontColor().isEmpty() ? QColor( Qt::black ) : layerFontColorAsColor() );
1242 
1243  settings.rstyle( QgsLegendStyle::Style::SymbolLabel ).setFont( itemFont() );
1244  settings.rstyle( QgsLegendStyle::Style::Symbol ).setMargin( QgsLegendStyle::Side::Top, symbolSpaceAsDouble() );
1245  settings.rstyle( QgsLegendStyle::Style::SymbolLabel ).setMargin( QgsLegendStyle::Side::Left, iconLabelSpaceAsDouble() );
1246 
1247  return settings;
1248  }
1249 
1250  QString QgsWmsParameters::layoutParameter( const QString &id, bool &ok ) const
1251  {
1252  QString label;
1253  ok = false;
1254 
1255  if ( mUnmanagedParameters.contains( id.toUpper() ) )
1256  {
1257  label = mUnmanagedParameters[id.toUpper()];
1258  ok = true;
1259  }
1260 
1261  return label;
1262  }
1263 
1264  QStringList QgsWmsParameters::atlasPk() const
1265  {
1266  return mWmsParameters[ QgsWmsParameter::ATLAS_PK ].toStringList();
1267  }
1268 
1270  {
1271  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELSTRING ].toStringList( ';' );
1272  }
1273 
1275  {
1276  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELSIZE ].toStringList( ';' );
1277  }
1278 
1280  {
1281  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELSIZE ].toIntList( ';' );
1282  }
1283 
1285  {
1286  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELCOLOR ].toStringList( ';' );
1287  }
1288 
1290  {
1291  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELCOLOR ].toColorList( ';' );
1292  }
1293 
1295  {
1296  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELWEIGHT ].toStringList( ';' );
1297  }
1298 
1300  {
1301  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELWEIGHT ].toIntList( ';' );
1302  }
1303 
1305  {
1306  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELFONT ].toStringList( ';' );
1307  }
1308 
1310  {
1311  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR ].toStringList( ';' );
1312  }
1313 
1315  {
1316  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR ].toColorList( ';' );
1317  }
1318 
1320  {
1321  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE ].toStringList( ';' );
1322  }
1323 
1325  {
1326  return mWmsParameters[ QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE ].toDoubleList( ';' );
1327  }
1328 
1330  {
1331  return mWmsParameters[ QgsWmsParameter::WMS_PRECISION ].toString();
1332  }
1333 
1335  {
1336  return mWmsParameters[ QgsWmsParameter::WMS_PRECISION ].toInt();
1337  }
1338 
1340  {
1341  return mWmsParameters[ QgsWmsParameter::SLD_BODY ].toString();
1342  }
1343 
1344  QStringList QgsWmsParameters::filters() const
1345  {
1346  const QString filter = mWmsParameters[ QgsWmsParameter::FILTER ].toString();
1347  QStringList results;
1348  int pos = 0;
1349  while ( pos < filter.size() )
1350  {
1351  if ( pos + 1 < filter.size() && filter[pos] == '(' && filter[pos + 1] == '<' )
1352  {
1353  // OGC filter on multiple layers
1354  int posEnd = filter.indexOf( "Filter>)", pos );
1355  if ( posEnd < 0 )
1356  {
1357  posEnd = filter.size();
1358  }
1359  results.append( filter.mid( pos + 1, posEnd - pos + 6 ) );
1360  pos = posEnd + 8;
1361  }
1362  else if ( pos + 1 < filter.size() && filter[pos] == '(' && filter[pos + 1] == ')' )
1363  {
1364  // empty OGC filter
1365  results.append( "" );
1366  pos += 2;
1367  }
1368  else if ( filter[pos] == '<' )
1369  {
1370  // Single OGC filter
1371  results.append( filter.mid( pos ) );
1372  break;
1373  }
1374  else
1375  {
1376  // QGIS specific filter
1377  int posEnd = filter.indexOf( ';', pos + 1 );
1378  if ( posEnd < 0 )
1379  {
1380  posEnd = filter.size();
1381  }
1382  results.append( filter.mid( pos, posEnd - pos ) );
1383  pos = posEnd + 1;
1384  }
1385  }
1386  return results;
1387  }
1388 
1390  {
1391  return mWmsParameters[ QgsWmsParameter::FILTER_GEOM ].toString();
1392  }
1393 
1394  QStringList QgsWmsParameters::selections() const
1395  {
1396  return mWmsParameters[ QgsWmsParameter::SELECTION ].toStringList( ';' );
1397  }
1398 
1399  QStringList QgsWmsParameters::opacities() const
1400  {
1401  return mWmsParameters[ QgsWmsParameter::OPACITIES ].toStringList();
1402  }
1403 
1405  {
1406  return mWmsParameters[ QgsWmsParameter::OPACITIES ].toIntList();
1407  }
1408 
1410  {
1411  QStringList layer = mWmsParameters[ QgsWmsParameter::LAYER ].toStringList();
1412  const QStringList layers = mWmsParameters[ QgsWmsParameter::LAYERS ].toStringList();
1413  return layer << layers;
1414  }
1415 
1417  {
1418  return mWmsParameters[ QgsWmsParameter::QUERY_LAYERS ].toStringList();
1419  }
1420 
1421  QStringList QgsWmsParameters::allStyles() const
1422  {
1423  QStringList style = mWmsParameters[ QgsWmsParameter::STYLE ].toStyleList();
1424  const QStringList styles = mWmsParameters[ QgsWmsParameter::STYLES ].toStyleList();
1425  return style << styles;
1426  }
1427 
1428  QMultiMap<QString, QgsWmsParametersFilter> QgsWmsParameters::layerFilters( const QStringList &layers ) const
1429  {
1430  const QString nsWfs2 = QStringLiteral( "http://www.opengis.net/fes/2.0" );
1431  const QString prefixWfs2 = QStringLiteral( "<fes:" );
1432 
1433  const QStringList rawFilters = filters();
1434  QMultiMap<QString, QgsWmsParametersFilter> filters;
1435  for ( int i = 0; i < rawFilters.size(); i++ )
1436  {
1437  const QString f = rawFilters[i];
1438  if ( f.startsWith( QLatin1Char( '<' ) ) \
1439  && f.endsWith( QLatin1String( "Filter>" ) ) \
1440  && i < layers.size() )
1441  {
1442  QgsWmsParametersFilter filter;
1443  filter.mFilter = f;
1446 
1447  if ( filter.mFilter.contains( nsWfs2 ) \
1448  || filter.mFilter.contains( prefixWfs2 ) )
1449  {
1451  }
1452 
1453  filters.insert( layers[i], filter );
1454  }
1455  else if ( !f.isEmpty() )
1456  {
1457  // filter format: "LayerName,LayerName2:filterString;LayerName3:filterString2;..."
1458  // several filters can be defined for one layer
1459  const int colonIndex = f.indexOf( ':' );
1460  if ( colonIndex != -1 )
1461  {
1462  const QString layers = f.section( ':', 0, 0 );
1463  const QString filter = f.section( ':', 1 );
1464  const QStringList layersList = layers.split( ',' );
1465  for ( const QString &layer : layersList )
1466  {
1467  QgsWmsParametersFilter parametersFilter;
1468  parametersFilter.mFilter = filter;
1469  parametersFilter.mType = QgsWmsParametersFilter::SQL;
1470  filters.insert( layer, parametersFilter );
1471  }
1472  }
1473  else
1474  {
1475  QString filterStr = mWmsParameters[ QgsWmsParameter::FILTER ].toString();
1476  raiseError( QStringLiteral( "FILTER ('" ) + filterStr + QStringLiteral( "') is not properly formatted" ) );
1477  }
1478  }
1479  }
1480  return filters;
1481  }
1482 
1484  {
1485  bool force2D = false;
1486  const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
1487 
1488  if ( options.contains( DxfFormatOption::FORCE_2D ) )
1489  {
1490  force2D = QVariant( options[ DxfFormatOption::FORCE_2D ] ).toBool();
1491  }
1492 
1493  return force2D;
1494  }
1495 
1497  {
1498  bool noMText = false;
1499  const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
1500 
1501  if ( options.contains( DxfFormatOption::NO_MTEXT ) )
1502  {
1503  noMText = QVariant( options[ DxfFormatOption::NO_MTEXT ] ).toBool();
1504  }
1505 
1506  return noMText;
1507  }
1508 
1509  QList<QgsWmsParametersLayer> QgsWmsParameters::layersParameters() const
1510  {
1511  const QStringList layers = allLayersNickname();
1512  const QStringList styles = allStyles();
1513  const QStringList selection = selections();
1514  const QList<int> opacities = opacitiesAsInt();
1515  const QMultiMap<QString, QgsWmsParametersFilter> filters = layerFilters( layers );
1516 
1517  // selection format: "LayerName:id0,id1;LayerName2:id0,id1;..."
1518  // several filters can be defined for one layer
1519  QMultiMap<QString, QString> layerSelections;
1520  for ( const QString &s : selection )
1521  {
1522  const QStringList splits = s.split( ':' );
1523  if ( splits.size() == 2 )
1524  {
1525  layerSelections.insert( splits[0], splits[1] );
1526  }
1527  else
1528  {
1529  QString selStr = mWmsParameters[ QgsWmsParameter::SELECTION ].toString();
1530  raiseError( QStringLiteral( "SELECTION ('" ) + selStr + QStringLiteral( "') is not properly formatted" ) );
1531  }
1532  }
1533 
1534  QList<QgsWmsParametersLayer> parameters;
1535  for ( int i = 0; i < layers.size(); i++ )
1536  {
1537  QString layer = layers[i];
1538 
1539  QgsWmsParametersLayer param;
1540  param.mNickname = layer;
1541 
1542  if ( isExternalLayer( layer ) )
1543  {
1544  const QgsWmsParametersExternalLayer extParam = externalLayerParameter( layer );
1545  param.mNickname = extParam.mName;
1546  param.mExternalUri = extParam.mUri;
1547  }
1548  else
1549  {
1550  if ( i < styles.count() )
1551  param.mStyle = styles[i];
1552 
1553  if ( i < opacities.count() )
1554  param.mOpacity = opacities[i];
1555 
1556  if ( filters.contains( layer ) )
1557  {
1558  auto it = filters.find( layer );
1559  while ( it != filters.end() && it.key() == layer )
1560  {
1561  param.mFilter.append( it.value() );
1562  ++it;
1563  }
1564  }
1565 
1566  if ( layerSelections.contains( layer ) )
1567  {
1568  QMultiMap<QString, QString>::const_iterator it;
1569  it = layerSelections.constFind( layer );
1570  while ( it != layerSelections.constEnd() && it.key() == layer )
1571  {
1572  param.mSelection << it.value().split( ',' );
1573  ++it;
1574  }
1575  }
1576  }
1577 
1578  parameters.append( param );
1579  }
1580 
1581  return parameters;
1582  }
1583 
1584  QList<QgsWmsParametersHighlightLayer> QgsWmsParameters::highlightLayersParameters() const
1585  {
1586  QList<QgsWmsParametersHighlightLayer> params;
1587  QList<QgsGeometry> geoms = highlightGeomAsGeom();
1588  QStringList slds = highlightSymbol();
1589  QStringList labels = highlightLabelString();
1590  QList<QColor> colors = highlightLabelColorAsColor();
1591  QList<int> sizes = highlightLabelSizeAsInt();
1592  QList<int> weights = highlightLabelWeightAsInt();
1593  QStringList fonts = highlightLabelFont();
1594  QList<QColor> bufferColors = highlightLabelBufferColorAsColor();
1595  QList<double> bufferSizes = highlightLabelBufferSizeAsFloat();
1596 
1597  int nLayers = std::min( geoms.size(), slds.size() );
1598  for ( int i = 0; i < nLayers; i++ )
1599  {
1601  param.mName = QStringLiteral( "highlight_" ) + QString::number( i );
1602  param.mGeom = geoms[i];
1603  param.mSld = slds[i];
1604 
1605  if ( i < labels.count() )
1606  param.mLabel = labels[i];
1607 
1608  if ( i < colors.count() )
1609  param.mColor = colors[i];
1610 
1611  if ( i < sizes.count() )
1612  param.mSize = sizes[i];
1613 
1614  if ( i < weights.count() )
1615  param.mWeight = weights[i];
1616 
1617  if ( i < fonts.count() )
1618  param.mFont = fonts[ i ];
1619 
1620  if ( i < bufferColors.count() )
1621  param.mBufferColor = bufferColors[i];
1622 
1623  if ( i < bufferSizes.count() )
1624  param.mBufferSize = bufferSizes[i];
1625 
1626  params.append( param );
1627  }
1628 
1629  return params;
1630  }
1631 
1632  QList<QgsWmsParametersExternalLayer> QgsWmsParameters::externalLayersParameters() const
1633  {
1634  auto notExternalLayer = []( const QString & name ) { return ! QgsWmsParameters::isExternalLayer( name ); };
1635 
1636  QList<QgsWmsParametersExternalLayer> externalLayers;
1637 
1638  QStringList layers = allLayersNickname();
1639  QStringList::iterator rit = std::remove_if( layers.begin(), layers.end(), notExternalLayer );
1640 
1641  for ( QStringList::iterator it = layers.begin(); it != rit; ++it )
1642  {
1643  externalLayers << externalLayerParameter( *it );
1644  }
1645 
1646  return externalLayers;
1647  }
1648 
1650  {
1651  return mWmsParameters[ QgsWmsParameter::BGCOLOR ].toString();
1652  }
1653 
1655  {
1656  return mWmsParameters[ QgsWmsParameter::BGCOLOR ].toColor();
1657  }
1658 
1660  {
1661  return mWmsParameters[ QgsWmsParameter::TEMPLATE ].toString();
1662  }
1663 
1665  {
1666  QgsWmsParameter wmsParam;
1668  param.mId = mapId;
1669 
1670  //map extent is mandatory
1671  QString extentStr;
1672  wmsParam = idParameter( QgsWmsParameter::EXTENT, mapId );
1673  if ( wmsParam.isValid() )
1674  {
1675  extentStr = wmsParam.toString();
1676  }
1677 
1678  if ( extentStr.isEmpty() )
1679  {
1680  return param;
1681  }
1682 
1683  QString pMapId = QStringLiteral( "MAP" ) + QString::number( mapId );
1684 
1685  wmsParam = idParameter( QgsWmsParameter::EXTENT, mapId );
1686  QgsRectangle extent;
1687  if ( wmsParam.isValid() )
1688  {
1689  extent = wmsParam.toRectangle();
1690  }
1691 
1692  if ( extent.isEmpty() )
1693  return param;
1694 
1695  param.mHasExtent = !extent.isEmpty();
1696  param.mExtent = extent;
1697 
1698  // scale
1699  wmsParam = idParameter( QgsWmsParameter::SCALE, mapId );
1700  if ( wmsParam.isValid() && !wmsParam.toString().isEmpty() )
1701  {
1702  param.mScale = wmsParam.toDouble();
1703  }
1704 
1705  // rotation
1706  wmsParam = idParameter( QgsWmsParameter::ROTATION, mapId );
1707  if ( wmsParam.isValid() && !wmsParam.toString().isEmpty() )
1708  {
1709  param.mRotation = wmsParam.toDouble();
1710  }
1711 
1712  //grid space x / y
1713  double gridx( -1 ), gridy( -1 );
1714 
1715  wmsParam = idParameter( QgsWmsParameter::GRID_INTERVAL_X, mapId );
1716  if ( wmsParam.isValid() && !wmsParam.toString().isEmpty() )
1717  {
1718  gridx = wmsParam.toDouble();
1719  }
1720 
1721  wmsParam = idParameter( QgsWmsParameter::GRID_INTERVAL_Y, mapId );
1722  if ( wmsParam.isValid() && !wmsParam.toString().isEmpty() )
1723  {
1724  gridy = wmsParam.toDouble();
1725  }
1726 
1727  if ( gridx != -1 && gridy != -1 )
1728  {
1729  param.mGridX = gridx;
1730  param.mGridY = gridy;
1731  }
1732 
1733  //layers
1734  QStringList allLayers;
1735  wmsParam = idParameter( QgsWmsParameter::LAYERS, mapId );
1736  if ( wmsParam.isValid() )
1737  {
1738  allLayers = wmsParam.toStringList();
1739  }
1740 
1741  // external layers
1742  QStringList layers;
1743  QList<QgsWmsParametersExternalLayer> eParams;
1744 
1745  for ( const auto &layer : qgis::as_const( allLayers ) )
1746  {
1747  if ( isExternalLayer( layer ) )
1748  {
1749  const QgsWmsParametersExternalLayer extParam = externalLayerParameter( layer );
1750  layers << extParam.mName;
1751  }
1752  else
1753  {
1754  layers << layer;
1755  }
1756  }
1757 
1758  QStringList styles;
1759  wmsParam = idParameter( QgsWmsParameter::STYLES, mapId );
1760  if ( wmsParam.isValid() )
1761  {
1762  styles = wmsParam.toStyleList();
1763  }
1764 
1765  QList<QgsWmsParametersLayer> lParams;
1766  for ( int i = 0; i < layers.size(); i++ )
1767  {
1768  QString layer = layers[i];
1769  QgsWmsParametersLayer lParam;
1770  lParam.mNickname = layer;
1771 
1772  if ( i < styles.count() )
1773  lParam.mStyle = styles[i];
1774 
1775  lParams.append( lParam );
1776  }
1777  param.mLayers = lParams;
1778 
1779  //highlight layers
1780  QList<QgsWmsParametersHighlightLayer> hParams;
1781 
1782  QList<QgsGeometry> geoms;
1783  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_GEOM, mapId );
1784  if ( wmsParam.isValid() )
1785  {
1786  geoms = wmsParam.toGeomList( ';' );
1787  }
1788 
1789  QStringList slds;
1790  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_SYMBOL, mapId );
1791  if ( wmsParam.isValid() )
1792  {
1793  slds = wmsParam.toStringList( ';' );
1794  }
1795 
1796  QStringList labels;
1797  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELSTRING, mapId );
1798  if ( wmsParam.isValid() )
1799  {
1800  labels = wmsParam.toStringList( ';' );
1801  }
1802 
1803  QStringList fonts;
1804  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELFONT, mapId );
1805  if ( wmsParam.isValid() )
1806  {
1807  fonts = wmsParam.toStringList( ';' );
1808  }
1809 
1810  QList<QColor> colors;
1811  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELCOLOR, mapId );
1812  if ( wmsParam.isValid() )
1813  {
1814  colors = wmsParam.toColorList( ';' );
1815  }
1816 
1817  QList<int> sizes;
1818  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELSIZE, mapId );
1819  if ( wmsParam.isValid() )
1820  {
1821  sizes = wmsParam.toIntList( ';' );
1822  }
1823 
1824  QList<int> weights;
1825  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT, mapId );
1826  if ( wmsParam.isValid() )
1827  {
1828  weights = wmsParam.toIntList( ';' );
1829  }
1830 
1831  QList<QColor> bufferColors;
1832  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR, mapId );
1833  if ( wmsParam.isValid() )
1834  {
1835  bufferColors = wmsParam.toColorList( ';' );
1836  }
1837 
1838  QList<double> bufferSizes;
1839  wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE, mapId );
1840  if ( wmsParam.isValid() )
1841  {
1842  bufferSizes = wmsParam.toDoubleList( ';' );
1843  }
1844 
1845  int nHLayers = std::min( geoms.size(), slds.size() );
1846  for ( int i = 0; i < nHLayers; i++ )
1847  {
1849  hParam.mName = pMapId + QStringLiteral( "_highlight_" ) + QString::number( i );
1850  hParam.mGeom = geoms[i];
1851  hParam.mSld = slds[i];
1852 
1853  if ( i < labels.count() )
1854  hParam.mLabel = labels[i];
1855 
1856  if ( i < colors.count() )
1857  hParam.mColor = colors[i];
1858 
1859  if ( i < sizes.count() )
1860  hParam.mSize = sizes[i];
1861 
1862  if ( i < weights.count() )
1863  hParam.mWeight = weights[i];
1864 
1865  if ( i < fonts.count() )
1866  hParam.mFont = fonts[ i ];
1867 
1868  if ( i < bufferColors.count() )
1869  hParam.mBufferColor = bufferColors[i];
1870 
1871  if ( i < bufferSizes.count() )
1872  hParam.mBufferSize = bufferSizes[i];
1873 
1874  hParams.append( hParam );
1875  }
1876  param.mHighlightLayers = hParams;
1877 
1878  return param;
1879  }
1880 
1881  QString QgsWmsParameters::externalWMSUri( const QString &id ) const
1882  {
1883  if ( !mExternalWMSParameters.contains( id ) )
1884  {
1885  return QString();
1886  }
1887 
1888  QgsDataSourceUri wmsUri;
1889  const QMap<QString, QString> &paramMap = mExternalWMSParameters[ id ];
1890  QMap<QString, QString>::const_iterator paramIt = paramMap.constBegin();
1891  for ( ; paramIt != paramMap.constEnd(); ++paramIt )
1892  {
1893  QString paramName = paramIt.key().toLower();
1894  if ( paramName == QLatin1String( "layers" ) || paramName == QLatin1String( "styles" ) )
1895  {
1896  const QStringList values = paramIt.value().split( ',' );
1897  for ( const QString &value : values )
1898  wmsUri.setParam( paramName, value );
1899  }
1900  else
1901  {
1902  wmsUri.setParam( paramName, paramIt.value() );
1903  }
1904  }
1905  return wmsUri.encodedUri();
1906  }
1907 
1909  {
1910  return mWmsParameters[ QgsWmsParameter::WITH_GEOMETRY ].toBool();
1911  }
1912 
1914  {
1915  return mWmsParameters[ QgsWmsParameter::WITH_MAPTIP ].toBool();
1916  }
1917 
1919  {
1920  return mWmsParameters[ QgsWmsParameter::WMTVER ].toString();
1921  }
1922 
1923  void QgsWmsParameters::log( const QString &msg ) const
1924  {
1925  QgsMessageLog::logMessage( msg, QStringLiteral( "Server" ), Qgis::Info );
1926  }
1927 
1928  void QgsWmsParameters::raiseError( const QString &msg ) const
1929  {
1931  }
1932 
1933  QgsWmsParameter QgsWmsParameters::idParameter( const QgsWmsParameter::Name name, const int id ) const
1934  {
1935  QgsWmsParameter p;
1936 
1937  for ( const auto &param : mWmsParameters.values( name ) )
1938  {
1939  if ( param.mId == id )
1940  {
1941  p = param;
1942  }
1943  }
1944 
1945  return p;
1946  }
1947 
1948  QgsWmsParametersExternalLayer QgsWmsParameters::externalLayerParameter( const QString &name ) const
1949  {
1950  QgsWmsParametersExternalLayer param;
1951 
1952  param.mName = name;
1953  param.mName.remove( 0, EXTERNAL_LAYER_PREFIX.size() );
1954  param.mUri = externalWMSUri( param.mName );
1955 
1956  return param;
1957  }
1958 
1959  bool QgsWmsParameters::isExternalLayer( const QString &name )
1960  {
1961  return name.startsWith( EXTERNAL_LAYER_PREFIX );
1962  }
1963 
1965  {
1966  QStringList attributes;
1967  const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
1968 
1969  if ( options.contains( DxfFormatOption::LAYERATTRIBUTES ) )
1970  {
1971  attributes = options[ DxfFormatOption::LAYERATTRIBUTES ].split( ',' );
1972  }
1973 
1974  return attributes;
1975  }
1976 
1978  {
1979  bool use = false;
1980  const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
1981 
1982  if ( options.contains( DxfFormatOption::USE_TITLE_AS_LAYERNAME ) )
1983  {
1984  use = QVariant( options[ DxfFormatOption::USE_TITLE_AS_LAYERNAME ] ).toBool();
1985  }
1986 
1987  return use;
1988  }
1989 
1991  {
1992  const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
1993 
1994  double scale = -1;
1995  if ( options.contains( DxfFormatOption::SCALE ) )
1996  {
1997  scale = options[ DxfFormatOption::SCALE ].toDouble();
1998  }
1999 
2000  return scale;
2001  }
2002 
2004  {
2005  const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
2006 
2008 
2009  if ( ! options.contains( DxfFormatOption::MODE ) )
2010  {
2011  return symbol;
2012  }
2013 
2014  const QString mode = options[ DxfFormatOption::MODE ];
2015  if ( mode.compare( QLatin1String( "SymbolLayerSymbology" ), Qt::CaseInsensitive ) == 0 )
2016  {
2018  }
2019  else if ( mode.compare( QLatin1String( "FeatureSymbology" ), Qt::CaseInsensitive ) == 0 )
2020  {
2022  }
2023 
2024  return symbol;
2025  }
2026 
2028  {
2029  QString codec = QStringLiteral( "ISO-8859-1" );
2030 
2031  if ( dxfFormatOptions().contains( DxfFormatOption::CODEC ) )
2032  {
2033  codec = dxfFormatOptions()[ DxfFormatOption::CODEC ];
2034  }
2035 
2036  return codec;
2037  }
2038 
2039  QMap<QgsWmsParameters::DxfFormatOption, QString> QgsWmsParameters::dxfFormatOptions() const
2040  {
2041  QMap<QgsWmsParameters::DxfFormatOption, QString> options;
2042 
2043  const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameters::DxfFormatOption>() );
2044  const QStringList opts = mWmsParameters[ QgsWmsParameter::FORMAT_OPTIONS ].toStringList( ';' );
2045 
2046  for ( auto it = opts.constBegin(); it != opts.constEnd(); ++it )
2047  {
2048  const int equalIdx = it->indexOf( ':' );
2049  if ( equalIdx > 0 && equalIdx < ( it->length() - 1 ) )
2050  {
2051  const QString name = it->left( equalIdx ).toUpper();
2052  const QgsWmsParameters::DxfFormatOption option =
2053  ( QgsWmsParameters::DxfFormatOption ) metaEnum.keyToValue( name.toStdString().c_str() );
2054  const QString value = it->right( it->length() - equalIdx - 1 );
2055  options.insert( option, value );
2056  }
2057  }
2058 
2059  return options;
2060  }
2061 
2062  QMap<QString, QString> QgsWmsParameters::dimensionValues() const
2063  {
2064  QMap<QString, QString> dimValues;
2065  const QMetaEnum pnMetaEnum( QMetaEnum::fromType<QgsVectorLayerServerProperties::PredefinedWmsDimensionName>() );
2066  const QStringList unmanagedNames = mUnmanagedParameters.keys();
2067  for ( const QString &key : unmanagedNames )
2068  {
2069  if ( key.startsWith( QLatin1String( "DIM_" ) ) )
2070  {
2071  dimValues[key.mid( 4 )] = mUnmanagedParameters[key];
2072  }
2073  else if ( pnMetaEnum.keyToValue( key.toUpper().toStdString().c_str() ) != -1 )
2074  {
2075  dimValues[key] = mUnmanagedParameters[key];
2076  }
2077  }
2078  return dimValues;
2079  }
2080 }
QgsWms::QgsWmsParameters::layerFontBold
QString layerFontBold() const
Returns LAYERFONTBOLD parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1067
QgsWms::QgsWmsParameters::highlightGeom
QStringList highlightGeom() const
Returns HIGHLIGHT_GEOM as a list of string in WKT.
Definition: qgswmsparameters.cpp:658
QgsWms::QgsWmsParameter::GRID_INTERVAL_X
@ GRID_INTERVAL_X
Definition: qgswmsparameters.h:172
QgsWms::QgsWmsParameters::transparent
QString transparent() const
Returns TRANSPARENT parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:927
QgsWms::QgsWmsParameter::LAYERFONTSIZE
@ LAYERFONTSIZE
Definition: qgswmsparameters.h:124
QgsWms::QgsWmsParameter::toRectangle
QgsRectangle toRectangle() const
Converts the parameter into a rectangle.
Definition: qgswmsparameters.cpp:69
QgsWms::QgsWmsParameter::loadUrl
QString loadUrl() const
Loads the data associated to the parameter converted into an url.
Definition: qgswmsparameters.cpp:96
QgsWms::QgsWmsParameter::OPACITIES
@ OPACITIES
Definition: qgswmsparameters.h:138
QgsWms::QgsServiceException::QGIS_InvalidParameterValue
@ QGIS_InvalidParameterValue
Definition: qgswmsserviceexception.h:62
QgsWms::QgsWmsParameters::srcHeight
QString srcHeight() const
Returns SRCHEIGHT parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:726
QgsWms::QgsWmsParameters
Provides an interface to retrieve and manipulate WMS parameters received from the client.
Definition: qgswmsparameters.h:324
QgsWms::QgsWmsParameter::mName
QgsWmsParameter::Name mName
Definition: qgswmsparameters.h:313
QgsWms::QgsWmsParameters::layerTitleSpaceAsDouble
double layerTitleSpaceAsDouble() const
Returns LAYERTITLESPACE as a double.
Definition: qgswmsparameters.cpp:1012
QgsWms::QgsWmsParameter::name
QString name() const
Returns the name of the parameter.
Definition: qgswmsparameters.cpp:194
QgsWms::QgsWmsParameter::SYMBOLHEIGHT
@ SYMBOLHEIGHT
Definition: qgswmsparameters.h:136
QgsWms::QgsWmsParameters::set
void set(QgsWmsParameter::Name name, const QVariant &value)
Sets a parameter value thanks to its name.
Definition: qgswmsparameters.cpp:561
QgsWms::QgsWmsParameter::HIGHLIGHT_LABELFONT
@ HIGHLIGHT_LABELFONT
Definition: qgswmsparameters.h:159
QgsWms::QgsWmsParameter::LAYERFONTCOLOR
@ LAYERFONTCOLOR
Definition: qgswmsparameters.h:125
QgsWms::QgsWmsParameter::QUERY_LAYERS
@ QUERY_LAYERS
Definition: qgswmsparameters.h:130
QgsDataSourceUri
Class for storing the component parts of a RDBMS data source URI (e.g.
Definition: qgsdatasourceuri.h:36
QgsWms::QgsWmsParameter::FEATURE_COUNT
@ FEATURE_COUNT
Definition: qgswmsparameters.h:131
QgsWms::QgsWmsParametersHighlightLayer::mLabel
QString mLabel
Definition: qgswmsparameters.h:70
QgsWms::QgsWmsParameter::EXTENT
@ EXTENT
Definition: qgswmsparameters.h:170
QgsWms::QgsWmsParameter::FORMAT_OPTIONS
@ FORMAT_OPTIONS
Definition: qgswmsparameters.h:178
QgsWms::QgsWmsParameters::infoFormatIsImage
bool infoFormatIsImage() const
Checks if INFO_FORMAT parameter is one of the image formats (PNG, JPG).
Definition: qgswmsparameters.cpp:830
QgsWms::QgsWmsParameters::wmsPrecisionAsInt
int wmsPrecisionAsInt() const
Returns WMS_PRECISION parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:1334
QgsWms::QgsWmsParametersHighlightLayer::mBufferColor
QColor mBufferColor
Definition: qgswmsparameters.h:76
QgsWms::QgsWmsParametersComposerMap
Definition: qgswmsparameters.h:80
QgsWms::QgsWmsParametersExternalLayer
Definition: qgswmsparameters.h:60
QgsWms::QgsWmsParameter::WITH_GEOMETRY
@ WITH_GEOMETRY
Definition: qgswmsparameters.h:174
QgsWms::QgsWmsParameters::opacities
QStringList opacities() const
Returns the list of opacities found in OPACITIES parameter.
Definition: qgswmsparameters.cpp:1399
QgsWms::QgsWmsParameters::symbolWidth
QString symbolWidth() const
Returns SYMBOLWIDTH parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1037
QgsServerParameterDefinition::raiseError
static void raiseError(const QString &msg)
Raises an exception in case of an invalid parameters.
Definition: qgsserverparameters.cpp:356
QgsWms::QgsWmsParameter::toInt
int toInt() const
Converts the parameter into an integer.
Definition: qgswmsparameters.cpp:83
QgsWms::QgsWmsParameters::layerFontItalicAsBool
bool layerFontItalicAsBool() const
Returns LAYERFONTITALIC as a boolean or its default value if not defined.
Definition: qgswmsparameters.cpp:1122
QgsWms::QgsWmsParameters::showFeatureCountAsBool
bool showFeatureCountAsBool() const
Returns SHOWFEATURECOUNT as a bool.
Definition: qgswmsparameters.cpp:972
QgsWms::QgsWmsParameter::toIntList
QList< int > toIntList(const char delimiter=',') const
Converts the parameter into a list of integers.
Definition: qgswmsparameters.cpp:153
QgsWms::QgsWmsParameters::isForce2D
bool isForce2D() const
Definition: qgswmsparameters.cpp:1483
QgsWms::QgsWmsParameters::wmtver
QString wmtver() const
Returns WMTVER parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1918
QgsWms::QgsWmsParameters::heightAsInt
int heightAsInt() const
Returns HEIGHT parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:716
QgsLegendSettings::setSymbolSize
void setSymbolSize(QSizeF s)
Sets the default symbol size (in millimeters) used for legend items.
Definition: qgslegendsettings.h:235
QgsWms::QgsWmsParametersFilter::OGC_FE
@ OGC_FE
Definition: qgswmsparameters.h:41
QgsWms::QgsWmsParameters::infoFormatVersion
int infoFormatVersion() const
Returns the infoFormat version for GML.
Definition: qgswmsparameters.cpp:860
QgsWms::QgsWmsParameter::LAYERFONTBOLD
@ LAYERFONTBOLD
Definition: qgswmsparameters.h:122
QgsWms::QgsWmsParameter::RULELABEL
@ RULELABEL
Definition: qgswmsparameters.h:153
QgsWms::QgsWmsParametersHighlightLayer::mSize
int mSize
Definition: qgswmsparameters.h:72
QgsWms::QgsWmsParameters::srcHeightAsInt
int srcHeightAsInt() const
Returns SRCHEIGHT parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:736
QgsLegendStyle::setFont
void setFont(const QFont &font)
Sets the font used for rendering this legend component.
Definition: qgslegendstyle.h:74
QgsWms::QgsWmsParametersComposerMap::mLayers
QList< QgsWmsParametersLayer > mLayers
Definition: qgswmsparameters.h:88
QgsWms::QgsWmsParametersComposerMap::mHighlightLayers
QList< QgsWmsParametersHighlightLayer > mHighlightLayers
Definition: qgswmsparameters.h:89
QgsWms::QgsWmsParameters::wmsPrecision
QString wmsPrecision() const
Returns WMS_PRECISION parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1329
QgsWms::QgsWmsParameter::BOXSPACE
@ BOXSPACE
Definition: qgswmsparameters.h:107
QgsWms::QgsWmsParameters::crs
QString crs() const
Returns CRS or an empty string if none is defined.
Definition: qgswmsparameters.cpp:673
QgsWms::QgsWmsParameters::Format
Format
Output format for the response.
Definition: qgswmsparameters.h:331
QgsServerParameters::load
void load(const QUrlQuery &query)
Loads new parameters.
Definition: qgsserverparameters.cpp:549
QgsWms::QgsWmsParameters::layerFontSize
QString layerFontSize() const
Returns LAYERFONTSIZE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1137
QgsWms::QgsWmsParametersExternalLayer::mName
QString mName
Definition: qgswmsparameters.h:61
QgsWms::QgsWmsParameters::legendSettings
QgsLegendSettings legendSettings() const
Returns legend settings.
Definition: qgswmsparameters.cpp:1220
QgsWms::QgsWmsParametersHighlightLayer::mWeight
int mWeight
Definition: qgswmsparameters.h:73
QgsWms::QgsWmsParameters::iconLabelSpace
QString iconLabelSpace() const
Returns ICONLABELSPACE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1047
QgsWms::QgsWmsParameters::operator[]
QgsWmsParameter operator[](QgsWmsParameter::Name name) const
Returns the parameter corresponding to name.
Definition: qgswmsparameters.cpp:556
QgsWms::QgsWmsParameter::Y
@ Y
Definition: qgswmsparameters.h:151
QgsWms::QgsWmsParameters::bbox
QString bbox() const
Returns BBOX if defined or an empty string.
Definition: qgswmsparameters.cpp:696
QgsWms::QgsWmsParameters::infoFormatAsString
QString infoFormatAsString() const
Returns INFO_FORMAT parameter as a string.
Definition: qgswmsparameters.cpp:825
QgsWms::QgsWmsParametersLayer::mExternalUri
QString mExternalUri
Definition: qgswmsparameters.h:56
QgsWms::QgsWmsParameter::STYLE
@ STYLE
Definition: qgswmsparameters.h:133
QgsWms::QgsWmsParameters::featureCountAsInt
int featureCountAsInt() const
Returns FEATURE_COUNT as an integer.
Definition: qgswmsparameters.cpp:982
QgsWms::QgsWmsParameter::FI_LINE_TOLERANCE
@ FI_LINE_TOLERANCE
Definition: qgswmsparameters.h:142
QgsLegendStyle::setMargin
void setMargin(Side side, double margin)
Sets the margin (in mm) for the specified side of the component.
Definition: qgslegendstyle.h:100
QgsWms::QgsWmsParameter::ITEMFONTITALIC
@ ITEMFONTITALIC
Definition: qgswmsparameters.h:117
QgsWms::QgsWmsParameters::i
QString i() const
Returns I parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:872
QgsWms::QgsWmsParameter::SHOWFEATURECOUNT
@ SHOWFEATURECOUNT
Definition: qgswmsparameters.h:132
QgsWms::QgsWmsParameters::highlightLabelWeight
QStringList highlightLabelWeight() const
Returns HIGHLIGHT_LABELWEIGHT as a list of string.
Definition: qgswmsparameters.cpp:1294
QgsWms::QgsWmsParameters::boxSpace
QString boxSpace() const
Returns BOXSPACE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:987
QgsLegendSettings::setBoxSpace
void setBoxSpace(double s)
Sets the legend box space (in millimeters), which is the empty margin around the inside of the legend...
Definition: qgslegendsettings.h:104
QgsWms::QgsWmsParametersComposerMap::mScale
float mScale
Definition: qgswmsparameters.h:84
QgsWms::QgsWmsParametersLayer::mNickname
QString mNickname
Definition: qgswmsparameters.h:51
QgsWms::QgsWmsParameters::itemFontBoldAsBool
bool itemFontBoldAsBool() const
Returns ITEMFONTBOLD as a boolean or its default value if not defined.
Definition: qgswmsparameters.cpp:1112
QgsWms::QgsWmsParameters::highlightLabelBufferSizeAsFloat
QList< double > highlightLabelBufferSizeAsFloat() const
Returns HIGHLIGHT_LABELBUFFERSIZE as a list of float.
Definition: qgswmsparameters.cpp:1324
QgsWms::QgsWmsParameters::transparentAsBool
bool transparentAsBool() const
Returns TRANSPARENT parameter as a bool or its default value if not defined.
Definition: qgswmsparameters.cpp:932
QgsWms::QgsWmsParameter::TRANSPARENT
@ TRANSPARENT
Definition: qgswmsparameters.h:166
QgsWms::QgsWmsParametersComposerMap::mRotation
float mRotation
Definition: qgswmsparameters.h:85
QgsWms::QgsWmsParameters::layerTitleSpace
QString layerTitleSpace() const
Returns LAYERTITLESPACE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1007
QgsWms::QgsWmsParameter::WIDTH
@ WIDTH
Definition: qgswmsparameters.h:110
QgsWms::QgsWmsParameters::itemFontColorAsColor
QColor itemFontColorAsColor() const
Returns ITEMFONTCOLOR as a color.
Definition: qgswmsparameters.cpp:1172
QgsWms::QgsWmsParameters::dpi
QString dpi() const
Returns DPI parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:746
QgsWms::QgsWmsParameters::featureCount
QString featureCount() const
Returns FEATURE_COUNT parameter or an empty string if none is defined.
Definition: qgswmsparameters.cpp:977
QgsWms::QgsWmsParameter::INFO_FORMAT
@ INFO_FORMAT
Definition: qgswmsparameters.h:147
QgsWms::QgsWmsParameters::itemFontItalic
QString itemFontItalic() const
Returns ITEMFONTITALIC parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1127
QgsWms::QgsWmsParameter::GRID_INTERVAL_Y
@ GRID_INTERVAL_Y
Definition: qgswmsparameters.h:173
QgsWms::QgsWmsParameters::symbolSpace
QString symbolSpace() const
Returns SYMBOLSPACE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1017
QgsServerParameters::value
QString value(const QString &key) const
Returns the value of a parameter.
Definition: qgsserverparameters.cpp:532
QgsWms::QgsWmsParametersLayer::mStyle
QString mStyle
Definition: qgswmsparameters.h:55
QgsWms::QgsWmsParameter::raiseError
void raiseError() const
Raises an error in case of an invalid conversion.
Definition: qgswmsparameters.cpp:44
QgsServerParameterDefinition::toDouble
double toDouble(bool &ok) const
Converts the parameter into a double.
Definition: qgsserverparameters.cpp:338
QgsWms::QgsWmsParametersComposerMap::mGridX
float mGridX
Definition: qgswmsparameters.h:86
QgsServerParameterDefinition::toStringList
QStringList toStringList(char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of strings.
Definition: qgsserverparameters.cpp:75
QgsServerParameterDefinition::loadUrl
QString loadUrl(bool &ok) const
Loads the data associated to the parameter converted into an url.
Definition: qgsserverparameters.cpp:227
QgsWms::QgsWmsParametersLayer
Definition: qgswmsparameters.h:50
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
QgsWms::QgsWmsParameter::UNKNOWN
@ UNKNOWN
Definition: qgswmsparameters.h:106
QgsWms::QgsWmsParametersHighlightLayer::mFont
QString mFont
Definition: qgswmsparameters.h:74
QgsWms::QgsWmsParameters::itemFontSize
QString itemFontSize() const
Returns ITEMFONTSIZE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1157
QgsWms::QgsWmsParametersFilter
Definition: qgswmsparameters.h:35
QgsWms::QgsWmsParameters::highlightLabelWeightAsInt
QList< int > highlightLabelWeightAsInt() const
Returns HIGHLIGHT_LABELWEIGHT as a list of int.
Definition: qgswmsparameters.cpp:1299
QgsWms::QgsWmsParameter::I
@ I
Definition: qgswmsparameters.h:148
QgsWms::QgsWmsParametersHighlightLayer::mName
QString mName
Definition: qgswmsparameters.h:67
QgsWms::QgsWmsParameter::LAYERFONTFAMILY
@ LAYERFONTFAMILY
Definition: qgswmsparameters.h:121
QgsWms::QgsWmsParameter::X
@ X
Definition: qgswmsparameters.h:150
QgsWms::QgsWmsParameters::itemFontBold
QString itemFontBold() const
Returns ITEMFONTBOLD parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1077
QgsWms::QgsWmsParameter::LAYERSPACE
@ LAYERSPACE
Definition: qgswmsparameters.h:128
QgsWms::QgsWmsParameters::highlightLabelFont
QStringList highlightLabelFont() const
Returns HIGHLIGHT_LABELFONT.
Definition: qgswmsparameters.cpp:1304
QgsWms::QgsWmsParametersComposerMap::mId
int mId
Definition: qgswmsparameters.h:81
QgsWms::QgsWmsParameters::withMapTip
bool withMapTip() const
withMapTip
Definition: qgswmsparameters.cpp:1913
QgsWms::QgsWmsParameter::HIGHLIGHT_GEOM
@ HIGHLIGHT_GEOM
Definition: qgswmsparameters.h:156
QgsWms::QgsWmsParameters::imageQuality
QString imageQuality() const
Returns IMAGE_QUALITY parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:947
QgsWms::QgsWmsParameters::opacitiesAsInt
QList< int > opacitiesAsInt() const
Returns the list of opacities found in OPACITIES parameter as integers.
Definition: qgswmsparameters.cpp:1404
QgsWms::QgsWmsParameter::SRS
@ SRS
Definition: qgswmsparameters.h:109
QgsWms::QgsWmsParameters::highlightLabelBufferSize
QStringList highlightLabelBufferSize() const
Returns HIGHLIGHT_LABELBUFFERSIZE.
Definition: qgswmsparameters.cpp:1319
QgsWms::QgsWmsParameter::FI_POLYGON_TOLERANCE
@ FI_POLYGON_TOLERANCE
Definition: qgswmsparameters.h:141
QgsWms::QgsWmsParameters::highlightLabelBufferColor
QStringList highlightLabelBufferColor() const
Returns HIGHLIGHT_LABELBUFFERCOLOR as a list of string.
Definition: qgswmsparameters.cpp:1309
QgsWms::QgsWmsParameters::srcWidth
QString srcWidth() const
Returns SRCWIDTH parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:731
QgsWms::QgsWmsParameter::FI_POINT_TOLERANCE
@ FI_POINT_TOLERANCE
Definition: qgswmsparameters.h:143
QgsWms::QgsWmsParameter::LAYER
@ LAYER
Definition: qgswmsparameters.h:120
QgsServerParameters::version
QString version() const
Returns VERSION parameter as a string or an empty string if not defined.
Definition: qgsserverparameters.cpp:477
QgsWms::QgsWmsParameters::height
QString height() const
Returns HEIGHT parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:706
QgsWms::QgsWmsParameters::symbolHeight
QString symbolHeight() const
Returns SYMBOLHEIGHT parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1027
QgsWms::QgsWmsParameters::queryLayersNickname
QStringList queryLayersNickname() const
Returns nickname of layers found in QUERY_LAYERS parameter.
Definition: qgswmsparameters.cpp:1416
QgsWms::QgsWmsParameters::sldBody
QString sldBody() const
Returns SLD_body if defined or an empty string.
Definition: qgswmsparameters.cpp:1339
QgsServerParameters::mUnmanagedParameters
QMap< QString, QString > mUnmanagedParameters
Definition: qgsserverparameters.h:336
QgsWms::QgsWmsParameters::widthAsInt
int widthAsInt() const
Returns WIDTH parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:721
QgsWms::QgsWmsParameters::layerFontFamily
QString layerFontFamily() const
Returns LAYERFONTFAMILY parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1057
QgsWms::QgsWmsParameter::IMAGE_QUALITY
@ IMAGE_QUALITY
Definition: qgswmsparameters.h:114
QgsWms::QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR
@ HIGHLIGHT_LABELBUFFERCOLOR
Definition: qgswmsparameters.h:163
QgsServerParameterDefinition::toUrl
QUrl toUrl(bool &ok) const
Converts the parameter into an url.
Definition: qgsserverparameters.cpp:299
QgsWms::QgsWmsParametersComposerMap::mGridY
float mGridY
Definition: qgswmsparameters.h:87
QgsWms::QgsWmsParameter::toColor
QColor toColor() const
Converts the parameter into a color.
Definition: qgswmsparameters.cpp:126
Qgis::Info
@ Info
Definition: qgis.h:90
QgsWms::QgsWmsParameter::HIGHLIGHT_SYMBOL
@ HIGHLIGHT_SYMBOL
Definition: qgswmsparameters.h:157
QgsWms::QgsWmsParameters::polygonToleranceAsInt
int polygonToleranceAsInt() const
Returns FI_POLYGON_TOLERANCE parameter as an integer.
Definition: qgswmsparameters.cpp:1097
QgsWms::QgsWmsParameters::itemFontColor
QString itemFontColor() const
Returns ITEMFONTCOLOR parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1167
qgsdatasourceuri.h
QgsWms::QgsWmsParameters::x
QString x() const
Returns X parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:892
QgsWms::QgsWmsParameters::versionAsNumber
QgsProjectVersion versionAsNumber() const
Returns VERSION parameter if defined or its default value.
Definition: qgswmsparameters.cpp:756
EXTERNAL_LAYER_PREFIX
const QString EXTERNAL_LAYER_PREFIX
Definition: qgswmsparameters.cpp:24
QgsLegendSettings::setTitle
void setTitle(const QString &t)
Sets the title for the legend, which will be rendered above all legend items.
Definition: qgslegendsettings.h:48
QgsWms::QgsWmsParameter::WMS_PRECISION
@ WMS_PRECISION
Definition: qgswmsparameters.h:165
QgsWms::QgsWmsParameter::LAYERTITLESPACE
@ LAYERTITLESPACE
Definition: qgswmsparameters.h:129
QgsWms::QgsWmsParameters::lineTolerance
QString lineTolerance() const
Returns FI_LINE_TOLERANCE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1087
QgsWms::QgsWmsParameters::yAsInt
int yAsInt() const
Returns Y parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:907
QgsWms::QgsWmsParametersFilter::SQL
@ SQL
Definition: qgswmsparameters.h:40
QgsWms::QgsWmsParameters::layerFont
QFont layerFont() const
Returns the layer font (built thanks to the LAYERFONTFAMILY, LAYERFONTSIZE, LAYERFONTBOLD,...
Definition: qgswmsparameters.cpp:1177
QgsWms::QgsWmsParameters::highlightLabelColor
QStringList highlightLabelColor() const
Returns HIGHLIGHT_LABELCOLOR as a list of string.
Definition: qgswmsparameters.cpp:1284
QgsServerParameterDefinition
Definition of a parameter with basic conversion methods.
Definition: qgsserverparameters.h:35
QgsWms::QgsWmsParametersFilter::mType
QgsWmsParametersFilter::Type mType
Definition: qgswmsparameters.h:45
QgsWms::QgsWmsParameter::QgsWmsParameter
QgsWmsParameter(const QgsWmsParameter::Name name=QgsWmsParameter::UNKNOWN, const QVariant::Type type=QVariant::String, const QVariant defaultValue=QVariant(""))
Constructor for QgsWmsParameter.
Definition: qgswmsparameters.cpp:31
QgsWms::QgsWmsParameter::toDoubleList
QList< double > toDoubleList(const char delimiter=',') const
Converts the parameter into a list of doubles.
Definition: qgswmsparameters.cpp:167
QgsWms::QgsWmsParameter::ITEMFONTBOLD
@ ITEMFONTBOLD
Definition: qgswmsparameters.h:116
QgsWms::QgsWmsParameters::layerFontSizeAsDouble
double layerFontSizeAsDouble() const
Returns LAYERFONTSIZE as a double.
Definition: qgswmsparameters.cpp:1142
QgsWms::PNG
@ PNG
Definition: qgswmsutils.h:42
QgsWms::QgsWmsParameters::backgroundColor
QString backgroundColor() const
Returns BGCOLOR parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1649
QgsWms::QgsWmsParameters::symbolSpaceAsDouble
double symbolSpaceAsDouble() const
Returns SYMBOLSPACE as a double or its default value if not defined.
Definition: qgswmsparameters.cpp:1022
QgsWms::QgsWmsParametersHighlightLayer
Definition: qgswmsparameters.h:66
QgsWms::QgsWmsParameters::ruleLabelAsBool
bool ruleLabelAsBool() const
Returns RULELABEL as a bool.
Definition: qgswmsparameters.cpp:922
QgsDataSourceUri::setParam
void setParam(const QString &key, const QString &value)
Sets a generic parameter value on the URI.
Definition: qgsdatasourceuri.cpp:778
QgsWms::QgsWmsParametersComposerMap::mHasExtent
bool mHasExtent
Definition: qgswmsparameters.h:82
QgsWms::QgsWmsParameters::highlightSymbol
QStringList highlightSymbol() const
Returns HIGHLIGHT_SYMBOL as a list of string.
Definition: qgswmsparameters.cpp:668
QgsWms::QgsWmsParametersComposerMap::mExtent
QgsRectangle mExtent
Definition: qgswmsparameters.h:83
QgsWms::QgsWmsParameters::lineToleranceAsInt
int lineToleranceAsInt() const
Returns FI_LINE_TOLERANCE parameter as an integer.
Definition: qgswmsparameters.cpp:1102
QgsWms::QgsWmsParameters::tiled
QString tiled() const
Returns TILED parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:957
QgsWms::QgsWmsParameter::toDouble
double toDouble() const
Converts the parameter into a double.
Definition: qgswmsparameters.cpp:181
QgsWms::QgsWmsParameters::xAsInt
int xAsInt() const
Returns X parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:902
QgsWms::QgsWmsParameters::dpiAsDouble
double dpiAsDouble() const
Returns DPI parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:751
QgsLegendSettings
The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLege...
Definition: qgslegendsettings.h:39
QgsWms::QgsWmsParameter::SLD
@ SLD
Definition: qgswmsparameters.h:139
QgsWms::QgsWmsParameter::SCALE
@ SCALE
Definition: qgswmsparameters.h:154
QgsServerParameterDefinition::toString
QString toString(bool defaultValue=false) const
Converts the parameter into a string.
Definition: qgsserverparameters.cpp:65
QgsWms::QgsWmsParametersLayer::mSelection
QStringList mSelection
Definition: qgswmsparameters.h:54
QgsWms::QgsWmsParameter::HIGHLIGHT_LABELSTRING
@ HIGHLIGHT_LABELSTRING
Definition: qgswmsparameters.h:158
QgsWms::QgsWmsParameter::ROTATION
@ ROTATION
Definition: qgswmsparameters.h:171
QgsWms::QgsWmsParametersFilter::mVersion
QgsOgcUtils::FilterVersion mVersion
Definition: qgswmsparameters.h:46
QgsWms::QgsWmsParameters::layersParameters
QList< QgsWmsParametersLayer > layersParameters() const
Returns parameters for each layer found in LAYER/LAYERS.
Definition: qgswmsparameters.cpp:1509
QgsWms::QgsWmsParameters::itemFontSizeAsDouble
double itemFontSizeAsDouble() const
Returns ITEMFONTSIZE as a double.
Definition: qgswmsparameters.cpp:1162
QgsWms::QgsWmsParameters::bboxAsRectangle
QgsRectangle bboxAsRectangle() const
Returns BBOX as a rectangle if defined and valid.
Definition: qgswmsparameters.cpp:701
QgsWms::QgsWmsParameters::j
QString j() const
Returns J parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:877
QgsWms::QgsWmsParameter::toUrl
QUrl toUrl() const
Converts the parameter into an url.
Definition: qgswmsparameters.cpp:113
QgsWms::QgsWmsParameters::pointToleranceAsInt
int pointToleranceAsInt() const
Returns FI_POINT_TOLERANCE parameter as an integer.
Definition: qgswmsparameters.cpp:1107
QgsServerParameterDefinition::toColor
QColor toColor(bool &ok) const
Converts the parameter into a color.
Definition: qgsserverparameters.cpp:43
QgsWms::QgsWmsParameters::filterGeom
QString filterGeom() const
Returns the filter geometry found in FILTER_GEOM parameter.
Definition: qgswmsparameters.cpp:1389
QgsWms::QgsWmsParametersHighlightLayer::mBufferSize
float mBufferSize
Definition: qgswmsparameters.h:75
QgsWms::QgsWmsParameters::showFeatureCount
QString showFeatureCount() const
Returns SHOWFEATURECOUNT parameter or an empty string if none is defined.
Definition: qgswmsparameters.cpp:967
QgsWms::QgsWmsParameters::layerTitle
QString layerTitle() const
Returns LAYERTITLE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1210
QgsWms::QgsWmsParameter::TEMPLATE
@ TEMPLATE
Definition: qgswmsparameters.h:169
QgsWms::QgsWmsParametersFilter::mFilter
QString mFilter
Definition: qgswmsparameters.h:44
QgsWms::QgsWmsParameter::ATLAS_PK
@ ATLAS_PK
Definition: qgswmsparameters.h:177
QgsWms::QgsWmsParameters::itemFontItalicAsBool
bool itemFontItalicAsBool() const
Returns ITEMFONTITALIC as a boolean or its default value if not defined.
Definition: qgswmsparameters.cpp:1132
QgsWms::QgsWmsParameter::BBOX
@ BBOX
Definition: qgswmsparameters.h:112
QgsWms::QgsWmsParameters::format
Format format() const
Returns format.
Definition: qgswmsparameters.cpp:790
QgsWms::QgsWmsParameter::ITEMFONTFAMILY
@ ITEMFONTFAMILY
Definition: qgswmsparameters.h:115
qgswmsparameters.h
QgsWms::QgsWmsParameter::ITEMFONTSIZE
@ ITEMFONTSIZE
Definition: qgswmsparameters.h:118
QgsWms::QgsWmsParameters::itemFont
QFont itemFont() const
Returns the item font (built thanks to the ITEMFONTFAMILY, ITEMFONTSIZE, ITEMFONTBOLD,...
Definition: qgswmsparameters.cpp:1193
QgsWms::QgsWmsParameter::LAYERTITLE
@ LAYERTITLE
Definition: qgswmsparameters.h:126
QgsWms::QgsWmsParameters::externalLayersParameters
QList< QgsWmsParametersExternalLayer > externalLayersParameters() const
Returns parameters for each external layer.
Definition: qgswmsparameters.cpp:1632
QgsWms::QgsWmsParameter::FILTER_GEOM
@ FILTER_GEOM
Definition: qgswmsparameters.h:145
QgsWms::QgsWmsParameters::composerMapParameters
QgsWmsParametersComposerMap composerMapParameters(int mapId) const
Returns the requested parameters for a composer map parameter.
Definition: qgswmsparameters.cpp:1664
QgsWms::QgsWmsParameters::scaleAsDouble
double scaleAsDouble() const
Returns SCALE as a double.
Definition: qgswmsparameters.cpp:942
QgsWms::QgsWmsParameters::dxfFormatOptions
QMap< DxfFormatOption, QString > dxfFormatOptions() const
Returns a map of DXF options defined within FORMAT_OPTIONS parameter.
Definition: qgswmsparameters.cpp:2039
QgsWms::QgsWmsParameters::QgsWmsParameters
QgsWmsParameters()
Constructor for WMS parameters with default values only.
Definition: qgswmsparameters.cpp:214
QgsWms::QgsWmsParameters::composerTemplate
QString composerTemplate() const
Returns TEMPLATE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1659
QgsWms::QgsWmsParametersHighlightLayer::mGeom
QgsGeometry mGeom
Definition: qgswmsparameters.h:68
QgsWms
Median cut implementation.
Definition: qgsdxfwriter.cpp:23
QgsServerParameterDefinition::toInt
int toInt(bool &ok) const
Converts the parameter into an integer.
Definition: qgsserverparameters.cpp:313
QgsWms::QgsWmsParameters::allStyles
QStringList allStyles() const
Returns styles found in STYLE and STYLES parameters.
Definition: qgswmsparameters.cpp:1421
QgsServerParameterDefinition::mValue
QVariant mValue
Definition: qgsserverparameters.h:165
QgsDxfExport::SymbologyExport
SymbologyExport
Definition: qgsdxfexport.h:102
QgsWms::QgsWmsParameter::BGCOLOR
@ BGCOLOR
Definition: qgswmsparameters.h:167
QgsWms::QgsWmsParameters::backgroundColorAsColor
QColor backgroundColorAsColor() const
Returns BGCOLOR parameter as a QColor or its default value if not defined.
Definition: qgswmsparameters.cpp:1654
QgsWms::QgsWmsParameter::toGeomList
QList< QgsGeometry > toGeomList(const char delimiter=',') const
Converts the parameter into a list of geometries.
Definition: qgswmsparameters.cpp:55
QgsWms::QgsWmsParameter::TILED
@ TILED
Definition: qgswmsparameters.h:181
QgsWms::QgsWmsParameters::layerFontItalic
QString layerFontItalic() const
Returns LAYERFONTITALIC parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1117
QgsWms::QgsWmsParameter::LAYERS
@ LAYERS
Definition: qgswmsparameters.h:127
QgsWms::QgsWmsParameter::J
@ J
Definition: qgswmsparameters.h:149
QgsLegendSettings::setFontColor
void setFontColor(const QColor &c)
Sets the font color used for legend items.
Definition: qgslegendsettings.h:204
QgsDataSourceUri::encodedUri
QByteArray encodedUri() const
Returns the complete encoded URI as a byte array.
Definition: qgsdatasourceuri.cpp:610
QgsWms::QgsWmsParameters::layerSpace
QString layerSpace() const
Returns LAYERSPACE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:997
QgsWms::QgsWmsParameters::highlightLabelSizeAsInt
QList< int > highlightLabelSizeAsInt() const
Returns HIGHLIGHT_LABELSIZE as a list of int An exception is raised if an invalid size is found.
Definition: qgswmsparameters.cpp:1279
QgsWms::QgsWmsParameters::layoutParameter
QString layoutParameter(const QString &id, bool &ok) const
Returns a layout parameter thanks to its id.
Definition: qgswmsparameters.cpp:1250
QgsWms::QgsWmsParameters::atlasPk
QStringList atlasPk() const
Returns the ATLAS_PK parameter.
Definition: qgswmsparameters.cpp:1264
QgsWms::QgsWmsParameters::layerTitleAsBool
bool layerTitleAsBool() const
Returns LAYERTITLE as a bool or its default value if not defined.
Definition: qgswmsparameters.cpp:1215
QgsWms::QgsWmsParameter::HIGHLIGHT_LABELSIZE
@ HIGHLIGHT_LABELSIZE
Definition: qgswmsparameters.h:160
QgsWms::QgsWmsParameter::WITH_MAPTIP
@ WITH_MAPTIP
Definition: qgswmsparameters.h:175
QgsWms::QgsWmsParameters::highlightLabelColorAsColor
QList< QColor > highlightLabelColorAsColor() const
Returns HIGHLIGHT_LABELCOLOR as a list of color.
Definition: qgswmsparameters.cpp:1289
QgsWms::QgsWmsParameter::HIGHLIGHT_LABELWEIGHT
@ HIGHLIGHT_LABELWEIGHT
Definition: qgswmsparameters.h:161
QgsServerParameterDefinition::isValid
virtual bool isValid() const
Returns true if the parameter is valid, false otherwise.
Definition: qgsserverparameters.cpp:351
QgsWms::QgsWmsParameters::iconLabelSpaceAsDouble
double iconLabelSpaceAsDouble() const
Returns ICONLABELSPACE as a double or its default value if not defined.
Definition: qgswmsparameters.cpp:1052
QgsWms::QgsWmsParameters::scale
QString scale() const
Returns SCALE parameter or an empty string if none is defined.
Definition: qgswmsparameters.cpp:937
QgsWms::QgsWmsParameters::rule
QString rule() const
Returns RULE parameter or an empty string if none is defined.
Definition: qgswmsparameters.cpp:912
QgsWms::QgsWmsParameters::layerFontBoldAsBool
bool layerFontBoldAsBool() const
Returns LAYERFONTBOLD as a boolean or its default value if not defined.
Definition: qgswmsparameters.cpp:1072
QgsWms::QgsWmsParameter::isValid
bool isValid() const override
Returns true if the parameter is valid, false otherwise.
Definition: qgswmsparameters.cpp:39
QgsWms::QgsWmsParameters::polygonTolerance
QString polygonTolerance() const
Returns FI_POLYGON_TOLERANCE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1082
QgsWms::QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE
@ HIGHLIGHT_LABELBUFFERSIZE
Definition: qgswmsparameters.h:164
QgsWms::QgsWmsParameter::toStyleList
QStringList toStyleList(const char delimiter=',') const
Converts the parameter into a list of strings and keeps empty parts Default style value is an empty s...
Definition: qgswmsparameters.cpp:50
QgsMessageLog::logMessage
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
Definition: qgsmessagelog.cpp:27
QgsWms::QgsWmsParameters::withGeometry
bool withGeometry() const
Returns if the client wants the feature info response with geometry information.
Definition: qgswmsparameters.cpp:1908
QgsWms::QgsWmsParameters::jAsInt
int jAsInt() const
Returns J parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:887
QgsWms::QgsWmsParameter::FORMAT
@ FORMAT
Definition: qgswmsparameters.h:146
QgsServerParameters::urlQuery
QUrlQuery urlQuery() const
Returns a url query with underlying parameters.
Definition: qgsserverparameters.cpp:434
QgsWms::QgsWmsParameter::SLD_BODY
@ SLD_BODY
Definition: qgswmsparameters.h:140
QgsWms::QgsWmsParameters::dxfLayerAttributes
QStringList dxfLayerAttributes() const
Returns the DXF LAYERATTRIBUTES parameter.
Definition: qgswmsparameters.cpp:1964
QgsWms::QgsWmsParameter::WMTVER
@ WMTVER
Definition: qgswmsparameters.h:176
QgsWms::QgsWmsParameters::itemFontFamily
QString itemFontFamily() const
Returns ITEMFONTFAMILY parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1062
QgsWms::QgsWmsParameter::SYMBOLWIDTH
@ SYMBOLWIDTH
Definition: qgswmsparameters.h:137
QgsWms::QgsWmsParameter::SRCHEIGHT
@ SRCHEIGHT
Definition: qgswmsparameters.h:180
QgsWms::QgsWmsParameters::dxfMode
QgsDxfExport::SymbologyExport dxfMode() const
Returns the DXF MODE parameter.
Definition: qgswmsparameters.cpp:2003
QgsWms::QgsWmsParameters::y
QString y() const
Returns Y parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:897
QgsWms::QgsWmsParameters::tiledAsBool
bool tiledAsBool() const
Returns TILED parameter as a boolean.
Definition: qgswmsparameters.cpp:962
QgsWms::QgsWmsParameters::layerFontColor
QString layerFontColor() const
Returns LAYERFONTCOLOR parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1147
QgsWms::QgsWmsParameter
WMS parameter received from the client.
Definition: qgswmsparameters.h:99
QgsLegendSettings::setLayerFontColor
void setLayerFontColor(const QColor &fontColor)
Sets layer font color to fontColor Overrides fontColor()
Definition: qgslegendsettings.h:221
QgsWms::QgsWmsParametersHighlightLayer::mSld
QString mSld
Definition: qgswmsparameters.h:69
QgsWms::QgsWmsParameters::externalWMSUri
QString externalWMSUri(const QString &id) const
Returns the external WMS uri.
Definition: qgswmsparameters.cpp:1881
QgsWms::QgsWmsParameter::DPI
@ DPI
Definition: qgswmsparameters.h:168
QgsWms::QgsWmsParameter::SRCWIDTH
@ SRCWIDTH
Definition: qgswmsparameters.h:179
QgsServerParameters
QgsServerParameters provides an interface to retrieve and manipulate global parameters received from ...
Definition: qgsserverparameters.h:229
QgsWms::QgsWmsParametersHighlightLayer::mColor
QColor mColor
Definition: qgswmsparameters.h:71
QgsWms::QgsWmsParameter::toColorList
QList< QColor > toColorList(const char delimiter=',') const
Converts the parameter into a list of colors.
Definition: qgswmsparameters.cpp:139
QgsWms::QgsWmsParameters::formatAsString
QString formatAsString() const
Returns FORMAT parameter as a string.
Definition: qgswmsparameters.cpp:779
QgsWms::QgsWmsParameter::SYMBOLSPACE
@ SYMBOLSPACE
Definition: qgswmsparameters.h:135
QgsLegendSettings::rstyle
QgsLegendStyle & rstyle(QgsLegendStyle::Style s)
Returns modifiable reference to the style for a legend component.
Definition: qgslegendsettings.h:74
qgswmsserviceexception.h
QgsWms::QgsWmsParameters::iAsInt
int iAsInt() const
Returns I parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:882
QgsWms::QgsWmsParameter::HEIGHT
@ HEIGHT
Definition: qgswmsparameters.h:111
QgsWms::QgsWmsParameter::ICONLABELSPACE
@ ICONLABELSPACE
Definition: qgswmsparameters.h:113
QgsWms::QgsWmsParameters::infoFormat
Format infoFormat() const
Returns infoFormat.
Definition: qgswmsparameters.cpp:835
QgsWms::QgsWmsParameters::versionIsValid
bool versionIsValid(const QString version) const
Returns true if version is valid, false otherwise.
Definition: qgswmsparameters.cpp:774
QgsServerParameterDefinition::typeName
QString typeName() const
Returns the type of the parameter as a string.
Definition: qgsserverparameters.cpp:38
QgsWms::QgsWmsParameters::highlightGeomAsGeom
QList< QgsGeometry > highlightGeomAsGeom() const
Returns HIGHLIGHT_GEOM as a list of geometries.
Definition: qgswmsparameters.cpp:663
QgsServerParameterDefinition::toGeomList
QList< QgsGeometry > toGeomList(bool &ok, char delimiter=',') const
Converts the parameter into a list of geometries.
Definition: qgsserverparameters.cpp:92
QgsWms::QgsWmsParameters::filters
QStringList filters() const
Returns the list of filters found in FILTER parameter.
Definition: qgswmsparameters.cpp:1344
QgsDxfExport::SymbolLayerSymbology
@ SymbolLayerSymbology
Exports one feature per symbol layer (considering symbol levels)
Definition: qgsdxfexport.h:105
QgsServerParameterDefinition::toIntList
QList< int > toIntList(bool &ok, char delimiter=',') const
Converts the parameter into a list of integers.
Definition: qgsserverparameters.cpp:146
QgsWms::QgsWmsParameters::dxfUseLayerTitleAsName
bool dxfUseLayerTitleAsName() const
Returns the DXF USE_TITLE_AS_LAYERNAME parameter.
Definition: qgswmsparameters.cpp:1977
QgsWms::QgsWmsParameter::RULE
@ RULE
Definition: qgswmsparameters.h:152
QgsWms::QgsWmsParameters::pointTolerance
QString pointTolerance() const
Returns FI_POINT_TOLERANCE parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:1092
QgsDxfExport::NoSymbology
@ NoSymbology
Export only data.
Definition: qgsdxfexport.h:103
QgsWms::QgsWmsParameters::highlightLabelString
QStringList highlightLabelString() const
Returns HIGHLIGHT_LABELSTRING as a list of string.
Definition: qgswmsparameters.cpp:1269
QgsWms::QgsWmsParameters::dump
void dump() const
Dumps parameters.
Definition: qgswmsparameters.cpp:622
QgsDxfExport::FeatureSymbology
@ FeatureSymbology
Keeps the number of features and export symbology per feature (using the first symbol level)
Definition: qgsdxfexport.h:104
QgsBadRequestException
Exception thrown in case of malformed request.
Definition: qgsserverexception.h:122
QgsWms::QgsWmsParametersLayer::mOpacity
int mOpacity
Definition: qgswmsparameters.h:52
QgsWms::QgsWmsParameters::imageQualityAsInt
int imageQualityAsInt() const
Returns IMAGE_QUALITY parameter as an integer.
Definition: qgswmsparameters.cpp:952
QgsWms::QgsWmsParameters::dxfCodec
QString dxfCodec() const
Returns the DXF CODEC parameter.
Definition: qgswmsparameters.cpp:2027
QgsWms::QgsWmsParameter::ITEMFONTCOLOR
@ ITEMFONTCOLOR
Definition: qgswmsparameters.h:119
QgsWms::QgsWmsParameters::selections
QStringList selections() const
Returns the list of feature selection found in SELECTION parameter.
Definition: qgswmsparameters.cpp:1394
QgsWms::QgsWmsParameter::HIGHLIGHT_LABELCOLOR
@ HIGHLIGHT_LABELCOLOR
Definition: qgswmsparameters.h:162
QgsWms::QgsWmsParameter::CRS
@ CRS
Definition: qgswmsparameters.h:108
QgsWms::QgsWmsParameter::mId
int mId
Definition: qgswmsparameters.h:314
QgsWms::QgsWmsParameters::highlightLabelSize
QStringList highlightLabelSize() const
Returns HIGHLIGHT_LABELSIZE as a list of string.
Definition: qgswmsparameters.cpp:1274
QgsRectangle::isEmpty
bool isEmpty() const
Returns true if the rectangle is empty.
Definition: qgsrectangle.h:437
QgsWms::QgsWmsParameter::Name
Name
Available parameters for WMS requests.
Definition: qgswmsparameters.h:105
QgsWms::QgsWmsParameters::layerSpaceAsDouble
double layerSpaceAsDouble() const
Returns LAYERSPACE as a double or its default value if not defined.
Definition: qgswmsparameters.cpp:1002
QgsWms::QgsWmsParameters::symbolHeightAsDouble
double symbolHeightAsDouble() const
Returns SYMBOLHEIGHT as a double or its default value if not defined.
Definition: qgswmsparameters.cpp:1032
QgsWms::QgsWmsParameters::boxSpaceAsDouble
double boxSpaceAsDouble() const
Returns BOXSPACE as a double or its default value if not defined.
Definition: qgswmsparameters.cpp:992
QgsWms::QgsWmsParameters::highlightLayersParameters
QList< QgsWmsParametersHighlightLayer > highlightLayersParameters() const
Returns parameters for each highlight layer.
Definition: qgswmsparameters.cpp:1584
QgsOgcUtils::FILTER_FES_2_0
@ FILTER_FES_2_0
Definition: qgsogcutils.h:181
QgsWms::QgsWmsParameters::DxfFormatOption
DxfFormatOption
Options for DXF format.
Definition: qgswmsparameters.h:347
QgsWms::QgsWmsParameter::FILTER
@ FILTER
Definition: qgswmsparameters.h:144
QgsWms::QgsWmsParameters::dimensionValues
QMap< QString, QString > dimensionValues() const
Returns the dimensions parameter.
Definition: qgswmsparameters.cpp:2062
QgsWms::QgsWmsParameters::width
QString width() const
Returns WIDTH parameter or an empty string if not defined.
Definition: qgswmsparameters.cpp:711
QgsWms::QgsWmsParameter::STYLES
@ STYLES
Definition: qgswmsparameters.h:134
QgsServerParameterDefinition::toDoubleList
QList< double > toDoubleList(bool &ok, char delimiter=',') const
Converts the parameter into a list of doubles.
Definition: qgsserverparameters.cpp:166
QgsProjectVersion
A class to describe the version of a project.
Definition: qgsprojectversion.h:32
qgsvectorlayerserverproperties.h
QgsWms::QgsWmsParameters::srcWidthAsInt
int srcWidthAsInt() const
Returns SRCWIDTH parameter as an int or its default value if not defined.
Definition: qgswmsparameters.cpp:741
QgsWms::QgsWmsParametersExternalLayer::mUri
QString mUri
Definition: qgswmsparameters.h:62
QgsWms::QgsWmsParameters::allLayersNickname
QStringList allLayersNickname() const
Returns nickname of layers found in LAYER and LAYERS parameters.
Definition: qgswmsparameters.cpp:1409
QgsWms::QgsWmsParametersLayer::mFilter
QList< QgsWmsParametersFilter > mFilter
Definition: qgswmsparameters.h:53
QgsOgcUtils::FILTER_OGC_1_0
@ FILTER_OGC_1_0
Definition: qgsogcutils.h:179
QgsWms::QgsWmsParameters::highlightLabelBufferColorAsColor
QList< QColor > highlightLabelBufferColorAsColor() const
Returns HIGHLIGHT_LABELBUFFERCOLOR as a list of colors.
Definition: qgswmsparameters.cpp:1314
QgsWms::QgsWmsParameters::ruleLabel
QString ruleLabel() const
Returns RULELABEL parameter or an empty string if none is defined.
Definition: qgswmsparameters.cpp:917
QgsWms::QgsWmsParameters::dxfScale
double dxfScale() const
Returns the DXF SCALE parameter.
Definition: qgswmsparameters.cpp:1990
qgsmessagelog.h
QgsServerParameterDefinition::toRectangle
QgsRectangle toRectangle(bool &ok) const
Converts the parameter into a rectangle.
Definition: qgsserverparameters.cpp:186
QgsWms::QgsWmsParameter::SELECTION
@ SELECTION
Definition: qgswmsparameters.h:155
QgsServerParameterDefinition::toColorList
QList< QColor > toColorList(bool &ok, char delimiter=',') const
Converts the parameter into a list of colors.
Definition: qgsserverparameters.cpp:115
QgsWms::QgsWmsParameters::symbolWidthAsDouble
double symbolWidthAsDouble() const
Returns SYMBOLWIDTH as a double or its default value if not defined.
Definition: qgswmsparameters.cpp:1042
QgsWms::QgsWmsParameter::LAYERFONTITALIC
@ LAYERFONTITALIC
Definition: qgswmsparameters.h:123
QgsWms::QgsWmsParameters::noMText
bool noMText() const
Definition: qgswmsparameters.cpp:1496
QgsWms::QgsWmsParameters::layerFontColorAsColor
QColor layerFontColorAsColor() const
Returns LAYERFONTCOLOR as a color or its defined value if not defined.
Definition: qgswmsparameters.cpp:1152