2009-12-22 23:18:51 +08:00
|
|
|
class WKTAdapter(object):
|
2008-08-06 02:13:06 +08:00
|
|
|
"""
|
|
|
|
This provides an adaptor for Geometries sent to the
|
|
|
|
MySQL and Oracle database backends.
|
|
|
|
"""
|
|
|
|
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
|