Adds a GeoRSS point with the given coords using the given handler. Handles the differences between simple GeoRSS and the more popular W3C Geo specification.
(self, handler, coords, w3c_geo=False)
| 17 | return " ".join("%f %f" % (coord[1], coord[0]) for coord in coords) |
| 18 | |
| 19 | def add_georss_point(self, handler, coords, w3c_geo=False): |
| 20 | """ |
| 21 | Adds a GeoRSS point with the given coords using the given handler. |
| 22 | Handles the differences between simple GeoRSS and the more popular |
| 23 | W3C Geo specification. |
| 24 | """ |
| 25 | if w3c_geo: |
| 26 | lon, lat = coords[:2] |
| 27 | handler.addQuickElement("geo:lat", "%f" % lat) |
| 28 | handler.addQuickElement("geo:lon", "%f" % lon) |
| 29 | else: |
| 30 | handler.addQuickElement("georss:point", self.georss_coords((coords,))) |
| 31 | |
| 32 | def add_georss_element(self, handler, item, w3c_geo=False): |
| 33 | """Add a GeoRSS XML element using the given item and handler.""" |
no test coverage detected