[Qgis-user] QGIS Server: Parsing WFS capabilites with JavaScript
Jakob Miksch
jakob.miksch at siticom.de
Tue Nov 7 23:26:14 PST 2023
Meanwhile this npm package also supports WFS 1.0.0 and WFS 1.1.0
https://github.com/GastonZalba/ol-wfs-capabilities
Gesendet von Outlook für iOS<https://aka.ms/o0ukef>
Jakob Miksch
Consultant
+49 170 9036956
siticom.online
________________________________
Von: QGIS-User <qgis-user-bounces at lists.osgeo.org> im Auftrag von Jakob Miksch via QGIS-User <qgis-user at lists.osgeo.org>
Gesendet: Tuesday, October 31, 2023 12:07:09 PM
An: Aguilar Bolivar, Rosa (UT-ITC) <r.aguilar at utwente.nl>; Jorge Gustavo Rocha <jgr at geomaster.pt>; qgis-user at lists.osgeo.org <qgis-user at lists.osgeo.org>
Betreff: Re: [Qgis-user] QGIS Server: Parsing WFS capabilites with JavaScript
SECURITY WARNING: This email is from an external source - be careful of attachments and links. Please report suspicious emails to soc at siticom.de
Thanks for the hints. I will try those!
Jakob Miksch
Consultant
+49 170 9036956
siticom.online
From: QGIS-User <qgis-user-bounces at lists.osgeo.org> On Behalf Of Aguilar Bolivar, Rosa (UT-ITC) via QGIS-User
Sent: Tuesday, October 31, 2023 6:16 AM
To: Jorge Gustavo Rocha <jgr at geomaster.pt>; qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] QGIS Server: Parsing WFS capabilites with JavaScript
SECURITY WARNING: This email is from an external source - be careful of attachments and links. Please report suspicious emails to soc at siticom.de<mailto:soc at siticom.de>
Hi,
I have used a simple DOMParser
const xmlParser = new DOMParser();
const xmlText = xmlParser.parseFromString(XmlCapText, 'text/xml');
Cheers,
Rosa
-----------------------------------------------------------------
Dr. Rosa Aguilar
University of Twente
Faculty of Geoinformation Science and Earth Observation
Connect with me on LinkedIn<https://www.linkedin.com/in/rosamaguilar/?locale=en_US>
https://rosaguilar.github.io<https://rosaguilar.github.io/>
-----------------------------------------------------------------
The essential is invisible to the eye. Saint-Exupéry
From: QGIS-User <qgis-user-bounces at lists.osgeo.org<mailto:qgis-user-bounces at lists.osgeo.org>> On Behalf Of Jorge Gustavo Rocha via QGIS-User
Sent: Monday, October 30, 2023 8:36 PM
To: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>
Subject: Re: [Qgis-user] QGIS Server: Parsing WFS capabilites with JavaScript
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
[cid:image001.png at 01DA0BF2.C55B0A00]
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<mailto: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/20231108/bb6dc6bb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 14960 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231108/bb6dc6bb/attachment.png>
More information about the QGIS-User
mailing list