jamesdales / IconMapSupport

MIT License
7 stars 1 forks source link

Using cql-filters in WMS-URL-string works only with static strings #13

Closed amarinos238 closed 1 year ago

amarinos238 commented 1 year ago

Hi James, I'm using version 3.2.17 for this. The WMS services are provided by a public WMS server from the weather service, based on geoserver. I also could verify the same behaviour using my own geoserver version 3.23.2. I use a measure to define the URL string to be used in the WMS-URL field. This is the string: https://brz-maps.dwd.de/geoserver/ows?SERVICE=WMS&cql_Filter=NAME IN ('Rostock','Berlin','Hamburg') When I construct exactly the same string using a measure which concatenatexs some city-names, unfortunately only the first city is shown, but not any others. The layername is dwd:BRD_Orte I've been trying any variant I coulod think of for 2 days now, no success. Could you please help? This would be a great feature, which would enable IconMap to do filtering and intersects and the such, without having to code anything in IconMap! I enclose here a demo-pbix for testing. Best greets, Andreas test_ecql_filter.zip

jamesdales commented 1 year ago

This looks like a bug. I can see the URL being sent to geoserver only includes one item. Debugging it now...

jamesdales commented 1 year ago

Ok.... I've got to the bottom of this now.

So what's happening is because your slicer values used to create the URL for the WMS layer are in the same table as the ID field in the category field of Icon Map, it's actually generating three separate URLs, one for each ID:

https://brz-maps.dwd.de/geoserver/ows?SERVICE=WMS&&cql_Filter=NAME IN ('Rostock') https://brz-maps.dwd.de/geoserver/ows?SERVICE=WMS&&cql_Filter=NAME IN ('Berlin')

etc.

If you disconnect the two things, so that the WMS value isn't being filtered by the map category, then it works.

amarinos238 commented 1 year ago

Good morning, James, Thanks you once more for providing this solution. I implemented this in my little demo pbix and it worked nicely. Unfortunately it wasn’t so easy with my true report. That one typically uses the unique IDs of a large table (Analytical Base Table) as the map category, and some joined other tables for the details I want to attach to the WMS-URL. I worked together with Nikola Ilic on this and we were only successful when we duplicated the large table, thus decoupling it. This of course created a lot of unnecessary data in memory, but it works. Would there be another way within the IconMap code, to decouple WMS-string and category field? Just a suggestion as an enhancement. I am very grateful for the present solution, which opens so many new possibilities in combination with URL-in-line filtering and intersecting. Have a great day, Andreas

Andreas Marinos Consultant Data Analytics

DAA1.4

Telefon: +49 (89) 3891-4538 Telefax: +49 (89) 3891-74538 @.**@.> www.munichre.comhttp://www.munichre.com/


@.***

From: James Dales @.> Sent: Freitag, 25. August 2023 16:24 To: jamesdales/IconMapSupport @.> Cc: Marinos Andreas - Munich-MR @.>; Author @.> Subject: Re: [jamesdales/IconMapSupport] Using cql-filters in WMS-URL-string works only with static strings (Issue #13)

Ok. . . . I've got to the bottom of this now. So what's happening is because your slicer values used to create the URL for the WMS layer are in the same table as the ID field in the category field of Icon Map, it's actually generating three separate

Ok.... I've got to the bottom of this now.

So what's happening is because your slicer values used to create the URL for the WMS layer are in the same table as the ID field in the category field of Icon Map, it's actually generating three separate URLs, one for each ID:

https://brz-maps.dwd.de/geoserver/ows?SERVICE=WMS&&cql_Filter=NAMEhttps://urldefense.com/v3/__https:/brz-maps.dwd.de/geoserver/ows?SERVICE=WMS&&cql_Filter=NAME__;!!JTSHVUr6R1OOzg!IF6UgfegNhpr_PnjxpmBM7cGvVx64IMD2LJqfIRKZimld9nGrzvm7pYJ6yephcy9ZvKWW7VUhhQ9tpmnzdflAKer$ IN ('Rostock') https://brz-maps.dwd.de/geoserver/ows?SERVICE=WMS&&cql_Filter=NAMEhttps://urldefense.com/v3/__https:/brz-maps.dwd.de/geoserver/ows?SERVICE=WMS&&cql_Filter=NAME__;!!JTSHVUr6R1OOzg!IF6UgfegNhpr_PnjxpmBM7cGvVx64IMD2LJqfIRKZimld9nGrzvm7pYJ6yephcy9ZvKWW7VUhhQ9tpmnzdflAKer$ IN ('Berlin')

etc.

If you disconnect the two things, so that the WMS value isn't being filtered by the map category, then it works.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/jamesdales/IconMapSupport/issues/13*issuecomment-1693445942__;Iw!!JTSHVUr6R1OOzg!IF6UgfegNhpr_PnjxpmBM7cGvVx64IMD2LJqfIRKZimld9nGrzvm7pYJ6yephcy9ZvKWW7VUhhQ9tpmnzW2i0sBv$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BB4C53JYDIHQMBL6VQAAQBDXXCYQPANCNFSM6AAAAAA3N4STGE__;!!JTSHVUr6R1OOzg!IF6UgfegNhpr_PnjxpmBM7cGvVx64IMD2LJqfIRKZimld9nGrzvm7pYJ6yephcy9ZvKWW7VUhhQ9tpmnzYgxAPfN$. You are receiving this because you authored the thread.Message ID: @.**@.>>

Münchener Rückversicherungs-Gesellschaft ("Munich Reinsurance Company") is a reinsurance company organized under the laws of Germany. In some countries, including in the United States, Munich Reinsurance Company holds the status of an unauthorized reinsurer. Policies are underwritten by Munich Reinsurance Company or its affiliated insurance and reinsurance subsidiaries. Certain coverages are not available in all jurisdictions.

Münchener Rückversicherungs-Gesellschaft Aktiengesellschaft in München Königinstraße 107, 80802 München Sitz der Gesellschaft: München Amtsgericht München, HRB 42039

Vorsitzender des Aufsichtsrats: Dr. Nikolaus von Bomhard Vorstand: Dr. Joachim Wenning, Vorsitzender; Dr. Thomas Blunck, Nicholas Gartside, Stefan Golling, Dr. Christoph Jurecka, Dr. Achim Kassow, Michael Kerner, Clarisse Kopff, Mari-Lizette Malherbe, Dr. Markus Rieß

Information zum Datenschutz: https://www.munichre.com/de/allgemein/datenschutz.html

Information on Data Protection: https://www.munichre.com/en/general/privacy.html