67 QStringList typeNameList;
68 QDomDocument queryDoc;
70 if ( queryDoc.setContent( request.
data(),
true, &errorMsg ) )
73 const QDomElement queryDocElem = queryDoc.documentElement();
74 const QDomNodeList docChildNodes = queryDocElem.childNodes();
75 if ( docChildNodes.size() )
77 for (
int i = 0; i < docChildNodes.size(); i++ )
79 const QDomElement docChildElem = docChildNodes.at( i ).toElement();
80 if ( docChildElem.tagName() == QLatin1String(
"TypeName" ) )
82 const QString
typeName = docChildElem.text().trimmed();
84 typeNameList <<
typeName.section(
':', 1, 1 );
102 fieldName = field.
name();
104 const thread_local QRegularExpression sCleanTagNameRegExp( QStringLiteral(
"[^\\w\\.-_]" ), QRegularExpression::PatternOption::UseUnicodePropertiesOption );
105 fieldName.replace(
' ',
'_' ).replace( sCleanTagNameRegExp, QString() );
107 const QMetaType::Type attributeType = field.
type();
109 if ( attributeType == QMetaType::Type::Int )
111 fieldType = QStringLiteral(
"int" );
113 else if ( attributeType == QMetaType::Type::UInt )
115 fieldType = QStringLiteral(
"unsignedInt" );
117 else if ( attributeType == QMetaType::Type::LongLong )
119 fieldType = QStringLiteral(
"long" );
121 else if ( attributeType == QMetaType::Type::ULongLong )
123 fieldType = QStringLiteral(
"unsignedLong" );
125 else if ( attributeType == QMetaType::Type::Double )
128 fieldType = QStringLiteral(
"integer" );
130 fieldType = QStringLiteral(
"decimal" );
132 else if ( attributeType == QMetaType::Type::Bool )
134 fieldType = QStringLiteral(
"boolean" );
136 else if ( attributeType == QMetaType::Type::QDate )
138 fieldType = QStringLiteral(
"date" );
140 else if ( attributeType == QMetaType::Type::QTime )
142 fieldType = QStringLiteral(
"time" );
144 else if ( attributeType == QMetaType::Type::QDateTime )
146 fieldType = QStringLiteral(
"dateTime" );
150 fieldType = QStringLiteral(
"string" );
154 if ( setup.
type() == QStringLiteral(
"DateTime" ) )
157 const QVariantMap config = setup.
config();
159 const QString fieldFormat = config.value(
160 QStringLiteral(
"field_format" ),
166 fieldType = QStringLiteral(
"time" );
168 fieldType = QStringLiteral(
"date" );
170 fieldType = QStringLiteral(
"dateTime" );
172 fieldType = QStringLiteral(
"dateTime" );
174 else if ( setup.
type() == QStringLiteral(
"Range" ) )
176 const QVariantMap config = setup.
config();
177 if ( config.contains( QStringLiteral(
"Precision" ) ) )
182 const int configPrec( config[QStringLiteral(
"Precision" )].toInt( &ok ) );
183 if ( ok && configPrec != field.
precision() )
185 if ( configPrec == 0 )
186 fieldType = QStringLiteral(
"integer" );
188 fieldType = QStringLiteral(
"decimal" );
void writeDescribeFeatureType(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response)
Output WFS GetCapabilities response.