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

Prevent merging of CQL filter for multiple layers #28

Open
afabiani opened this issue Feb 3, 2025 · 0 comments
Open

Prevent merging of CQL filter for multiple layers #28

afabiani opened this issue Feb 3, 2025 · 0 comments

Comments

@afabiani
Copy link
Contributor

afabiani commented Feb 3, 2025

When trying to issue the same CQL_FILTER parameter to more layers, it the filter has same values it will get merged by the library thus causing an error on the GetMap response.

Image

Sample Requests

FAILING (Same "CQL_FILTER":"(\"CFCC\"='D31')")

curl 'https://mapstore.geosolutionsgroup.com/mapstore/pdf/create.json' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en,en-US;q=0.9,it;q=0.8' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: _ga=GA1.2.1103152313.1703075700; _hp2_props.2826793817=%7B%22account_state%22%3A%22active%22%2C%22account_plan%22%3A%22Enterprise%2021%22%2C%22billing_cycle%22%3A1%7D; userty.core.p.f3de1b=__2VySWQiOiI2MGI0NzRlMDY0MmFhMmNlMjA1MjNlMWExNjU2Y2E2NCJ9eyJ1c; userty.core.s.f3de1b=__WQiOiI2MmNkYTVjMzUyMmM3YTgyMWY2YjYyNDg2MTMzZmNlZiIsInN0IjoxNzIwNTEwMDM3MTk0LCJyZWFkeSI6dHJ1ZSwid3MiOiJ7XCJ3XCI6MTkyMCxcImhcIjo5NDN9Iiwic2UiOjE3MjA1MTMyODU0NDgsInB2IjoxfQ==eyJza; SL_C_23361dd035530_SID={"1e81b1058a277e08b89ce1a8afae7c273bf43218":{"sessionId":"f7FmOL--tBCWeQ-JFdeNB","visitorId":"-yfOGT2cCwlQvSJbfnz9h"}}; _hp2_id.2826793817=%7B%22userId%22%3A%222363252127558520%22%2C%22pageviewId%22%3A%22319791905379445%22%2C%22sessionId%22%3A%226521940240948917%22%2C%22identity%22%3A%22201003634192%22%2C%22trackerVersion%22%3A%224.0%22%2C%22identityField%22%3Anull%2C%22isIdentified%22%3A1%7D' \
  -H 'Origin: https://mapstore.geosolutionsgroup.com' \
  -H 'Pragma: no-cache' \
  -H 'Referer: https://mapstore.geosolutionsgroup.com/mapstore/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  --data-raw $'{"units":"m","srs":"EPSG:3857","layout":"A2_no_legend","dpi":96,"outputFilename":"mapstore-print","geodetic":false,"mapTitle":"","comment":"","layers":[{"baseURL":"https://maps1.geosolutionsgroup.com/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["osm:osm"],"format":"image/jpeg","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:ny_roads"],"format":"image/png8","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en","CQL_FILTER":"(\\"CFCC\\"=\'D31\')"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:ny_landmarks"],"format":"image/png8","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en","CQL_FILTER":"(\\"CFCC\\"=\'D31\')"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:ny_poi"],"format":"image/png8","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["tiger:poi2"],"format":"image/png; mode=8bit","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:us_states"],"format":"image/vnd.jpeg-png8","styles":["pophade"],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en","CQL_FILTER":"(\\"SUB_REGION\\"=\'E N Cen\' OR \\"SUB_REGION\\"=\'E S Cen\' OR \\"SUB_REGION\\"=\'Mid Atl\' OR \\"SUB_REGION\\"=\'Mtn\')"}}],"pages":[{"center":[-9487713.46548843,4598022.3360901],"scale":36978669.431820706,"rotation":0}],"legends":[{"name":"OSM Bright","classes":[{"name":"","icons":["https://maps1.geosolutionsgroup.com/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=osm%3Aosm&STYLE=&SCALE=36978669.431820706&width=24&height=24&minSymbolSize=24&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"ny_roads","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Any_roads&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"poly_landmarks","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Any_landmarks&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"poi","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Any_poi&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"Manhattan (NY) points of interest","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=tiger%3Apoi2&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"States of US","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Aus_states&STYLE=pophade&SCALE=36978669.431820706&width=100&height=50&minSymbolSize=50&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]}],"credits":"OSM Bright Rendering GeoSolutions Data © OpenStreetMap contributors, ODbL","projection":"EPSG:3857","outputFormat":"pdf"}'

GOOD (Different "CQL_FILTER":"(\"CFCC\"='D32')" and "CQL_FILTER":"(\"CFCC\"='D31')")

curl 'https://mapstore.geosolutionsgroup.com/mapstore/pdf/create.json' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en,en-US;q=0.9,it;q=0.8' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: _ga=GA1.2.1103152313.1703075700; _hp2_props.2826793817=%7B%22account_state%22%3A%22active%22%2C%22account_plan%22%3A%22Enterprise%2021%22%2C%22billing_cycle%22%3A1%7D; userty.core.p.f3de1b=__2VySWQiOiI2MGI0NzRlMDY0MmFhMmNlMjA1MjNlMWExNjU2Y2E2NCJ9eyJ1c; userty.core.s.f3de1b=__WQiOiI2MmNkYTVjMzUyMmM3YTgyMWY2YjYyNDg2MTMzZmNlZiIsInN0IjoxNzIwNTEwMDM3MTk0LCJyZWFkeSI6dHJ1ZSwid3MiOiJ7XCJ3XCI6MTkyMCxcImhcIjo5NDN9Iiwic2UiOjE3MjA1MTMyODU0NDgsInB2IjoxfQ==eyJza; SL_C_23361dd035530_SID={"1e81b1058a277e08b89ce1a8afae7c273bf43218":{"sessionId":"f7FmOL--tBCWeQ-JFdeNB","visitorId":"-yfOGT2cCwlQvSJbfnz9h"}}; _hp2_id.2826793817=%7B%22userId%22%3A%222363252127558520%22%2C%22pageviewId%22%3A%22319791905379445%22%2C%22sessionId%22%3A%226521940240948917%22%2C%22identity%22%3A%22201003634192%22%2C%22trackerVersion%22%3A%224.0%22%2C%22identityField%22%3Anull%2C%22isIdentified%22%3A1%7D' \
  -H 'Origin: https://mapstore.geosolutionsgroup.com' \
  -H 'Pragma: no-cache' \
  -H 'Referer: https://mapstore.geosolutionsgroup.com/mapstore/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  --data-raw $'{"units":"m","srs":"EPSG:3857","layout":"A2_no_legend","dpi":96,"outputFilename":"mapstore-print","geodetic":false,"mapTitle":"","comment":"","layers":[{"baseURL":"https://maps1.geosolutionsgroup.com/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["osm:osm"],"format":"image/jpeg","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:ny_roads"],"format":"image/png8","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en","CQL_FILTER":"(\\"CFCC\\"=\'D32\')"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:ny_landmarks"],"format":"image/png8","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en","CQL_FILTER":"(\\"CFCC\\"=\'D31\')"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:ny_poi"],"format":"image/png8","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["tiger:poi2"],"format":"image/png; mode=8bit","styles":[""],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en"}},{"baseURL":"https://gs-stable.geo-solutions.it/geoserver/wms?","opacity":1,"singleTile":false,"type":"WMS","layers":["gs:us_states"],"format":"image/vnd.jpeg-png8","styles":["pophade"],"customParams":{"TRANSPARENT":true,"TILED":true,"EXCEPTIONS":"application/vnd.ogc.se_inimage","scaleMethod":"accurate","ENV":"mapstore_language:en","CQL_FILTER":"(\\"SUB_REGION\\"=\'E N Cen\' OR \\"SUB_REGION\\"=\'E S Cen\' OR \\"SUB_REGION\\"=\'Mid Atl\' OR \\"SUB_REGION\\"=\'Mtn\')"}}],"pages":[{"center":[-9487713.46548843,4598022.3360901],"scale":36978669.431820706,"rotation":0}],"legends":[{"name":"OSM Bright","classes":[{"name":"","icons":["https://maps1.geosolutionsgroup.com/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=osm%3Aosm&STYLE=&SCALE=36978669.431820706&width=24&height=24&minSymbolSize=24&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"ny_roads","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Any_roads&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"poly_landmarks","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Any_landmarks&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"poi","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Any_poi&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"Manhattan (NY) points of interest","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=tiger%3Apoi2&STYLE=&SCALE=36978669.431820706&width=12&height=12&minSymbolSize=12&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]},{"name":"States of US","classes":[{"name":"","icons":["https://gs-stable.geo-solutions.it/geoserver/wms?TRANSPARENT=true&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=gs%3Aus_states&STYLE=pophade&SCALE=36978669.431820706&width=100&height=50&minSymbolSize=50&LEGEND_OPTIONS=forceLabels%3A%3BfontAntialiasing%3Atrue%3Bdpi%3A96%3BfontStyle%3A%3BfontName%3AVerdana%3BfontSize%3A8&format=image%2Fpng"]}]}],"credits":"OSM Bright Rendering GeoSolutions Data © OpenStreetMap contributors, ODbL","projection":"EPSG:3857","outputFormat":"pdf"}'
afabiani added a commit to afabiani/mapfish-print-v2 that referenced this issue Feb 3, 2025
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

No branches or pull requests

1 participant