Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code that generates a map with a couple of layers.

var PIDS = ["NSW502756064","NSW500951450","NSW500951433","NSW500951487","NSW500951527","NSW500951536","NSW502756058","NSW502756059","NSW513255000",

var filtered = filterResults(PIDS);

function init() {

    var streets = new OpenLayers.Layer.WMS("Query Layer",
            layers: 'NSW_STREET',
            queryVisible: true, 
            visibility: false,
            isBaseLayer: false, 
            transparent: true, 
            format: 'image/gif',
            numZoomLevels: 22

    var council = new OpenLayers.Layer.Vector("WFS", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
            url:  "http://xxxx:8081/cgi-bin/mapserv.exe?SERVICE=WFS&VERSION=1.1.0&map=../../", 
            featureType: "NSW_STREET",
            geometryName: "Geometry", 
            transparent: true,
            visible: false,
            opacity: 0.5,
            renderers: renderer
        styleMap: new OpenLayers.StyleMap(style),
        filter: new OpenLayers.Filter.Logical({
        type: OpenLayers.Filter.Logical.OR,
        filters: filtered       


    var roads = new OpenLayers.Layer.WMS("ROADS", 
           layers: "state,locality",
           numZoomLevels: 22        

    map = new OpenLayers.Map("map", {
            numZoomLevels: 22,
            controls: [
                new OpenLayers.Control.LayerSwitcher(),
                new OpenLayers.Control.PanZoom(),
                new OpenLayers.Control.Navigation(),
                new OpenLayers.Control.MousePosition()

    map.addLayers([roads, streets, council]);       

    map.setCenter(new OpenLayers.LonLat(148.17447, -33.13967).transform( // Bogan Street
        new OpenLayers.Projection("EPSG:4283"),
    ), 15);

var template = {
    strokeWidth: 3 

var style = new OpenLayers.Style(template);

var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;
renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;

function filterResults(thePids) {
    var filterlist = [];
    for (i=0;i<thePids.length;i++) {
        filterlist.push(new OpenLayers.Filter.Comparison({
                                type: OpenLayers.Filter.Comparison.EQUAL_TO,
                                property: "STREET_LINE_PID",
                                value: thePids[i]
    return filterlist;

I want the council layer to be filtered based on the road segments (PIDS) contained in the PIDS array. The problem I am having at the moment is that if the PIDS array holds fewer than 65 elements it'll render correctly.

enter image description here

However once I increase the number of elements in this array beyond 65 then nothing renders and the log file reveals the following error:

getSymbol(): Symbol definition error. Parsing error near (WHERE):(line 149)
[Wed Oct 10 13:31:12 2012].591000 msOGRFileWhichShapes(): OGR error. SetAttributeFilter( ( (STREET_LINE_PID= 'NSW502756064')  Or  ( (STREET_LINE_PID= 'NSW500951450')  Or  ( (STREET_LINE_PID= 'NSW500951433')  Or  ( (STREET_LINE_PID= 'NSW500951487')  Or  ( (STREET_LINE_PID= 'NSW500951527')  Or  ( (STREET_LINE_PID= 'NSW500951536')  Or  ( (STREET_LINE_PID= 'NSW502756058')  Or  ( (STREET_LINE_PID= 'NSW502756059')  Or  ( (STREET_LINE_PID= 'NSW513255000')  Or  ( (STREET_LINE_PID= 'NSW513255001')  Or  ( (STREET_LINE_PID= 'NSW513255009')  Or  ( (STREET_LINE_PID= 'NSW500952157')  Or  ( (STREET_LINE_PID= 'NSW500952183')  Or  ( (STREET_LINE_PID= 'NSW500952156')  Or  ( (STREET_LINE_PID= 'NSW500952181')  Or  ( (STREET_LINE_PID= 'NSW513254999')  Or  ( (STREET_LINE_PID= 'NSW500952182')  Or  ( (STREET_LINE_PID= 'NSW500952060')  Or  ( (STREET_LINE_PID= 'NSW513255018')  Or  ( (STREET_LINE_PID= 'NSW513255016')  Or  ( (STREET_LINE_PID= 'NSW513255017')  Or  ( (STREET_LINE_PID= 'NSW513255019')  Or  ( (STREET_LINE_PID= 'NSW500952081')  Or  ( (STREET_LINE_PID= 'NSW500952059')  Or  ( (STREET_LINE_PID= 'NSW500952078')  Or  ( (STREET_LINE_PID= 'NSW500952080')  Or  ( (STREET_LINE_PID= 'NSW513246310')  Or  ( (STREET_LINE_PID= 'NSW513246342')  Or  ( (STREET_LINE_PID= 'NSW500952139')  Or  ( (STREET_LINE_PID= 'NSW500952140')  Or  ( (STREET_LINE_PID= 'NSW515573633')  Or  ( (STREET_LINE_PID= 'NSW500952118')  Or  ( (STREET_LINE_PID= 'NSW515832904')  Or  ( (STREET_LINE_PID= 'NSW500951694')  Or  ( (STREET_LINE_PID= 'NSW500951946')  Or  ( (STREET_LINE_PID= 'NSW512878142')  Or  ( (STREET_LINE_PID= 'NSW512878163')  Or  ( (STREET_LINE_PID= 'NSW500951677')  Or  ( (STREET_LINE_PID= 'NSW500951562')  Or  ( (STREET_LINE_PID= 'NSW502756060')  Or  ( (STREET_LINE_PID= 'NSW515833545')  Or  ( (STREET_LINE_PID= 'NSW500951817')  Or  ( (STREET_LINE_PID= 'NSW500951996')  Or  ( (STREET_LINE_PID= 'NSW502756128')  Or  ( (STREET_LINE_PID= 'NSW515576212')  Or  ( (STREET_LINE_PID= 'NSW500951994')  Or  ( (STREET_LINE_PID= 'NSW500952216')  Or  ( (STREET_LINE_PID= 'NSW500952229')  Or  ( (STREET_LINE_PID= 'NSW500952239')  Or  ( (STREET_LINE_PID=
[Wed Oct 10 13:31:12 2012].592000 msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed

Your help in figuring out what's going wrong would be greatly appreciated.

share|improve this question

It appears that is may be a bug with the latest stable release of mapserver. Compiled the latest beta version and now it works.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.