QGIS API Documentation  3.8.0-Zanzibar (11aff65)
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 #endif
67  response.setHeader( QStringLiteral( "Content-Type" ), QStringLiteral( "text/xml; charset=utf-8" ) );
68  response.write( capabilitiesDocument->toByteArray() );
69  }
70 
71 
72  QDomDocument createGetCapabilitiesDocument( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
73  const QgsServerRequest &request )
74  {
75  Q_UNUSED( version )
76 
77  QDomDocument doc;
78 
79  //wfs:WFS_Capabilities element
80  QDomElement wfsCapabilitiesElement = doc.createElement( QStringLiteral( "WFS_Capabilities" )/*wms:WFS_Capabilities*/ );
81  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns" ), WFS_NAMESPACE );
82  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:xsi" ), QStringLiteral( "http://www.w3.org/2001/XMLSchema-instance" ) );
83  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xsi:schemaLocation" ), WFS_NAMESPACE + " http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd" );
84  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:ogc" ), OGC_NAMESPACE );
85  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:gml" ), GML_NAMESPACE );
86  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:ows" ), QStringLiteral( "http://www.opengis.net/ows" ) );
87  wfsCapabilitiesElement.setAttribute( QStringLiteral( "xmlns:xlink" ), QStringLiteral( "http://www.w3.org/1999/xlink" ) );
88  wfsCapabilitiesElement.setAttribute( QStringLiteral( "version" ), QStringLiteral( "1.0.0" ) );
89  wfsCapabilitiesElement.setAttribute( QStringLiteral( "updateSequence" ), QStringLiteral( "0" ) );
90  doc.appendChild( wfsCapabilitiesElement );
91 
92  //wfs:Service
93  wfsCapabilitiesElement.appendChild( getServiceElement( doc, project ) );
94 
95  //wfs:Capability
96  wfsCapabilitiesElement.appendChild( getCapabilityElement( doc, project, request ) );
97 
98  //wfs:FeatureTypeList
99  wfsCapabilitiesElement.appendChild( getFeatureTypeListElement( doc, serverIface, project ) );
100 
101  /*
102  * Adding ogc:Filter_Capabilities in wfsCapabilitiesElement
103  */
104  //ogc:Filter_Capabilities element
105  QDomElement filterCapabilitiesElement = doc.createElement( QStringLiteral( "ogc:Filter_Capabilities" )/*ogc:Filter_Capabilities*/ );
106  wfsCapabilitiesElement.appendChild( filterCapabilitiesElement );
107  QDomElement spatialCapabilitiesElement = doc.createElement( QStringLiteral( "ogc:Spatial_Capabilities" )/*ogc:Spatial_Capabilities*/ );
108  filterCapabilitiesElement.appendChild( spatialCapabilitiesElement );
109  QDomElement spatialOperatorsElement = doc.createElement( QStringLiteral( "ogc:Spatial_Operators" )/*ogc:Spatial_Operators*/ );
110  spatialCapabilitiesElement.appendChild( spatialOperatorsElement );
111  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:BBOX" )/*ogc:BBOX*/ ) );
112  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Disjoint" )/*ogc:Disjoint*/ ) );
113  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Intersect" )/*ogc:Intersects*/ ) );
114  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Touches" )/*ogc:Touches*/ ) );
115  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Crosses" )/*ogc:Crosses*/ ) );
116  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Contains" )/*ogc:Contains*/ ) );
117  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Overlaps" )/*ogc:Overlaps*/ ) );
118  spatialOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Within" )/*ogc:Within*/ ) );
119  QDomElement scalarCapabilitiesElement = doc.createElement( QStringLiteral( "ogc:Scalar_Capabilities" )/*ogc:Scalar_Capabilities*/ );
120  filterCapabilitiesElement.appendChild( scalarCapabilitiesElement );
121  QDomElement comparisonOperatorsElement = doc.createElement( QStringLiteral( "ogc:Comparison_Operators" )/*ogc:Comparison_Operators*/ );
122  scalarCapabilitiesElement.appendChild( comparisonOperatorsElement );
123  comparisonOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Simple_Comparisons" )/*ogc:Simple_Comparisons*/ ) );
124  comparisonOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Between" )/*ogc:Between*/ ) );
125  comparisonOperatorsElement.appendChild( doc.createElement( QStringLiteral( "ogc:Like" )/*ogc:Like*/ ) );
126 
127  return doc;
128 
129  }
130 
131  QDomElement getServiceElement( QDomDocument &doc, const QgsProject *project )
132  {
133  //Service element
134  QDomElement serviceElem = doc.createElement( QStringLiteral( "Service" ) );
135 
136  //Service name
137  QDomElement nameElem = doc.createElement( QStringLiteral( "Name" ) );
138  QDomText nameText = doc.createTextNode( "WFS" );
139  nameElem.appendChild( nameText );
140  serviceElem.appendChild( nameElem );
141 
142  const QString title = QgsServerProjectUtils::owsServiceTitle( *project );
143  if ( !title.isEmpty() )
144  {
145  QDomElement titleElem = doc.createElement( QStringLiteral( "Title" ) );
146  QDomText titleText = doc.createTextNode( title );
147  titleElem.appendChild( titleText );
148  serviceElem.appendChild( titleElem );
149  }
150 
151  const QString abstract = QgsServerProjectUtils::owsServiceAbstract( *project );
152  if ( !abstract.isEmpty() )
153  {
154  QDomElement abstractElem = doc.createElement( QStringLiteral( "Abstract" ) );
155  QDomText abstractText = doc.createCDATASection( abstract );
156  abstractElem.appendChild( abstractText );
157  serviceElem.appendChild( abstractElem );
158  }
159 
160  const QStringList keywords = QgsServerProjectUtils::owsServiceKeywords( *project );
161  if ( !keywords.isEmpty() && !keywords.join( QStringLiteral( ", " ) ).isEmpty() )
162  {
163  QDomElement keywordsElem = doc.createElement( QStringLiteral( "Keywords" ) );
164  QDomText keywordsText = doc.createTextNode( keywords.join( QStringLiteral( ", " ) ) );
165  keywordsElem.appendChild( keywordsText );
166  serviceElem.appendChild( keywordsElem );
167  }
168 
169  QDomElement onlineResourceElem = doc.createElement( QStringLiteral( "OnlineResource" ) );
170  const QString onlineResource = QgsServerProjectUtils::owsServiceOnlineResource( *project );
171  if ( !onlineResource.isEmpty() )
172  {
173  QDomText onlineResourceText = doc.createTextNode( onlineResource );
174  onlineResourceElem.appendChild( onlineResourceText );
175  }
176  serviceElem.appendChild( onlineResourceElem );
177 
178  const QString fees = QgsServerProjectUtils::owsServiceFees( *project );
179  if ( !fees.isEmpty() )
180  {
181  QDomElement feesElem = doc.createElement( QStringLiteral( "Fees" ) );
182  QDomText feesText = doc.createTextNode( fees );
183  feesElem.appendChild( feesText );
184  serviceElem.appendChild( feesElem );
185  }
186 
187  const QString accessConstraints = QgsServerProjectUtils::owsServiceAccessConstraints( *project );
188  if ( !accessConstraints.isEmpty() )
189  {
190  QDomElement accessConstraintsElem = doc.createElement( QStringLiteral( "AccessConstraints" ) );
191  QDomText accessConstraintsText = doc.createTextNode( accessConstraints );
192  accessConstraintsElem.appendChild( accessConstraintsText );
193  serviceElem.appendChild( accessConstraintsElem );
194  }
195 
196  return serviceElem;
197 
198  }
199 
200  QDomElement getCapabilityElement( QDomDocument &doc, const QgsProject *project, const QgsServerRequest &request )
201  {
202  //wfs:Capability element
203  QDomElement capabilityElement = doc.createElement( QStringLiteral( "Capability" )/*wfs:Capability*/ );
204 
205  //wfs:Request element
206  QDomElement requestElement = doc.createElement( QStringLiteral( "Request" )/*wfs:Request*/ );
207  capabilityElement.appendChild( requestElement );
208  //wfs:GetCapabilities
209  QDomElement getCapabilitiesElement = doc.createElement( QStringLiteral( "GetCapabilities" )/*wfs:GetCapabilities*/ );
210  requestElement.appendChild( getCapabilitiesElement );
211 
212  QDomElement dcpTypeElement = doc.createElement( QStringLiteral( "DCPType" )/*wfs:DCPType*/ );
213  getCapabilitiesElement.appendChild( dcpTypeElement );
214  QDomElement httpElement = doc.createElement( QStringLiteral( "HTTP" )/*wfs:HTTP*/ );
215  dcpTypeElement.appendChild( httpElement );
216 
217  //Prepare url
218  QString hrefString = serviceUrl( request, project );
219 
220  //only Get supported for the moment
221  QDomElement getElement = doc.createElement( QStringLiteral( "Get" )/*wfs:Get*/ );
222  httpElement.appendChild( getElement );
223  getElement.setAttribute( QStringLiteral( "onlineResource" ), hrefString );
224  QDomElement getCapabilitiesDhcTypePostElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
225  getCapabilitiesDhcTypePostElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
226  getCapabilitiesElement.appendChild( getCapabilitiesDhcTypePostElement );
227 
228  //wfs:DescribeFeatureType
229  QDomElement describeFeatureTypeElement = doc.createElement( QStringLiteral( "DescribeFeatureType" )/*wfs:DescribeFeatureType*/ );
230  requestElement.appendChild( describeFeatureTypeElement );
231  QDomElement schemaDescriptionLanguageElement = doc.createElement( QStringLiteral( "SchemaDescriptionLanguage" )/*wfs:SchemaDescriptionLanguage*/ );
232  describeFeatureTypeElement.appendChild( schemaDescriptionLanguageElement );
233  QDomElement xmlSchemaElement = doc.createElement( QStringLiteral( "XMLSCHEMA" )/*wfs:XMLSCHEMA*/ );
234  schemaDescriptionLanguageElement.appendChild( xmlSchemaElement );
235  QDomElement describeFeatureTypeDhcTypeElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
236  describeFeatureTypeElement.appendChild( describeFeatureTypeDhcTypeElement );
237  QDomElement describeFeatureTypeDhcTypePostElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
238  describeFeatureTypeDhcTypePostElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
239  describeFeatureTypeElement.appendChild( describeFeatureTypeDhcTypePostElement );
240 
241  //wfs:GetFeature
242  QDomElement getFeatureElement = doc.createElement( QStringLiteral( "GetFeature" )/*wfs:GetFeature*/ );
243  requestElement.appendChild( getFeatureElement );
244  QDomElement getFeatureFormatElement = doc.createElement( QStringLiteral( "ResultFormat" ) );/*wfs:ResultFormat*/
245  getFeatureElement.appendChild( getFeatureFormatElement );
246  QDomElement gmlFormatElement = doc.createElement( QStringLiteral( "GML2" ) );/*wfs:GML2*/
247  getFeatureFormatElement.appendChild( gmlFormatElement );
248  QDomElement gml3FormatElement = doc.createElement( QStringLiteral( "GML3" ) );/*wfs:GML3*/
249  getFeatureFormatElement.appendChild( gml3FormatElement );
250  QDomElement geojsonFormatElement = doc.createElement( QStringLiteral( "GeoJSON" ) );/*wfs:GeoJSON*/
251  getFeatureFormatElement.appendChild( geojsonFormatElement );
252  QDomElement getFeatureDhcTypeGetElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
253  getFeatureElement.appendChild( getFeatureDhcTypeGetElement );
254  QDomElement getFeatureDhcTypePostElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
255  getFeatureDhcTypePostElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
256  getFeatureElement.appendChild( getFeatureDhcTypePostElement );
257 
258  //wfs:Transaction
259  QDomElement transactionElement = doc.createElement( QStringLiteral( "Transaction" )/*wfs:Transaction*/ );
260  requestElement.appendChild( transactionElement );
261  QDomElement transactionDhcTypeElement = dcpTypeElement.cloneNode().toElement();//this is the same as for 'GetCapabilities'
262  transactionDhcTypeElement.firstChild().firstChild().toElement().setTagName( QStringLiteral( "Post" ) );
263  transactionElement.appendChild( transactionDhcTypeElement );
264 
265  return capabilityElement;
266  }
267 
268  QDomElement getFeatureTypeListElement( QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project )
269  {
270 #ifdef HAVE_SERVER_PYTHON_PLUGINS
271  QgsAccessControl *accessControl = serverIface->accessControls();
272 #else
273  ( void )serverIface;
274 #endif
275 
276  //wfs:FeatureTypeList element
277  QDomElement featureTypeListElement = doc.createElement( QStringLiteral( "FeatureTypeList" )/*wfs:FeatureTypeList*/ );
278  //wfs:Operations element
279  QDomElement operationsElement = doc.createElement( QStringLiteral( "Operations" )/*wfs:Operations*/ );
280  featureTypeListElement.appendChild( operationsElement );
281  //wfs:Query element
282  QDomElement queryElement = doc.createElement( QStringLiteral( "Query" )/*wfs:Query*/ );
283  operationsElement.appendChild( queryElement );
284 
285  const QStringList wfsLayerIds = QgsServerProjectUtils::wfsLayerIds( *project );
286  const QStringList wfstUpdateLayersId = QgsServerProjectUtils::wfstUpdateLayerIds( *project );
287  const QStringList wfstInsertLayersId = QgsServerProjectUtils::wfstInsertLayerIds( *project );
288  const QStringList wfstDeleteLayersId = QgsServerProjectUtils::wfstDeleteLayerIds( *project );
289  for ( const QString &wfsLayerId : wfsLayerIds )
290  {
291  QgsMapLayer *layer = project->mapLayer( wfsLayerId );
292  if ( !layer )
293  {
294  continue;
295  }
296  if ( layer->type() != QgsMapLayerType::VectorLayer )
297  {
298  continue;
299  }
300 #ifdef HAVE_SERVER_PYTHON_PLUGINS
301  if ( accessControl && !accessControl->layerReadPermission( layer ) )
302  {
303  continue;
304  }
305 #endif
306  QDomElement layerElem = doc.createElement( QStringLiteral( "FeatureType" ) );
307 
308  //create Name
309  QDomElement nameElem = doc.createElement( QStringLiteral( "Name" ) );
310  QString typeName = layer->name();
311  if ( !layer->shortName().isEmpty() )
312  typeName = layer->shortName();
313  typeName = typeName.replace( QLatin1String( " " ), QLatin1String( "_" ) );
314  QDomText nameText = doc.createTextNode( typeName );
315  nameElem.appendChild( nameText );
316  layerElem.appendChild( nameElem );
317 
318  //create Title
319  QDomElement titleElem = doc.createElement( QStringLiteral( "Title" ) );
320  QString title = layer->title();
321  if ( title.isEmpty() )
322  {
323  title = layer->name();
324  }
325  QDomText titleText = doc.createTextNode( title );
326  titleElem.appendChild( titleText );
327  layerElem.appendChild( titleElem );
328 
329  //create Abstract
330  QString abstract = layer->abstract();
331  if ( !abstract.isEmpty() )
332  {
333  QDomElement abstractElem = doc.createElement( QStringLiteral( "Abstract" ) );
334  QDomText abstractText = doc.createTextNode( abstract );
335  abstractElem.appendChild( abstractText );
336  layerElem.appendChild( abstractElem );
337  }
338 
339  //create keywords
340  QString keywords = layer->keywordList();
341  if ( !keywords.isEmpty() )
342  {
343  QDomElement keywordsElem = doc.createElement( QStringLiteral( "Keywords" ) );
344  QDomText keywordsText = doc.createTextNode( keywords );
345  keywordsElem.appendChild( keywordsText );
346  layerElem.appendChild( keywordsElem );
347  }
348 
349  //create SRS
350  QDomElement srsElem = doc.createElement( QStringLiteral( "SRS" ) );
351  QDomText srsText = doc.createTextNode( layer->crs().authid() );
352  srsElem.appendChild( srsText );
353  layerElem.appendChild( srsElem );
354 
355  //create LatLongBoundingBox
356  QgsRectangle layerExtent = layer->extent();
357  QDomElement bBoxElement = doc.createElement( QStringLiteral( "LatLongBoundingBox" ) );
358  bBoxElement.setAttribute( QStringLiteral( "minx" ), QString::number( layerExtent.xMinimum() ) );
359  bBoxElement.setAttribute( QStringLiteral( "miny" ), QString::number( layerExtent.yMinimum() ) );
360  bBoxElement.setAttribute( QStringLiteral( "maxx" ), QString::number( layerExtent.xMaximum() ) );
361  bBoxElement.setAttribute( QStringLiteral( "maxy" ), QString::number( layerExtent.yMaximum() ) );
362  layerElem.appendChild( bBoxElement );
363 
364  // layer metadata URL
365  QString metadataUrl = layer->metadataUrl();
366  if ( !metadataUrl.isEmpty() )
367  {
368  QDomElement metaUrlElem = doc.createElement( QStringLiteral( "MetadataURL" ) );
369  QString metadataUrlType = layer->metadataUrlType();
370  metaUrlElem.setAttribute( QStringLiteral( "type" ), metadataUrlType );
371  QString metadataUrlFormat = layer->metadataUrlFormat();
372  if ( metadataUrlFormat == QLatin1String( "text/xml" ) )
373  {
374  metaUrlElem.setAttribute( QStringLiteral( "format" ), QStringLiteral( "XML" ) );
375  }
376  else
377  {
378  metaUrlElem.setAttribute( QStringLiteral( "format" ), QStringLiteral( "TXT" ) );
379  }
380  QDomText metaUrlText = doc.createTextNode( metadataUrl );
381  metaUrlElem.appendChild( metaUrlText );
382  layerElem.appendChild( metaUrlElem );
383  }
384 
385  //wfs:Operations element
386  QDomElement operationsElement = doc.createElement( QStringLiteral( "Operations" )/*wfs:Operations*/ );
387  //wfs:Query element
388  QDomElement queryElement = doc.createElement( QStringLiteral( "Query" )/*wfs:Query*/ );
389  operationsElement.appendChild( queryElement );
390  if ( wfstUpdateLayersId.contains( layer->id() ) ||
391  wfstInsertLayersId.contains( layer->id() ) ||
392  wfstDeleteLayersId.contains( layer->id() ) )
393  {
394  QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
395  QgsVectorDataProvider *provider = vlayer->dataProvider();
396  if ( ( provider->capabilities() & QgsVectorDataProvider::AddFeatures ) && wfstInsertLayersId.contains( layer->id() ) )
397  {
398  //wfs:Insert element
399  QDomElement insertElement = doc.createElement( QStringLiteral( "Insert" )/*wfs:Insert*/ );
400  operationsElement.appendChild( insertElement );
401  }
402  if ( ( provider->capabilities() & QgsVectorDataProvider::ChangeAttributeValues ) &&
403  ( provider->capabilities() & QgsVectorDataProvider::ChangeGeometries ) &&
404  wfstUpdateLayersId.contains( layer->id() ) )
405  {
406  //wfs:Update element
407  QDomElement updateElement = doc.createElement( QStringLiteral( "Update" )/*wfs:Update*/ );
408  operationsElement.appendChild( updateElement );
409  }
410  if ( ( provider->capabilities() & QgsVectorDataProvider::DeleteFeatures ) && wfstDeleteLayersId.contains( layer->id() ) )
411  {
412  //wfs:Delete element
413  QDomElement deleteElement = doc.createElement( QStringLiteral( "Delete" )/*wfs:Delete*/ );
414  operationsElement.appendChild( deleteElement );
415  }
416  }
417 
418  layerElem.appendChild( operationsElement );
419 
420  featureTypeListElement.appendChild( layerElem );
421  }
422 
423  return featureTypeListElement;
424  }
425 
426  } // namespace v1_0_0
427 } // namespace QgsWfs
428 
429 
430 
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:78
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.
Definition: qgsmaplayer.h:263
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:294
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:442
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:310
const QString GML_NAMESPACE
Definition: qgswfsutils.h:67
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:66
A helper class that centralizes caches accesses given by all the server cache filter plugins...
Allows modifications of geometries.
Reads and writes project states.
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:278
double yMinimum() const
Returns the y minimum value (bottom side of rectangle).
Definition: qgsrectangle.h:177
const QString OGC_NAMESPACE
Definition: qgswfsutils.h:68
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...
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:406
double yMaximum() const
Returns the y maximum value (top side of rectangle).
Definition: qgsrectangle.h:172
QString name
Definition: qgsmaplayer.h:82
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:85
QString metadataUrlType() const
Returns the metadata type of the layer used by QGIS Server in GetCapabilities request.
Definition: qgsmaplayer.h:424