QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgswfsgetcapabilities_1_0_0.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgswfsgecapabilities_1_0_0.cpp
3  -------------------------
4  begin : December 20 , 2016
5  copyright : (C) 2007 by Marco Hugentobler (original code)
6  (C) 2012 by René-Luc D'Hont (original code)
7  (C) 2014 by Alessandro Pasotti (original code)
8  (C) 2017 by David Marteau
9  email : marco dot hugentobler at karto dot baug dot ethz dot ch
10  a dot pasotti at itopen dot it
11  david dot marteau at 3liz dot com
12  ***************************************************************************/
13 
14 /***************************************************************************
15  * *
16  * This program is free software; you can redistribute it and/or modify *
17  * it under the terms of the GNU General Public License as published by *
18  * the Free Software Foundation; either version 2 of the License, or *
19  * (at your option) any later version. *
20  * *
21  ***************************************************************************/
22 #include "qgswfsutils.h"
23 #include "qgsserverprojectutils.h"
25 
26 #include "qgsproject.h"
27 #include "qgsvectorlayer.h"
28 #include "qgsvectordataprovider.h"
30 
31 namespace QgsWfs
32 {
33  namespace v1_0_0
34  {
35 
39  void writeGetCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
40  const QgsServerRequest &request, QgsServerResponse &response )
41  {
42 #ifdef HAVE_SERVER_PYTHON_PLUGINS
43  QgsAccessControl *accessControl = serverIface->accessControls();
44 #endif
45  QDomDocument doc;
46  const QDomDocument *capabilitiesDocument = nullptr;
47 
48 #ifdef HAVE_SERVER_PYTHON_PLUGINS
49  QgsServerCacheManager *cacheManager = serverIface->cacheManager();
50  if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
51  {
52  capabilitiesDocument = &doc;
53  }
54  else //capabilities xml not in cache. Create a new one
55  {
56  doc = createGetCapabilitiesDocument( serverIface, project, version, request );
57 
58  if ( cacheManager )
59  {
60  cacheManager->setCachedDocument( &doc, project, request, accessControl );
61  }
62  capabilitiesDocument = &doc;
63  }
64 #else
65  doc = createGetCapabilitiesDocument( serverIface, project, version, request );
66  capabilitiesDocument = &doc;
67 #endif
68  response.setHeader( QStringLiteral( "Content-Type" ), QStringLiteral( "text/xml; charset=utf-8" ) );
69  response.write( capabilitiesDocument->toByteArray() );
70  }
71 
72 
73  QDomDocument createGetCapabilitiesDocument( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
74  const QgsServerRequest &request )
75  {
76  Q_UNUSED( version )
77 
78  QDomDocument doc;
79 
80  //wfs:WFS_Capabilities element
81  QDomElement wfsCapabilitiesElement = doc.createElement( QStringLiteral( "WFS_Capabilities" )/*wms:WFS_Capabilities*/ );
82  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns" ), WFS_NAMESPACE );
83  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:xsi" ), QStringLiteral( "http://www.w3.org/2001/XMLSchema-instance" ) );
84  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xsi:schemaLocation" ), WFS_NAMESPACE + " http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd" );
85  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:ogc" ), OGC_NAMESPACE );
86  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:gml" ), GML_NAMESPACE );
87  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:ows" ), QStringLiteral( "http://www.opengis.net/ows" ) );
88  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:xlink" ), QStringLiteral( "http://www.w3.org/1999/xlink" ) );
89  wfsCapabilitiesElement.setAttribute( QStringLiteral( "version" ), QStringLiteral( "1.0.0" ) );
90  wfsCapabilitiesElement.setAttribute( QStringLiteral( "updateSequence" ), QStringLiteral( "0" ) );
91  doc.appendChild( wfsCapabilitiesElement );
92 
93  //wfs:Service
94  wfsCapabilitiesElement.appendChild( getServiceElement( doc, project ) );
95 
96  //wfs:Capability
97  wfsCapabilitiesElement.appendChild( getCapabilityElement( doc, project, request ) );
98 
99  //wfs:FeatureTypeList
100  wfsCapabilitiesElement.appendChild( getFeatureTypeListElement( doc, serverIface, project ) );
101 
102  /*
103  * Adding ogc:Filter_Capabilities in wfsCapabilitiesElement
104  */
105  //ogc:Filter_Capabilities element
106  QDomElement filterCapabilitiesElement = doc.createElement( QStringLiteral( "ogc:Filter_Capabilities" )/*ogc:Filter_Capabilities*/ );
107  wfsCapabilitiesElement.appendChild( filterCapabilitiesElement );
108  QDomElement spatialCapabilitiesElement = doc.createElement( QStringLiteral( "ogc:Spatial_Capabilities" )/*ogc:Spatial_Capabilities*/ );
109  filterCapabilitiesElement.appendChild( spatialCapabilitiesElement );
110  QDomElement spatialOperatorsElement = doc.createElement( QStringLiteral( "ogc:Spatial_Operators" )/*ogc:Spatial_Operators*/ );
111  spatialCapabilitiesElement.appendChild( spatialOperatorsElement );
112  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:BBOX" )/*ogc:BBOX*/ ) );
113  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Disjoint" )/*ogc:Disjoint*/ ) );
114  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Intersect" )/*ogc:Intersects*/ ) );
115  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Touches" )/*ogc:Touches*/ ) );
116  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Crosses" )/*ogc:Crosses*/ ) );
117  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Contains" )/*ogc:Contains*/ ) );
118  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Overlaps" )/*ogc:Overlaps*/ ) );
119  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Within" )/*ogc:Within*/ ) );
120  QDomElement scalarCapabilitiesElement = doc.createElement( QStringLiteral( "ogc:Scalar_Capabilities" )/*ogc:Scalar_Capabilities*/ );
121  filterCapabilitiesElement.appendChild( scalarCapabilitiesElement );
122  QDomElement comparisonOperatorsElement = doc.createElement( QStringLiteral( "ogc:Comparison_Operators" )/*ogc:Comparison_Operators*/ );
123  scalarCapabilitiesElement.appendChild( comparisonOperatorsElement );
124  comparisonOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Simple_Comparisons" )/*ogc:Simple_Comparisons*/ ) );
125  comparisonOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Between" )/*ogc:Between*/ ) );
126  comparisonOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Like" )/*ogc:Like*/ ) );
127 
128  return doc;
129 
130  }
131 
132  QDomElement getServiceElement( QDomDocument &doc, const QgsProject *project )
133  {
134  //Service element
135  QDomElement serviceElem = doc.createElement( QStringLiteral( "Service" ) );
136 
137  //Service name
138  QDomElement nameElem = doc.createElement( QStringLiteral( "Name" ) );
139  QDomText nameText = doc.createTextNode( "WFS" );
140  nameElem.appendChild( nameText );
141  serviceElem.appendChild( nameElem );
142 
143  const QString title = QgsServerProjectUtils::owsServiceTitle( *project );
144  if ( !title.isEmpty() )
145  {
146  QDomElement titleElem = doc.createElement( QStringLiteral( "Title" ) );
147  QDomText titleText = doc.createTextNode( title );
148  titleElem.appendChild( titleText );
149  serviceElem.appendChild( titleElem );
150  }
151 
152  const QString abstract = QgsServerProjectUtils::owsServiceAbstract( *project );
153  if ( !abstract.isEmpty() )
154  {
155  QDomElement abstractElem = doc.createElement( QStringLiteral( "Abstract" ) );
156  QDomText abstractText = doc.createCDATASection( abstract );
157  abstractElem.appendChild( abstractText );
158  serviceElem.appendChild( abstractElem );
159  }
160 
161  const QStringList keywords = QgsServerProjectUtils::owsServiceKeywords( *project );
162  if ( !keywords.isEmpty() && !keywords.join( QStringLiteral( ", " ) ).isEmpty() )
163  {
164  QDomElement keywordsElem = doc.createElement( QStringLiteral( "Keywords" ) );
165  QDomText keywordsText = doc.createTextNode( keywords.join( QStringLiteral( ", " ) ) );
166  keywordsElem.appendChild( keywordsText );
167  serviceElem.appendChild( keywordsElem );
168  }
169 
170  QDomElement onlineResourceElem = doc.createElement( QStringLiteral( "OnlineResource" ) );
171  const QString onlineResource = QgsServerProjectUtils::owsServiceOnlineResource( *project );
172  if ( !onlineResource.isEmpty() )
173  {
174  QDomText onlineResourceText = doc.createTextNode( onlineResource );
175  onlineResourceElem.appendChild( onlineResourceText );
176  }
177  serviceElem.appendChild( onlineResourceElem );
178 
179  const QString fees = QgsServerProjectUtils::owsServiceFees( *project );
180  if ( !fees.isEmpty() )
181  {
182  QDomElement feesElem = doc.createElement( QStringLiteral( "Fees" ) );
183  QDomText feesText = doc.createTextNode( fees );
184  feesElem.appendChild( feesText );
185  serviceElem.appendChild( feesElem );
186  }
187 
188  const QString accessConstraints = QgsServerProjectUtils::owsServiceAccessConstraints( *project );
189  if ( !accessConstraints.isEmpty() )
190  {
191  QDomElement accessConstraintsElem = doc.createElement( QStringLiteral( "AccessConstraints" ) );
192  QDomText accessConstraintsText = doc.createTextNode( accessConstraints );
193  accessConstraintsElem.appendChild( accessConstraintsText );
194  serviceElem.appendChild( accessConstraintsElem );
195  }
196 
197  return serviceElem;
198 
199  }
200 
201  QDomElement getCapabilityElement( QDomDocument &doc, const QgsProject *project, const QgsServerRequest &request )
202  {
203  //wfs:Capability element
204  QDomElement capabilityElement = doc.createElement( QStringLiteral( "Capability" )/*wfs:Capability*/ );
205 
206  //wfs:Request element
207  QDomElement requestElement = doc.createElement( QStringLiteral( "Request" )/*wfs:Request*/ );
208  capabilityElement.appendChild( requestElement );
209  //wfs:GetCapabilities
210  QDomElement getCapabilitiesElement = doc.createElement( QStringLiteral( "GetCapabilities" )/*wfs:GetCapabilities*/ );
211  requestElement.appendChild( getCapabilitiesElement );
212 
213  QDomElement dcpTypeElement = doc.createElement( QStringLiteral( "DCPType" )/*wfs:DCPType*/ );
214  getCapabilitiesElement.appendChild( dcpTypeElement );
215  QDomElement httpElement = doc.createElement( QStringLiteral( "HTTP" )/*wfs:HTTP*/ );
216  dcpTypeElement.appendChild( httpElement );
217 
218  //Prepare url
219  QString hrefString = serviceUrl( request, project );
220 
221  //only Get supported for the moment
222  QDomElement getElement = doc.createElement( QStringLiteral( "Get" )/*wfs:Get*/ );
223  httpElement.appendChild( getElement );
224  getElement.setAttribute( QStringLiteral( "onlineResource" ), hrefString );
225  QDomElement getCapabilitiesDhcTypePostElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
226  getCapabilitiesDhcTypePostElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
227  getCapabilitiesElement.appendChild( getCapabilitiesDhcTypePostElement );
228 
229  //wfs:DescribeFeatureType
230  QDomElement describeFeatureTypeElement = doc.createElement( QStringLiteral( "DescribeFeatureType" )/*wfs:DescribeFeatureType*/ );
231  requestElement.appendChild( describeFeatureTypeElement );
232  QDomElement schemaDescriptionLanguageElement = doc.createElement( QStringLiteral( "SchemaDescriptionLanguage" )/*wfs:SchemaDescriptionLanguage*/ );
233  describeFeatureTypeElement.appendChild( schemaDescriptionLanguageElement );
234  QDomElement xmlSchemaElement = doc.createElement( QStringLiteral( "XMLSCHEMA" )/*wfs:XMLSCHEMA*/ );
235  schemaDescriptionLanguageElement.appendChild( xmlSchemaElement );
236  QDomElement describeFeatureTypeDhcTypeElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
237  describeFeatureTypeElement.appendChild( describeFeatureTypeDhcTypeElement );
238  QDomElement describeFeatureTypeDhcTypePostElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
239  describeFeatureTypeDhcTypePostElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
240  describeFeatureTypeElement.appendChild( describeFeatureTypeDhcTypePostElement );
241 
242  //wfs:GetFeature
243  QDomElement getFeatureElement = doc.createElement( QStringLiteral( "GetFeature" )/*wfs:GetFeature*/ );
244  requestElement.appendChild( getFeatureElement );
245  QDomElement getFeatureFormatElement = doc.createElement( QStringLiteral( "ResultFormat" ) );/*wfs:ResultFormat*/
246  getFeatureElement.appendChild( getFeatureFormatElement );
247  QDomElement gmlFormatElement = doc.createElement( QStringLiteral( "GML2" ) );/*wfs:GML2*/
248  getFeatureFormatElement.appendChild( gmlFormatElement );
249  QDomElement gml3FormatElement = doc.createElement( QStringLiteral( "GML3" ) );/*wfs:GML3*/
250  getFeatureFormatElement.appendChild( gml3FormatElement );
251  QDomElement geojsonFormatElement = doc.createElement( QStringLiteral( "GeoJSON" ) );/*wfs:GeoJSON*/
252  getFeatureFormatElement.appendChild( geojsonFormatElement );
253  QDomElement getFeatureDhcTypeGetElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
254  getFeatureElement.appendChild( getFeatureDhcTypeGetElement );
255  QDomElement getFeatureDhcTypePostElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
256  getFeatureDhcTypePostElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
257  getFeatureElement.appendChild( getFeatureDhcTypePostElement );
258 
259  //wfs:Transaction
260  QDomElement transactionElement = doc.createElement( QStringLiteral( "Transaction" )/*wfs:Transaction*/ );
261  requestElement.appendChild( transactionElement );
262  QDomElement transactionDhcTypeElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
263  transactionDhcTypeElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
264  transactionElement.appendChild( transactionDhcTypeElement );
265 
266  return capabilityElement;
267  }
268 
269  QDomElement getFeatureTypeListElement( QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project )
270  {
271 #ifdef HAVE_SERVER_PYTHON_PLUGINS
272  QgsAccessControl *accessControl = serverIface->accessControls();
273 #else
274  ( void )serverIface;
275 #endif
276 
277  //wfs:FeatureTypeList element
278  QDomElement featureTypeListElement = doc.createElement( QStringLiteral( "FeatureTypeList" )/*wfs:FeatureTypeList*/ );
279  //wfs:Operations element
280  QDomElement operationsElement = doc.createElement( QStringLiteral( "Operations" )/*wfs:Operations*/ );
281  featureTypeListElement.appendChild( operationsElement );
282  //wfs:Query element
283  QDomElement queryElement = doc.createElement( QStringLiteral( "Query" )/*wfs:Query*/ );
284  operationsElement.appendChild( queryElement );
285 
286  const QStringList wfsLayerIds = QgsServerProjectUtils::wfsLayerIds( *project );
287  const QStringList wfstUpdateLayersId = QgsServerProjectUtils::wfstUpdateLayerIds( *project );
288  const QStringList wfstInsertLayersId = QgsServerProjectUtils::wfstInsertLayerIds( *project );
289  const QStringList wfstDeleteLayersId = QgsServerProjectUtils::wfstDeleteLayerIds( *project );
290  for ( const QString &wfsLayerId : wfsLayerIds )
291  {
292  QgsMapLayer *layer = project->mapLayer( wfsLayerId );
293  if ( !layer )
294  {
295  continue;
296  }
297  if ( layer->type() != QgsMapLayerType::VectorLayer )
298  {
299  continue;
300  }
301 #ifdef HAVE_SERVER_PYTHON_PLUGINS
302  if ( accessControl && !accessControl->layerReadPermission( layer ) )
303  {
304  continue;
305  }
306 #endif
307  QDomElement layerElem = doc.createElement( QStringLiteral( "FeatureType" ) );
308 
309  //create Name
310  QDomElement nameElem = doc.createElement( QStringLiteral( "Name" ) );
311  QString typeName = layer->name();
312  if ( !layer->shortName().isEmpty() )
313  typeName = layer->shortName();
314  typeName = typeName.replace( QLatin1String( " " ), QLatin1String( "_" ) );
315  QDomText nameText = doc.createTextNode( typeName );
316  nameElem.appendChild( nameText );
317  layerElem.appendChild( nameElem );
318 
319  //create Title
320  QDomElement titleElem = doc.createElement( QStringLiteral( "Title" ) );
321  QString title = layer->title();
322  if ( title.isEmpty() )
323  {
324  title = layer->name();
325  }
326  QDomText titleText = doc.createTextNode( title );
327  titleElem.appendChild( titleText );
328  layerElem.appendChild( titleElem );
329 
330  //create Abstract
331  QString abstract = layer->abstract();
332  if ( !abstract.isEmpty() )
333  {
334  QDomElement abstractElem = doc.createElement( QStringLiteral( "Abstract" ) );
335  QDomText abstractText = doc.createTextNode( abstract );
336  abstractElem.appendChild( abstractText );
337  layerElem.appendChild( abstractElem );
338  }
339 
340  //create keywords
341  QString keywords = layer->keywordList();
342  if ( !keywords.isEmpty() )
343  {
344  QDomElement keywordsElem = doc.createElement( QStringLiteral( "Keywords" ) );
345  QDomText keywordsText = doc.createTextNode( keywords );
346  keywordsElem.appendChild( keywordsText );
347  layerElem.appendChild( keywordsElem );
348  }
349 
350  //create SRS
351  QDomElement srsElem = doc.createElement( QStringLiteral( "SRS" ) );
352  QDomText srsText = doc.createTextNode( layer->crs().authid() );
353  srsElem.appendChild( srsText );
354  layerElem.appendChild( srsElem );
355 
356  //create LatLongBoundingBox
357  QgsRectangle layerExtent = layer->extent();
358  QDomElement bBoxElement = doc.createElement( QStringLiteral( "LatLongBoundingBox" ) );
359  bBoxElement.setAttribute( QStringLiteral( "minx" ), QString::number( layerExtent.xMinimum() ) );
360  bBoxElement.setAttribute( QStringLiteral( "miny" ), QString::number( layerExtent.yMinimum() ) );
361  bBoxElement.setAttribute( QStringLiteral( "maxx" ), QString::number( layerExtent.xMaximum() ) );
362  bBoxElement.setAttribute( QStringLiteral( "maxy" ), QString::number( layerExtent.yMaximum() ) );
363  layerElem.appendChild( bBoxElement );
364 
365  // layer metadata URL
366  QString metadataUrl = layer->metadataUrl();
367  if ( !metadataUrl.isEmpty() )
368  {
369  QDomElement metaUrlElem = doc.createElement( QStringLiteral( "MetadataURL" ) );
370  QString metadataUrlType = layer->metadataUrlType();
371  metaUrlElem.setAttribute( QStringLiteral( "type" ), metadataUrlType );
372  QString metadataUrlFormat = layer->metadataUrlFormat();
373  if ( metadataUrlFormat == QLatin1String( "text/xml" ) )
374  {
375  metaUrlElem.setAttribute( QStringLiteral( "format" ), QStringLiteral( "XML" ) );
376  }
377  else
378  {
379  metaUrlElem.setAttribute( QStringLiteral( "format" ), QStringLiteral( "TXT" ) );
380  }
381  QDomText metaUrlText = doc.createTextNode( metadataUrl );
382  metaUrlElem.appendChild( metaUrlText );
383  layerElem.appendChild( metaUrlElem );
384  }
385 
386  //wfs:Operations element
387  QDomElement operationsElement = doc.createElement( QStringLiteral( "Operations" )/*wfs:Operations*/ );
388  //wfs:Query element
389  QDomElement queryElement = doc.createElement( QStringLiteral( "Query" )/*wfs:Query*/ );
390  operationsElement.appendChild( queryElement );
391  if ( wfstUpdateLayersId.contains( layer->id() ) ||
392  wfstInsertLayersId.contains( layer->id() ) ||
393  wfstDeleteLayersId.contains( layer->id() ) )
394  {
395  QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
396  QgsVectorDataProvider *provider = vlayer->dataProvider();
397  if ( ( provider->capabilities() & QgsVectorDataProvider::AddFeatures ) && wfstInsertLayersId.contains( layer->id() ) )
398  {
399  //wfs:Insert element
400  QDomElement insertElement = doc.createElement( QStringLiteral( "Insert" )/*wfs:Insert*/ );
401  operationsElement.appendChild( insertElement );
402  }
403  if ( ( provider->capabilities() & QgsVectorDataProvider::ChangeAttributeValues ) &&
404  ( provider->capabilities() & QgsVectorDataProvider::ChangeGeometries ) &&
405  wfstUpdateLayersId.contains( layer->id() ) )
406  {
407  //wfs:Update element
408  QDomElement updateElement = doc.createElement( QStringLiteral( "Update" )/*wfs:Update*/ );
409  operationsElement.appendChild( updateElement );
410  }
411  if ( ( provider->capabilities() & QgsVectorDataProvider::DeleteFeatures ) && wfstDeleteLayersId.contains( layer->id() ) )
412  {
413  //wfs:Delete element
414  QDomElement deleteElement = doc.createElement( QStringLiteral( "Delete" )/*wfs:Delete*/ );
415  operationsElement.appendChild( deleteElement );
416  }
417  }
418 
419  layerElem.appendChild( operationsElement );
420 
421  featureTypeListElement.appendChild( layerElem );
422  }
423 
424  return featureTypeListElement;
425  }
426 
427  } // namespace v1_0_0
428 } // namespace QgsWfs
429 
430 
431 
QDomElement getCapabilityElement(QDomDocument &doc, const QgsProject *project, const QgsServerRequest &request)
Create Capability element for get capabilities document.
virtual void setHeader(const QString &key, const QString &value)=0
Set Header entry Add Header entry to the response Note that it is usually an error to set Header afte...
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Base class for all map layer types.
Definition: qgsmaplayer.h:79
SERVER_EXPORT QStringList wfstUpdateLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities...
QgsMapLayerType type() const
Returns the type of the layer.
SERVER_EXPORT QStringList owsServiceKeywords(const QgsProject &project)
Returns the owsService keywords defined in project.
QString shortName() const
Returns the short name of the layer used by QGIS Server to identify the layer.
QDomDocument createGetCapabilitiesDocument(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request)
Create get capabilities document.
SERVER_EXPORT QString owsServiceAbstract(const QgsProject &project)
Returns the owsService abstract defined in project.
QString abstract() const
Returns the abstract of the layer used by QGIS Server in GetCapabilities request. ...
Definition: qgsmaplayer.h:295
virtual void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device...
virtual QgsRectangle extent() const
Returns the extent of the layer.
QString metadataUrlFormat() const
Returns the metadata format of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:443
QString serviceUrl(const QgsServerRequest &request, const QgsProject *project)
Service URL string.
Definition: qgswfsutils.cpp:37
QString id() const
Returns the layer&#39;s unique ID, which is used to access this layer from QgsProject.
SERVER_EXPORT QStringList wfstDeleteLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities...
const QString & typeName
WMS implementation.
Definition: qgswfs.cpp:35
QString keywordList() const
Returns the keyword list of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:311
const QString GML_NAMESPACE
Definition: qgswfsutils.h:72
void writeGetCapabilities(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response)
Output WFS GetCapabilities response.
const QString WFS_NAMESPACE
Definition: qgswfsutils.h:71
A helper class that centralizes caches accesses given by all the server cache filter plugins...
Allows modifications of geometries.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Definition: qgsproject.h:89
SERVER_EXPORT QString owsServiceFees(const QgsProject &project)
Returns the owsService fees defined in project.
bool getCachedDocument(QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Returns cached document (or 0 if document not in cache) like capabilities.
SERVER_EXPORT QString owsServiceAccessConstraints(const QgsProject &project)
Returns the owsService access constraints defined in project.
SERVER_EXPORT QString owsServiceOnlineResource(const QgsProject &project)
Returns the owsService online resource defined in project.
QString title() const
Returns the title of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:279
double yMinimum() const
Returns the y minimum value (bottom side of rectangle).
Definition: qgsrectangle.h:177
const QString OGC_NAMESPACE
Definition: qgswfsutils.h:73
double xMaximum() const
Returns the x maximum value (right side of rectangle).
Definition: qgsrectangle.h:162
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
bool layerReadPermission(const QgsMapLayer *layer) const
Returns the layer read right.
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
QDomElement getServiceElement(QDomDocument &doc, const QgsProject *project)
Create Service element for get capabilities document.
SERVER_EXPORT QStringList wfsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WFS.
bool setCachedDocument(const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Updates or inserts the document in cache like capabilities.
virtual QgsServerCacheManager * cacheManager() const =0
Gets the registered server cache filters.
double xMinimum() const
Returns the x minimum value (left side of rectangle).
Definition: qgsrectangle.h:167
A helper class that centralizes restrictions given by all the access control filter plugins...
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
SERVER_EXPORT QStringList wfstInsertLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities...
QString metadataUrl() const
Returns the metadata URL of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:407
double yMaximum() const
Returns the y maximum value (top side of rectangle).
Definition: qgsrectangle.h:172
QString name
Definition: qgsmaplayer.h:83
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
virtual QgsAccessControl * accessControls() const =0
Gets the registered access control filters.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer&#39;s data provider, it may be nullptr.
QDomElement getFeatureTypeListElement(QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project)
Create FeatureTypeList element for get capabilities document.
This is the base class for vector data providers.
Represents a vector layer which manages a vector based data sets.
Allows modification of attribute values.
QString authid() const
Returns the authority identifier for the CRS.
SERVER_EXPORT QString owsServiceTitle(const QgsProject &project)
Returns the owsService title defined in project.
QgsCoordinateReferenceSystem crs
Definition: qgsmaplayer.h:86
QString metadataUrlType() const
Returns the metadata type of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:425