[mapserver-users] Mapserver Expression Result Error

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed Dec 2 10:16:59 EST 2009


tellett wrote:
> Hi all, I've come up against a problem that I just can't seem to fix, so I
> hope someone on here has the time to look into this and prove that I'm not
> going crazy!!
> 
> I've attached a zip file with a stripped down map file with just one layer
> and one class and the associated shp file. 
> http://n2.nabble.com/file/n4100026/flydekning.zip flydekning.zip 
> 
> The problem is that when I request features with the expression 'BILDEMALES'
> = "8000", a filter takes place but clearly not the right one because I just
> seem to get random features returned, some correct, most not (having a
> BILDEMALES value of 1000, 8000, 20000 etc). I originally tried this with
> postgis data and tried regex expressions, string comparisons and logical
> mapserver expressions, and with different values for the attribute.
> Everytime it returned some right and some wrong values. 
> 
> The attribute column in postgis was originally var char and I converted it
> to numeric, neither worked.
> 
> So now I've tried with the original shp file and get the same results. The
> attribute in the shp file is of type char. Also, as you can see with the
> commented out time extents, originally (when connecting to postgis) I was
> just calling records from 1947 (filtering on the fotodato attribute which I
> changed to type date in postgis), but with the shp file I should be calling
> all records as there is no date filter in place anymore (the fotodato field
> in the shp file is of type char). However, even though the records returned
> seem to be random, they are all from 1947. This isn't so important, just a
> bit weird? I've checked the log file but I seem to just be getting the error
> message:
> 
> 'msSearchDiskTree(): Search returned no results. Unable to open spatial
> index for /opt/maps/flyfoto_dekning/flightpass-1-999f.qix. In most cases you
> can safely ignore this message, otherwise check file names and permissions.'
> 
> The data is in utm32N or epsg:32632
> 
> Hope someones encountered this before and knows the fix!!
> 
>

Hello,

Thanks for packaging a test case.  Note that the package is missing font 
  and symbol files that your mapfile points to, so in the future your 
test packages should contain no references to fonts or symbols, to make 
it easier to run (I removed all references and extra metadata and 
objects, to make it easier to read).

If I open your shapefile in QuantumGIS and do an advanced query for 
'BILDEMALES = 8000' I get 29 records returned.

If I change your mapfile extents to the full extents of your shapefile, 
and use shp2img to create a map image, those same 29 features are shown 
in the MapServer map image.

If I use the ogrinfo utility to execute SQL to select 'BILDEMALES = 
8000' values, ogr/gdal returns those same 29 features.

In other words, I cannot duplicate your problem.  Maybe I don't 
understand what your problem is exactly?

(using MapServer 5.6.0-rc1)

-jeff

-- 
Jeff McKenna
FOSS4G Consulting and Training Services
http://www.gatewaygeomatics.com/




More information about the mapserver-users mailing list