[Mapserver-dev] Floating point precision problem in the WMS module

Jean-Henry Berevoescu bjh at globexplorer.com
Mon May 24 06:40:45 EDT 2004


Hi,
I am experiencing a problem in the WMS module and I wonder
if there is are others who know about it.
Accessing MMS as a WMS Server the request gets parsed in
mapwms.c: msWMSLoadGetMapParams(...)

...
      map->extent.minx = atof(tokens[0]);
      map->extent.miny = atof(tokens[1]);
      map->extent.maxx = atof(tokens[2]);
      map->extent.maxy = atof(tokens[3]);
...

I send the WMS request with a BBOX having 10-11 digits after the decimal
points for the coordinates. Just before this part of the code I added a log
print and the BBOX coordinates are still all right (altough still as 
strings)
Doing the same with the value that get into the "extent", I get all the
coordinates truncated to 6 digits after the decimal point. It is as if
a double gets downsized to a float.
The extent structure has doubles so the problem is not that.
I also tried to replace "atof" with calls to strod or sscanf and the
results are identical.

Thanks in advance for any insights on how to solve this problem.

Jean




More information about the mapserver-dev mailing list