Skip to content

PB-364: Add parser for OGC WMS XML response for GetFeatureInfo.#1074

Merged
ismailsunni merged 1 commit intodevelopfrom
pb-364-plain-text-parsing
Sep 30, 2024
Merged

PB-364: Add parser for OGC WMS XML response for GetFeatureInfo.#1074
ismailsunni merged 1 commit intodevelopfrom
pb-364-plain-text-parsing

Conversation

@ismailsunni
Copy link
Contributor

@ismailsunni ismailsunni commented Sep 23, 2024

Originally, the ticket is about parsing plain text response from GetFeatureInfo request. Unfortunately, there is no standard on how to do it. For example these two requests have completely different format if we request as plain/text:

@Gemeinden Kanton Luzern OBJECTID;BFS-Gemeindenummer;Shape; 2;1121;Polygon; 9;1128;Polygon; 18;1151;Polygon; 74;1086;Polygon; 
Results for FeatureType 'http://public_20221118_113413:ch_ag_geo_alg_amphibienzugst_02':
--------------------------------------------
amzg_id = 53
gebietnr = 52.0
strecke = Rietheim - Koblenz
esta = 4316
groesse = gross
laenge = 1000
kreising = IV
strassennr = K131
strasse = 1
bahn = 1
tieresamme = 1.0
tafelstell = 0.0
shape = [GEOMETRY (Point) with 1 points]
--------------------------------------------
--------------------------------------------
amzg_id = 54
gebietnr = 53.0
strecke = Rietheim - Zurzach
esta = 4316
groesse = gross
laenge = 400
kreising = IV
strassennr = K131
strasse = 1
bahn = 1
tieresamme = 0.0
tafelstell = 0.0
shape = [GEOMETRY (Point) with 1 points]
--------------------------------------------
--------------------------------------------
amzg_id = 84
gebietnr = 83.0
strecke = Zurzach - Rekingen
esta = 4323
groesse = gross
laenge = 700
kreising = IV
strassennr =  
strasse = 0
bahn = 1
tieresamme = 0.0
tafelstell = 0.0
shape = [GEOMETRY (Point) with 1 points]
--------------------------------------------

In this case, I tried to parse other possible format available in the problematic WMS in the ticket, which is a application/vnd.ogc.wms_xml. I checked in other WMS in the ticket also have this output format and works well.

Result

Test link with sample data

image
image

Test link

@ismailsunni ismailsunni requested review from ltkum, ltshb and pakb September 23, 2024 09:43
@ismailsunni ismailsunni marked this pull request as ready for review September 23, 2024 09:44
@cypress
Copy link

cypress bot commented Sep 23, 2024

web-mapviewer    Run #3420

Run Properties:  status check passed Passed #3420  •  git commit 517f38eb85: PB-364: Add parser for OGC WMS XML response for GetFeatureInfo.
Project web-mapviewer
Branch Review pb-364-plain-text-parsing
Run status status check passed Passed #3420
Run duration 04m 26s
Commit git commit 517f38eb85: PB-364: Add parser for OGC WMS XML response for GetFeatureInfo.
Committer Ismail Sunni
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 210
View all changes introduced in this branch ↗︎

Copy link
Contributor

@ltkum ltkum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be working, so we can go ahead with this. I would still add the warning queue dispatch, so we still tell the users we're not parsing plaintext.

break
case PLAIN_TEXT_TYPE:
// TODO : implement plain text parsing
log.error('Plain text parsing not yet implemented')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's not too much work, I would add a small addWarning dispatch here, to let the user know that if he imports a plain text document, we won't parse it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems not straight forward to add. I can't import the store in the api directory. I will skip it for now, and treat like other 'error' in this file with log.error only.

@ismailsunni ismailsunni force-pushed the pb-364-plain-text-parsing branch 2 times, most recently from 45f3186 to 12a03bb Compare September 30, 2024 06:28
@ismailsunni ismailsunni force-pushed the pb-364-plain-text-parsing branch from 12a03bb to 517f38e Compare September 30, 2024 07:46
@ismailsunni ismailsunni merged commit 5f4ebf5 into develop Sep 30, 2024
@ismailsunni ismailsunni deleted the pb-364-plain-text-parsing branch September 30, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants