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 <[email protected]> im Auftrag von Jakob Miksch 
via QGIS-User <[email protected]>
Gesendet: Tuesday, October 31, 2023 12:07:09 PM
An: Aguilar Bolivar, Rosa (UT-ITC) <[email protected]>; Jorge Gustavo Rocha 
<[email protected]>; [email protected] <[email protected]>
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 [email protected]




Thanks for the hints. I will try those!



Jakob Miksch
Consultant

+49 170 9036956
siticom.online



From: QGIS-User <[email protected]> On Behalf Of Aguilar 
Bolivar, Rosa (UT-ITC) via QGIS-User
Sent: Tuesday, October 31, 2023 6:16 AM
To: Jorge Gustavo Rocha <[email protected]>; [email protected]
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 
[email protected]<mailto:[email protected]>




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 
<[email protected]<mailto:[email protected]>> 
On Behalf Of Jorge Gustavo Rocha via QGIS-User
Sent: Monday, October 30, 2023 8:36 PM
To: [email protected]<mailto:[email protected]>
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:[email protected]]


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

[email protected]<mailto:[email protected]>

List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
QGIS-User mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to