Friday, October 15, 2010

Decimal Degrees vs DMS

I had someone ask me today how to configure Smallworld to show Decimal Degrees or Degrees/Minutes/Seconds.

I found two ways. The one way is to use the Administration application's Unit Display Groups tool to change the "Sub Units?" value



The other option is to create some Magik code in your image build process that changes the sub units setting.

E.g.
_block
unit_manager.unit(:degree).default_format.use_sub_units? << _false # (or _true)
_endblock
$

1 comment:

Bhimu... said...

The other way I know is using dynamic global variable !current_locale! is a property_list which has 42 props in it like :float_point_char, :float_exponent_string , :float_decimal_places

Some countries use "," as decimal separator and some use "." changing :float_point_char will change the decimal char., similarly :use_sub_units?

_block
!current_locale![:use_sub_units? ] << _true or _false
_endblock


if we don’t want to save settings in image.. the block of code can be placed in .magik file @ system.home location. as the .magik file loads every time after image get started, so the settings is available to other images as well[even if you don't want :) ]

Thanks,
Bhimesh.