#2079 closed defect (fixed)
WMS request with a BBOX and and SLD containing Filter encoding gives inconsistent result
Reported by: | assefa | Owned by: | assefa |
---|---|---|---|
Priority: | normal | Milestone: | 5.6 release |
Component: | WMS Server | Version: | |
Severity: | normal | Keywords: | |
Cc: | tomkralidis |
Description
Bug reported by Bart : description is in attached PDF.
Looking into this problem, It seems that applying the SLD should be done prior to applying other wms parameters such BBOX/SRS. Conceptually when there is a geographical filter in the SLD (so doing a query), It should be assumed that this query is applied against the original extents of the map (prior of the these extents being modified by parameters such as BBOX). Is this also the way you see it ?
Assuming this, I have moved the code to test and apply the sld before all other parameters. This seems to give the expected result using your data set. Attached is my mapwms.c (changes in function msWMSLoadGetMapParams). Please give it a try. If acceptable I will do the commit.
Attachments (6)
Change History (28)
by , 17 years ago
Attachment: | Bug report SLD WMS.pdf added |
---|
comment:1 by , 17 years ago
Owner: | changed from | to
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Seems fine to me Assefa, for reference, fixed in changeset:6072
comment:4 by , 17 years ago
Assefa, was this backported to 4.10.X as well? If so, what is the changeset?
comment:6 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Unfortunately this is broken again in 5.2. So I am reopening.
follow-up: 9 comment:7 by , 16 years ago
The first problem is in FLTParseGMLBox where ppszSRS is never set. This causes a WFS GetFeature request with a BBOX Filter in another SRS to not return any features.
if (*ppszSRS) *ppszSRS = strdup(pszSRS);
should be:
if (ppszSRS) *ppszSRS = strdup(pszSRS);
or not?
SLD WMS with reprojection still does not work, this needs more investigation.
comment:8 by , 16 years ago
Milestone: | 5.0 release → 5.2.1 release |
---|
comment:9 by , 16 years ago
The first problem is in FLTParseGMLBox where ppszSRS is never set. This causes a WFS GetFeature request with a BBOX Filter in another SRS to not return any features.
if (*ppszSRS) *ppszSRS = strdup(pszSRS);should be:
if (ppszSRS) *ppszSRS = strdup(pszSRS);or not?
This is correct. I will apply the changes.
SLD WMS with reprojection still does not work, this needs more investigation.
I have seen the patch you sent but before any changes to it, I would like to reproduce the problem that you are having. According to your statement, it seems that you are having a problem with Test 4 described in your original pdf doc? For some reason, the changes I had done in changeset:6072 were removed in changeset:6538 and would like to be able to have a test case that shows the problem before rehanging it.
comment:10 by , 16 years ago
Hi Assefa, yes I believe it is testcase 4 that is failing now. Do you still have the data or I need to make a new testcase?
follow-up: 18 comment:11 by , 16 years ago
Cc: | added |
---|
I still have the test cases/data. Test 4 works currently (with your patch of mapogcfilter.c but *without* the patch in mapwms.c) http://127.0.0.1/cgi-bin/mapserv.exe?map=f:/msapps/bart_bugmapogcfilter/bugmapogcfilter.map&LAYERS=NL-prov&REQUEST=GetMap&SERVICE=WMS&FORMAT=image/png&STYLES=default&HEIGHT=450&QUERY_LAYERS=NL-prov&VERSION=1.1.0&SRS=EPSG:28992&WIDTH=450&SLD=http://127.0.0.1/msapps/bart_bugmapogcfilter/bugmapogcfilter.sld&BBOX=0,300000,300000,600000&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage
Looking at your patch for mapwms.c, I tend to think that It is not appropriate mainly because we want to wait after all the query parameters are read before applying the srs (allowing for error trapping for invalid srs).
The original patch that we did changeset:6072 is still valid: what the patch allowed was that to make sure that we apply the SLD before applying any of the other parameters (such as BBOX/SRS). As described originally in this bug: "Conceptually when there is a geographical filter in the SLD (so doing a query), It should be assumed that this query is applied against the original extents of the map (prior of the these extents being modified by parameters such as BBOX)."
I am attaching a new patch that brings back the changeset:6072
Bart, can you please test with this patch (+ your patch for mapogcfilter.c)
I am also cc'ing Tom to see if there was any reason why part of changeset:6538 did remove the original changes.
by , 16 years ago
Attachment: | bug_2079.patch added |
---|
follow-up: 20 comment:12 by , 16 years ago
Hi Assefa, this patch does not work for me. I am trying this on 5.2.0. For reference I'll attach my complete patch.
I am getting a blank image on the following request:
Where the SLD is something like:
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><Name>AAA64</Name><UserStyle><FeatureTypeStyle><Rule><Name>default</Name><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>geometry</ogc:PropertyName><gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:28992"><gml:coordinates decimal="." cs="," ts=" ">204039.4736842105,510368.4210526316 224186.84210526315,531905.2631578947</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter><LineSymbolizer><Stroke><CssParameter name="stroke">#FF0000</CssParameter><CssParameter name="stroke-width">2</CssParameter></Stroke></LineSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>
by , 16 years ago
Attachment: | mapserver-5.2.0-2079.patch added |
---|
comment:13 by , 16 years ago
Assefa, can you try a GetMap request where the SRS differs from the MAP file's projection, with a BBOX filter in the MAP file's projection? That use case does not work for me with your patch applied.
comment:14 by , 16 years ago
Bart,
I had tested this case with your sample data where the GetMap request uses epsg 4326 and the map files has an epsg of 28992 and I get one polygon back:
Do you still have this data that I am using?
Is it possible to use it or send me off list new test sample?
comment:15 by , 16 years ago
Asefa, the url you are trying has the SLD parameter at the end of the url, which probably explains why yours works and mine does not. Are you able to test with the SLD parameter before the BBOX?
comment:16 by , 16 years ago
Bart,
the patch ensures that the SLD is applied before any other parameters (regardless of the order in which the parameters are found in the URL). I can confirm that using this url, I still get what is expected:
comment:17 by , 16 years ago
I have done 11 tests on MapServer 5.2.0 (with PropertyIsEqualTo anf/or PropertyIsLike and/or BBOX with an without <AND> node). I have also test matchCase.
All works OK only for the requests using PropertyIsEqualTo with matchCase without AND node.
Nothing works when a AND node is used.
See the ZIP file that contains :
- Open Office ODS file that describes all,
- the mapserver log for each test (level 5),
- the mapfile,
- the MapInfo file.
NB : The ZIP contains also WFS tests.
comment:18 by , 16 years ago
Replying to assefa:
I still have the test cases/data. Test 4 works currently (with your patch of mapogcfilter.c but *without* the patch in mapwms.c) http://127.0.0.1/cgi-bin/mapserv.exe?map=f:/msapps/bart_bugmapogcfilter/bugmapogcfilter.map&LAYERS=NL-prov&REQUEST=GetMap&SERVICE=WMS&FORMAT=image/png&STYLES=default&HEIGHT=450&QUERY_LAYERS=NL-prov&VERSION=1.1.0&SRS=EPSG:28992&WIDTH=450&SLD=http://127.0.0.1/msapps/bart_bugmapogcfilter/bugmapogcfilter.sld&BBOX=0,300000,300000,600000&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage
Looking at your patch for mapwms.c, I tend to think that It is not appropriate mainly because we want to wait after all the query parameters are read before applying the srs (allowing for error trapping for invalid srs).
The original patch that we did changeset:6072 is still valid: what the patch allowed was that to make sure that we apply the SLD before applying any of the other parameters (such as BBOX/SRS). As described originally in this bug: "Conceptually when there is a geographical filter in the SLD (so doing a query), It should be assumed that this query is applied against the original extents of the map (prior of the these extents being modified by parameters such as BBOX)."
I am attaching a new patch that brings back the changeset:6072
Bart, can you please test with this patch (+ your patch for mapogcfilter.c)
I am also cc'ing Tom to see if there was any reason why part of changeset:6538 did remove the original changes.
Assefa: I think r6538 was done to check the "else" condition (i.e. if OGR is not supported). Having said this, as long as the code update here covers that case, then that's fine with me.
As well, let's make sure this works on msautotest to make sure new issues do not get introduced.
comment:19 by , 15 years ago
Milestone: | 5.6 release → 6.0 release |
---|
comment:20 by , 15 years ago
Replying to bartvde:
http://test.intranet.rijkswaterstaat.nl/services/geoservices/basispakket/nationaalwegenbestand?
Bart,
Is it possible to get the test data used in this case?
I am trying to see if I can replicate any of the issues described in this bug. I still have the original set of data ("NL-prov") but could not replicate the issue with it.
thx
comment:21 by , 15 years ago
Milestone: | 6.0 release → 5.6 release |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Commied fix in the main trunck.