Error parsing mapfile with floats us

Szekeres Tamás szekeres.tamas at FREEMAIL.HU
Thu Apr 27 09:17:29 EDT 2006


Frank, Howard,

Yes it was a local specific issue, I have added some
additional prints to the program:

current locale (LC_NUMERIC)=  hu_HU.UTF-8
locale.decimal_point=,
atof(51.447)=51,000000  atof(51,447)=51,447000

So the question is: if the parser expects dots as the
decimal separator for floats it should set the default
locale previously or use locale independent conversion, like
atof_l.  :?

Tamas



Szekeres Tamás <szekeres.tamas at FREEMAIL.HU> írta:

> Developers,
> 
> 
> I have recently added a simple make test functionality for
> the linux csharp build. The test simply runs the sample
> applications compiled along with mapscript.
> 
> the drawmap sample fails with the following error:
> 
> Unhandled Exception: System.ApplicationException:
> loadMapInternal(): General
> error message. Given map extent <-0,000000, 50,000000,
> 0,000000, 51,000000> is
> invalid. Check that it is in the form: minx, miny, maxx, maxy
> in <0x0003d> mapObj:.ctor (System.String filename)
> in <0x00056> DrawMap:Main (System.String[] args)
> make: *** [test] Error 1
> 
> The problem occurs when parsing the EXTENT parameter in the
> map file and the
> atof() function truncates the float values to integers.
> I have modified mapfile.c to print the EXTENT values parsed:
> 
> mono ./drawmap.exe ../../tests/test.map test_csharp.png
> msyytext= -0.5 msyynumber= -0,000000, atof(msyytext)=
-0,000000 
> strtod(msyytext)= -0,000000
> msyytext= 50.977222 msyynumber= 50,000000, atof(msyytext)=
> 50,000000 
> strtod(msyytext)= 50,000000
> msyytext= 0.5 msyynumber= 0,000000, atof(msyytext)= 0,000000
>  strtod(msyytext)=
> 0,000000
> msyytext= 51.977222 msyynumber= 51,000000, atof(msyytext)=
> 51,000000 
> strtod(msyytext)= 51,000000
> 
> I have implemented the same functionality inside
> mapscript_wrap.c and when compiling without -shared and
> running the application directly works well. But compiling
> as shared and invoking the same function from csharp the
> problem appears.
> 
> The compilation method is almost the same like java but it
> does not suffer with this issue.
> 
> I guess that wrong libstdc++ usage may be reasponsible for
> this behaviour. But at this point I have stucked.
> 
> Could anyone point me to the right direction to fix this
> problem?
> 
> added
> 
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1758
> 
> to track this bug.
> 
> Thanks,
> 
> Tamas Szekeres
> 
> 
>
_______________________________________________________________________________
> Digitális képből papírkép már 25 Ft-tól! Ingyenes
budapesti házhozszállítás! >>>
> http://www.xlab.hu/index.php?zoneid=levelvegi
> 
> 
> 

_______________________________________________________________________________
Digitális képből papírkép már 25 Ft-tól! Ingyenes budapesti házhozszállítás! >>>
http://www.xlab.hu/index.php?zoneid=levelvegi





More information about the mapserver-dev mailing list