Source

geouri /

Filename Size Date modified Message
geouri
35 B
1.5 KB
77 B
641 B
55 B
766 B

Geouri

An implementation of RFC 5870, the 'geo' URI scheme:

http://tools.ietf.org/html/rfc5870

parse() example:

>>> r = parse('geo:43.564814,3.907517;u=10.0')
>>> r.coords
[43.564813999999998, 3.9075169999999999]
>>> r.crs == 'wgs84'
True
>>> r.u
10.0

from_uri() example:

>>> from geouri import from_uri
>>> from pprint import pprint
>>> p = from_uri('geo:43.564814,3.907517;u=10.0')
>>> pprint(p)
{'coordinates': [3.9075169999999999, 43.564813999999998],
 'geouri.u': 10.0,
 'type': 'Point'}

to_uri() example:

>>> from geouri import to_uri
>>> to_uri(p)
'geo:43.564814,3.907517;u=10.0'