def tile(self, bbox, tolerance=0.0, format=None, clip=False):
        clone = filter_geometry(self, intersects=bbox.ewkt)
        # Tile grid uses 3857, but coordinates should be in 4326 commonly.
        tile_srid = 3857
        coord_srid = bbox.srid
        transform = clone._transform()
        if clip:
            ewkt = ('GeomFromEWKT' if connection.ops.spatialite else
                    'ST_GeomFromEWKT')
            transform = "ST_Intersection(%s, %s('%s'))" % (
                transform, ewkt, bbox.ewkt)
        if clone.geo_field.srid != tile_srid:
            transform = 'ST_Transform(%s, %s)' % (transform, tile_srid)
        simplify = clone._simplify(transform, tolerance)
        latlng = 'ST_Transform(%s, %s)' % (simplify, coord_srid)
        if format == 'pbf':
            return clone.pbf(bbox, geo_col=latlng)
        return clone._as_format(latlng, format)
Returns a GeoQuerySet intersecting a tile boundary.
dataset/ETHPy150Open bkg/django-spillway/spillway/query.py/GeoQuerySet.tile