DistanceDevelopment / distance-bugs

A place to keep bugs in Distance
http://distancesampling.org/Distance
1 stars 0 forks source link

Design overflow error when using locale with commas instead of decimal points #167

Open LHMarshall opened 8 years ago

LHMarshall commented 8 years ago

When using a locale which uses commas rather than points the design engine (properties) can get confused when calculating some of the design definition values. This can lead to overflow errors when the design is run.

Compare the definition of the same design, the first generated on a computer using decimal points and the second on a computer using commas:

SAMPLER CLASS=Line; DESIGN CLASS=Systematic Random Sampling; STRATUM LAYER=strata; DESIGN COORDSYS=Non-earth; SEED=0; EFFORT DEFINITION=Spacing /SAME EFFORT=yes /TYPE=Spacing /INTEGER TOTALS=yes /LENGTH=94771.987 /SAMPLERS=12 /LENGTH ALLOCATION=60653.266,34118.721 /SAMPLER ALLOCATION=6,6 /SPACING ALLOCATION=2000,2000 /PERCENTAGE TOTAL=94771.987 /PERCENTAGE ALLOCATION=63.999,36.001 /PERCENT DEFINITION=Length /UNITSECTION=LinUnit /UNITS=Meter /UNITFACTOR=1; DESIGN ANGLE=90,0; EDGE EFFECT=Minus; SAMPLER=Line /WIDTH=1,1 /UNITSECTION=LinUnit /UNITS=Meter /UNITFACTOR=1 /SAME PROPERTIES=yes; COVERAGE PROBABILITY=Assume even /LAYER=grid /LABEL=parallel 1 km spacing 3;

SAMPLER CLASS=Line; DESIGN CLASS=Systematic Random Sampling; STRATUM LAYER=strata; DESIGN COORDSYS=Non-earth; SEED=0; EFFORT DEFINITION=Spacing /SAME EFFORT=yes /TYPE=Spacing /INTEGER TOTALS=yes /LENGTH=61391.826 /SAMPLERS=32391347 /LENGTH ALLOCATION=60657.315,734.511 /SAMPLER ALLOCATION=6,32391341 /SPACING ALLOCATION=2000,2000 /PERCENTAGE TOTAL=61391.826 /PERCENTAGE ALLOCATION=98.804,1.196 /PERCENT DEFINITION=Length /UNITSECTION=LinUnit /UNITS=Meter /UNITFACTOR=1; DESIGN ANGLE=90,0; EDGE EFFECT=Minus; SAMPLER=Line /WIDTH=500,500 /UNITSECTION=LinUnit /UNITS=Meter /UNITFACTOR=1 /SAME PROPERTIES=yes; COVERAGE PROBABILITY=Assume even /LAYER=grid /LABEL=New Design;