'Initialize on the spatial object.'

def __init__(self, obj, geography=False):

    self.is_geometry = isinstance(obj, (Geometry, PostGISAdapter))
    if self.is_geometry:
        self.ewkb = bytes(obj.ewkb)
        self._adapter = Binary(self.ewkb)
    else:
        self.ewkb = to_pgraster(obj)
    self.srid = obj.srid
    self.geography = geography
