2017-01-19 15:39:46 +08:00
|
|
|
class WKTAdapter:
|
2008-08-06 02:13:06 +08:00
|
|
|
"""
|
2017-01-25 04:31:57 +08:00
|
|
|
An adaptor for Geometries sent to the MySQL and Oracle database backends.
|
2008-08-06 02:13:06 +08:00
|
|
|
"""
|
|
|
|
def __init__(self, geom):
|
|
|
|
self.wkt = geom.wkt
|
|
|
|
self.srid = geom.srid
|
|
|
|
|
|
|
|
def __eq__(self, other):
|
2011-09-10 08:29:34 +08:00
|
|
|
if not isinstance(other, WKTAdapter):
|
|
|
|
return False
|
2009-03-09 08:03:03 +08:00
|
|
|
return self.wkt == other.wkt and self.srid == other.srid
|
2008-08-06 02:13:06 +08:00
|
|
|
|
2015-04-15 13:46:19 +08:00
|
|
|
def __hash__(self):
|
|
|
|
return hash((self.wkt, self.srid))
|
|
|
|
|
2008-08-06 02:13:06 +08:00
|
|
|
def __str__(self):
|
|
|
|
return self.wkt
|