Repository URL to install this package:
|
Version:
2.1.0.jo1 ▾
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package gdata.geo</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="gdata.html"><font color="#ffffff">gdata</font></a>.geo</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/geo/__init__.py">/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/geo/__init__.py</a></font></td></tr></table>
<p><tt>Picasa Web Albums uses the georss and gml namespaces for <br>
elements defined in the GeoRSS and Geography Markup Language specifications.<br>
<br>
Specifically, Picasa Web Albums uses the following elements:<br>
<br>
georss:where<br>
gml:<a href="#Point">Point</a><br>
gml:pos<br>
<br>
<a href="http://code.google.com/apis/picasaweb/reference.html#georss_reference">http://code.google.com/apis/picasaweb/reference.html#georss_reference</a><br>
<br>
<br>
Picasa Web Albums also accepts geographic-location data in two other formats:<br>
W3C format and plain-GeoRSS (without GML) format.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="gdata.geo.data.html">data</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="atom.html#AtomBase">atom.AtomBase</a>(<a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.geo.html#Point">Point</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.geo.html#Pos">Pos</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.geo.html#Where">Where</a>
</font></dt></dl>
</dd>
</dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="GeoBaseElement">class <strong>GeoBaseElement</strong></a>(<a href="atom.html#AtomBase">atom.AtomBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Base class for elements.<br>
<br>
To add new elements, you only need to add the element tag name to self.<strong>_tag</strong><br>
and the namespace to self.<strong>_namespace</strong><br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a></dd>
<dd><a href="atom.html#AtomBase">atom.AtomBase</a></dd>
<dd><a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="GeoBaseElement-__init__"><strong>__init__</strong></a>(self, name<font color="#909090">=None</font>, extension_elements<font color="#909090">=None</font>, extension_attributes<font color="#909090">=None</font>, text<font color="#909090">=None</font>)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#AtomBase">atom.AtomBase</a>:<br>
<dl><dt><a name="GeoBaseElement-ToString"><strong>ToString</strong></a>(self, string_encoding<font color="#909090">='UTF-8'</font>)</dt><dd><tt>Converts the Atom object to a string containing XML.</tt></dd></dl>
<dl><dt><a name="GeoBaseElement-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><a name="GeoBaseElement-FindExtensions"><strong>FindExtensions</strong></a>(self, tag<font color="#909090">=None</font>, namespace<font color="#909090">=None</font>)</dt><dd><tt>Searches extension elements for child nodes with the desired name.<br>
<br>
Returns a list of extension elements within this object whose tag<br>
and/or namespace match those passed in. To find all extensions in<br>
a particular namespace, specify the namespace but not the tag name.<br>
If you specify only the tag, the result list may contain extension<br>
elements in multiple namespaces.<br>
<br>
Args:<br>
tag: str (optional) The desired tag<br>
namespace: str (optional) The desired namespace<br>
<br>
Returns:<br>
A list of elements whose tag and/or namespace match the parameters<br>
values</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Point">class <strong>Point</strong></a>(<a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>(container) Specifies a particular geographical point, by means of<br>
a <gml:pos> element.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.geo.html#Point">Point</a></dd>
<dd><a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a></dd>
<dd><a href="atom.html#AtomBase">atom.AtomBase</a></dd>
<dd><a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Point-__init__"><strong>__init__</strong></a>(self, pos<font color="#909090">=None</font>, extension_elements<font color="#909090">=None</font>, extension_attributes<font color="#909090">=None</font>, text<font color="#909090">=None</font>)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#AtomBase">atom.AtomBase</a>:<br>
<dl><dt><a name="Point-ToString"><strong>ToString</strong></a>(self, string_encoding<font color="#909090">='UTF-8'</font>)</dt><dd><tt>Converts the Atom object to a string containing XML.</tt></dd></dl>
<dl><dt><a name="Point-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><a name="Point-FindExtensions"><strong>FindExtensions</strong></a>(self, tag<font color="#909090">=None</font>, namespace<font color="#909090">=None</font>)</dt><dd><tt>Searches extension elements for child nodes with the desired name.<br>
<br>
Returns a list of extension elements within this object whose tag<br>
and/or namespace match those passed in. To find all extensions in<br>
a particular namespace, specify the namespace but not the tag name.<br>
If you specify only the tag, the result list may contain extension<br>
elements in multiple namespaces.<br>
<br>
Args:<br>
tag: str (optional) The desired tag<br>
namespace: str (optional) The desired namespace<br>
<br>
Returns:<br>
A list of elements whose tag and/or namespace match the parameters<br>
values</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Pos">class <strong>Pos</strong></a>(<a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>(string) Specifies a latitude and longitude, separated by a space,<br>
e.g. `35.669998 139.770004'<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.geo.html#Pos">Pos</a></dd>
<dd><a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a></dd>
<dd><a href="atom.html#AtomBase">atom.AtomBase</a></dd>
<dd><a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods inherited from <a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a>:<br>
<dl><dt><a name="Pos-__init__"><strong>__init__</strong></a>(self, name<font color="#909090">=None</font>, extension_elements<font color="#909090">=None</font>, extension_attributes<font color="#909090">=None</font>, text<font color="#909090">=None</font>)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#AtomBase">atom.AtomBase</a>:<br>
<dl><dt><a name="Pos-ToString"><strong>ToString</strong></a>(self, string_encoding<font color="#909090">='UTF-8'</font>)</dt><dd><tt>Converts the Atom object to a string containing XML.</tt></dd></dl>
<dl><dt><a name="Pos-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><a name="Pos-FindExtensions"><strong>FindExtensions</strong></a>(self, tag<font color="#909090">=None</font>, namespace<font color="#909090">=None</font>)</dt><dd><tt>Searches extension elements for child nodes with the desired name.<br>
<br>
Returns a list of extension elements within this object whose tag<br>
and/or namespace match those passed in. To find all extensions in<br>
a particular namespace, specify the namespace but not the tag name.<br>
If you specify only the tag, the result list may contain extension<br>
elements in multiple namespaces.<br>
<br>
Args:<br>
tag: str (optional) The desired tag<br>
namespace: str (optional) The desired namespace<br>
<br>
Returns:<br>
A list of elements whose tag and/or namespace match the parameters<br>
values</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Where">class <strong>Where</strong></a>(<a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>(container) Specifies a geographical location or region.<br>
A container element, containing a single <gml:<a href="#Point">Point</a>> element.<br>
(Not to be confused with <gd:where>.) <br>
<br>
Note that the (only) child attribute, .<a href="#Point">Point</a>, is title-cased.<br>
This reflects the names of elements in the xml stream<br>
(principle of least surprise).<br>
<br>
As a convenience, you can get a tuple of (lat, lon) with <a href="#Where">Where</a>.<a href="#Where-location">location</a>(),<br>
and set the same data with <a href="#Where">Where</a>.setLocation( (lat, lon) ).<br>
<br>
Similarly, there are methods to set and get only latitude and longitude.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.geo.html#Where">Where</a></dd>
<dd><a href="gdata.geo.html#GeoBaseElement">GeoBaseElement</a></dd>
<dd><a href="atom.html#AtomBase">atom.AtomBase</a></dd>
<dd><a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Where-__init__"><strong>__init__</strong></a>(self, point<font color="#909090">=None</font>, extension_elements<font color="#909090">=None</font>, extension_attributes<font color="#909090">=None</font>, text<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="Where-latitude"><strong>latitude</strong></a>(self)</dt><dd><tt>(float) Get the latitude value of the geo-tag. See also .<a href="#Where-location">location</a>()</tt></dd></dl>
<dl><dt><a name="Where-location"><strong>location</strong></a>(self)</dt><dd><tt>(float, float) Return <a href="#Where">Where</a>.<a href="#Point">Point</a>.pos.text as a (lat,lon) tuple</tt></dd></dl>
<dl><dt><a name="Where-longitude"><strong>longitude</strong></a>(self)</dt><dd><tt>(float) Get the longtitude value of the geo-tag. See also .<a href="#Where-location">location</a>()</tt></dd></dl>
<dl><dt><a name="Where-longtitude"><strong>longtitude</strong></a> = <a href="#Where-longitude">longitude</a>(self)</dt></dl>
<dl><dt><a name="Where-set_latitude"><strong>set_latitude</strong></a>(self, lat)</dt><dd><tt>(bool) Set the latitude value of the geo-tag.<br>
<br>
Args:<br>
lat (float): The new latitude value<br>
<br>
See also .<a href="#Where-set_location">set_location</a>()</tt></dd></dl>
<dl><dt><a name="Where-set_location"><strong>set_location</strong></a>(self, latlon)</dt><dd><tt>(bool) Set <a href="#Where">Where</a>.<a href="#Point">Point</a>.pos.text from a (lat,lon) tuple.<br>
<br>
Arguments:<br>
lat (float): The latitude in degrees, from -90.0 to 90.0<br>
lon (float): The longitude in degrees, from -180.0 to 180.0<br>
<br>
Returns True on success.</tt></dd></dl>
<dl><dt><a name="Where-set_longitude"><strong>set_longitude</strong></a>(self, lon)</dt><dd><tt>(bool) Set the longtitude value of the geo-tag.<br>
<br>
Args:<br>
lat (float): The new latitude value<br>
<br>
See also .<a href="#Where-set_location">set_location</a>()</tt></dd></dl>
<dl><dt><a name="Where-set_longtitude"><strong>set_longtitude</strong></a> = <a href="#Where-set_longitude">set_longitude</a>(self, lon)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#AtomBase">atom.AtomBase</a>:<br>
<dl><dt><a name="Where-ToString"><strong>ToString</strong></a>(self, string_encoding<font color="#909090">='UTF-8'</font>)</dt><dd><tt>Converts the Atom object to a string containing XML.</tt></dd></dl>
<dl><dt><a name="Where-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><a name="Where-FindExtensions"><strong>FindExtensions</strong></a>(self, tag<font color="#909090">=None</font>, namespace<font color="#909090">=None</font>)</dt><dd><tt>Searches extension elements for child nodes with the desired name.<br>
<br>
Returns a list of extension elements within this object whose tag<br>
and/or namespace match those passed in. To find all extensions in<br>
a particular namespace, specify the namespace but not the tag name.<br>
If you specify only the tag, the result list may contain extension<br>
elements in multiple namespaces.<br>
<br>
Args:<br>
tag: str (optional) The desired tag<br>
namespace: str (optional) The desired namespace<br>
<br>
Returns:<br>
A list of elements whose tag and/or namespace match the parameters<br>
values</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="atom.html#ExtensionContainer">atom.ExtensionContainer</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-PointFromString"><strong>PointFromString</strong></a>(xml_string)</dt></dl>
<dl><dt><a name="-PosFromString"><strong>PosFromString</strong></a>(xml_string)</dt></dl>
<dl><dt><a name="-WhereFromString"><strong>WhereFromString</strong></a>(xml_string)</dt></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>GEORSS_NAMESPACE</strong> = 'http://www.georss.org/georss'<br>
<strong>GEO_NAMESPACE</strong> = 'http://www.w3.org/2003/01/geo/wgs84_pos#'<br>
<strong>GML_NAMESPACE</strong> = 'http://www.opengis.net/gml'<br>
<strong>__author__</strong> = u'havard@gulldahl.no'<br>
<strong>__license__</strong> = 'Apache License v2'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
<td width="100%">havard@gulldahl.no</td></tr></table>
</body></html>