[Qgis-user] QGIS Server: Parsing WFS capabilites with JavaScript
Jorge Gustavo Rocha
jgr at geomaster.pt
Mon Oct 30 12:36:29 PDT 2023
Hi Jakob,
You can try jsonix. I use something like:
var Jsonix = require('jsonix').Jsonix;
var XLink_1_0 = require('w3c-schemas').XLink_1_0;
var OWS_1_0_0 = require('ogc-schemas').OWS_1_0_0;
var OWS_1_1_0 = require('ogc-schemas').OWS_1_1_0;
var WFS_1_0_0 = require('ogc-schemas').WFS_1_0_0;
var WFS_1_1_0 = require('ogc-schemas').WFS_1_1_0;
var WFS_2_0 = require('ogc-schemas').WFS_2_0;
var Filter_1_0_0 = require('ogc-schemas').Filter_1_0_0;
var Filter_1_1_0 = require('ogc-schemas').Filter_1_1_0;
var Filter_2_0 = require('ogc-schemas').Filter_2_0;
var GML_1_0_0 = require('ogc-schemas').GML_1_0_0;
var GML_2_1_2 = require('ogc-schemas').GML_2_1_2;
var GML_3_1_1 = require('ogc-schemas').GML_3_1_1;
var GML_3_2_0 = require('ogc-schemas').GML_3_2_0;
var GML_3_2_1 = require('ogc-schemas').GML_3_2_1;
var SMIL_2_0 = require('ogc-schemas').SMIL_2_0;
var SMIL_2_0_Language = require('ogc-schemas').SMIL_2_0_Language;
var CSW_2_0_2 = require('ogc-schemas').CSW_2_0_2;
var DC_1_1 = require('ogc-schemas').DC_1_1;
var DCT = require('ogc-schemas').DCT;
var XMLSchema = require('./mappings/XMLSchema').XMLSchema;
var context = new Jsonix.Context([
XLink_1_0,
OWS_1_0_0,
OWS_1_1_0,
WFS_1_0_0,
WFS_1_1_0,
WFS_2_0,
Filter_1_0_0,
Filter_1_1_0,
Filter_2_0,
GML_1_0_0,
GML_2_1_2,
GML_3_1_1,
GML_3_2_0,
GML_3_2_1,
SMIL_2_0,
SMIL_2_0_Language,
CSW_2_0_2,
DC_1_1,
DCT,
XMLSchema
]);
var unmarshaller = context.createUnmarshaller();
Later, you can transform WFS response to JSON, like:
const response = responseBuffer.toString('utf8');
var result = unmarshaller.unmarshalString(response);
Not so easy, but it works.
Regards,
Jorge Gustavo
On 30/10/23 14:11, Jakob Miksch via QGIS-User wrote:
>
> Dear QGIS Server people,
>
> I have a QGIS Server running. I would like to access the WFS
> Capabilities with JavaScript, more specifically I would like to know
> which WFS layers are published by QGIS Server. Unfortunately, QGIS
> Server only supports WFS 1.0.0 and 1.1.0. But the only parser for WFS
> capabilities I have found only support WFS 2.0.0 (
> https://github.com/GastonZalba/ol-wfs-capabilities ).
>
> Does anyone have a hint how to parse the WFS Capabilities from QGIS
> Server with JavaScript?
>
> best regards,
> Jakob
>
>
>
>
>
> Jakob Miksch
> Consultant
>
> +49 170 9036956
> siticom.online
>
>
>
> siticom GmbH • Werner-von-Siemens-Straße 2-6 • 76646 Bruchsal •
> Deutschland
> Geschäftsführer: Jürgen Hatzipantelis, Stefan Höltken
> Sitz der Gesellschaft: Weiterstadt • Amtsgericht Darmstadt • HRB 9276
> Umsatzsteuer-ID Nr.: DE 197 925 589
>
>
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231030/a81638ee/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: siticom-logo-blue-final-black-a-logicalis-company_bc243344-6a69-4e78-9078-76e88dbcc994.png
Type: image/png
Size: 14960 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231030/a81638ee/attachment.png>
More information about the QGIS-User
mailing list