Looking at the API
Jussi Kukkonen
jhkukkon at cc.hut.fi
Mon Nov 12 06:08:14 PST 2007
One addition that wasn't specifically mentioned yet is country_code in
all Address-related APIs:
iain wrote:
> <interface name="org.freedesktop.Geoclue.Address">
> <method name="GetAddress">
> <arg type="i" name="fields" direction="out" />
> <arg type="i" name="timestamp" direction="out" />
> <arg type="s" name="country_code" direction="out" />
> <arg type="s" name="country" direction="out" />
> <arg type="s" name="region" direction="out" />
> <arg type="s" name="locality" direction="out" />
> <arg type="s" name="area" direction="out" />
> <arg type="s" name="postalcode" direction="out" />
> <arg type="s" name="street" direction="out" />
> <arg type="s" name="description" direction="out" />
> <arg type="s" name="text" direction="out" />
> <arg type="s" name="uri" direction="out" />
> </method>
The biggest reason for this is that most services accept country code
and using it should be less error prone (country names having
notoriously many defferent forms).
In the proposal we have both full name ("country") and the ISO 3166-1
two letter id "country_code". The idea is that backends should primarily
work with country code. Clients could use either. There could be helper
code for transforming name to code and back using
/usr/share/zoneinfo/iso3166.tab (or our own copy of the country list if
dependency on tzdata is not welcome) if that becomes a common need.
The alternative would be removing country name from API and leaving the
code2name conversion to the bindings, but as many data sources provide
both country code and country name I'd like to provide both too.
Jussi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/geoclue/attachments/20071112/6380b1bf/attachment.pgp
More information about the GeoClue
mailing list