PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/django/contrib/gis/geos/io.py

https://code.google.com/p/mango-py/
Python | 20 lines | 10 code | 4 blank | 6 comment | 0 complexity | 1d13d6cd1c8c2ee7829b3ddb288c2fdf MD5 | raw file
Possible License(s): BSD-3-Clause
  1. """
  2. Module that holds classes for performing I/O operations on GEOS geometry
  3. objects. Specifically, this has Python implementations of WKB/WKT
  4. reader and writer classes.
  5. """
  6. from django.contrib.gis.geos.geometry import GEOSGeometry
  7. from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WKTWriter
  8. # Public classes for (WKB|WKT)Reader, which return GEOSGeometry
  9. class WKBReader(_WKBReader):
  10. def read(self, wkb):
  11. "Returns a GEOSGeometry for the given WKB buffer."
  12. return GEOSGeometry(super(WKBReader, self).read(wkb))
  13. class WKTReader(_WKTReader):
  14. def read(self, wkt):
  15. "Returns a GEOSGeometry for the given WKT string."
  16. return GEOSGeometry(super(WKTReader, self).read(wkt))