Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLD with spatial filter intersect and bbox #3929

Closed
mapserver-bot opened this issue Apr 4, 2012 · 11 comments
Closed

SLD with spatial filter intersect and bbox #3929

mapserver-bot opened this issue Apr 4, 2012 · 11 comments

Comments

@mapserver-bot
Copy link

Reporter: assefa
Date: 2011/06/22 - 05:16
Trac URL: http://trac.osgeo.org/mapserver/ticket/3929
Bug to trac correction on sld using intersects and bbox filter:

  • use "intersects" operator instead of "not disjoint" that does not seem to work for bbox filters
  • correct intersects syntax
@mapserver-bot
Copy link
Author

Author: assefa
Date: 2011/06/22 - 05:19
committed in 0caec2e (r11845)

@mapserver-bot
Copy link
Author

Author: aboudreault
Date: 2012/01/27 - 23:48
This changeset breaks the FILTER optimization with a database source. Only the first the first filter rule is used to generate the filter. I see that a part of the code has been commented.... is this intended?

@mapserver-bot
Copy link
Author

Author: assefa
Date: 2012/01/31 - 18:53
Alan,

committed change in 355f0a9 (r13021). Let me know.

For db layers, this would only work for filters that do not contain spatial filters. For that, we need at one point to support spatial filter expressions natively for each driver.

@mapserver-bot
Copy link
Author

Author: aboudreault
Date: 2012/02/08 - 19:25
Yep, that fixed the issue I've experienced. thanks a lot Assefa!

@ghost ghost assigned assefay Apr 5, 2012
@tbonfort
Copy link
Member

tbonfort commented Aug 7, 2012

I believe this has lead to a regression in the SLD code, that I discovered when debugging #4412. Basically, in mapogcsld.c around line 835, there's a call to msStringEscape(pszExpression); which transforms

 ("[f_code]" ="DA030")

to

 (\"[f_code]\" =\"DA030\")"

and then gets sent to to postgis as

(( ("f_code"= '\"DA030\"') ))

might also be related to #3983

@tbonfort tbonfort reopened this Aug 7, 2012
@tbonfort
Copy link
Member

tbonfort commented Aug 7, 2012

cc @aboudreault

@tbonfort
Copy link
Member

@aboudreault let's continue in this thread rather than in #4412.

For the record, a failing autotest is available in wxs:

/usr/local/bin/mapserv QUERY_STRING="map=wms_sld.map&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-68.125,42,-58.375,48.5&FORMAT=image/png; mode=24bit&WIDTH=300&HEIGHT=200&STYLES=&LAYERS=road&sld_body=<StyledLayerDescriptor version='1.0.0'><NamedLayer><Name>road</Name><UserStyle><Title>xxx</Title><FeatureTypeStyle><Rule><Filter><Or><PropertyIsLike+wildCard='*'+singleChar='.'+escape='!'><PropertyName>NAME_E</PropertyName><Literal>Trans*</Literal></PropertyIsLike><PropertyIsLessThan><PropertyName>ROAD_ID</PropertyName><Literal>100</Literal></PropertyIsLessThan></Or></Filter><LineSymbolizer><Geometry><PropertyName>center-line</PropertyName></Geometry><Stroke><CssParameter name='stroke'>#0000ff</CssParameter><CssParameter name='stroke-width'>2.0</CssParameter></Stroke></LineSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>"

To make the test pass, in mapogcsld.c (https://github.com/mapserver/mapserver/blob/rel-6-2-0-beta2/mapogcsld.c#L840), replace

msLoadExpressionString(&psLayer->class[psLayer->numclasses-1-i]->expression,
                   pszEscapedExpression);

by

msLoadExpressionString(&psLayer->class[psLayer->numclasses-1-i]->expression,
                   pszExpression);

The change to use an escaped string instead of the original one was requested indirectly by you in this ticket and was committed in 355f0a9 .

@aboudreault
Copy link
Member

@tbonfort just tried the test case you pointed me and it seems to work fine with beta2 and master also. I got the same image (wms_nosld_get_map_line_sld.png from wxs). What did I miss?

@tbonfort
Copy link
Member

wms_get_map_line_filter_islike.png is the one that is failing (among others)

On Tue, Aug 21, 2012 at 3:04 PM, Alan Boudreault
notifications@github.comwrote:

@tbonfort https://github.com/tbonfort just tried the test case you
pointed me and it seems to work fine with beta2 and master also. I got the
same image (wms_nosld_get_map_line_sld.png from wxs). What did I miss?


Reply to this email directly or view it on GitHubhttps://github.com//issues/3929#issuecomment-7900151.

@aboudreault
Copy link
Member

Ok, I reverted the change in 67365bc. I've tested the ticket that I had noticed the initial issue (#4152) and it seems to work properly. Hopefully this commit has not break something else.

@tbonfort
Copy link
Member

@aboudreault , please only push to the 6.2 branch

@tbonfort tbonfort closed this as completed Sep 3, 2012
mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants