Queries on values ending in ".0": 10 != 10.0

Delfos, Jacob Jacob.Delfos at MAUNSELL.COM
Tue Jan 22 21:28:33 EST 2008


Hi List,

Simple question: how come that in a mapserver query (php function queryByAttributes), the following does not hold true:

2400=2400.0 (does not return a result. Only way to get this value is searching for 2400.0)

In other words, if the value stored in the shapefile's DBF is 2400.0 (stored as a number with 1 decimal), searching for 2400 will not return that value. I guess you could say there is a difference of precision, but one could argue that the value is exactly the same.

Is there a way around this? I do not feel like using "string contains", because this gives undesirable results (for example, searching for "2" will return "2, 200, 232, 5562, etc).

Regards,

Jacob


Jacob Delfos | GIS Analyst

Maunsell Australia New Zealand Asia 
629 Newcastle St, Leederville, Western Australia 6007 
PO Box 81, Leederville, Western Australia 6902
P +61 8 9281 6185  F +61 8 9281 6298 
E jacob.delfos at maunsell.com
www.maunsell.com <http://www.maunsell.com/> 



This email and any attachments are intended solely for the named recipient and are confidential. The copying or distribution of them or any information they contain by anyone other than the named recipient is prohibited. If you have received this document in error, please notify the sender and delete all copies from your computer system and destroy all hard copies. It is the recipient's responsibility to check this email and any attachments to this email for viruses before use.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080123/e1b931e5/attachment.html


More information about the mapserver-users mailing list