Exemple #1
0
    def __init__(self,
                 request,
                 zoom=1,
                 gridSize=256,
                 input_srid=4326,
                 mapTileSize=256,
                 schema_name='public'):

        self.schema_name = schema_name

        # the srid of the coordinates coming from javascript. input_srid = output_srid
        self.input_srid = int(input_srid)
        # the srid of the database, falls back to 4326
        self.db_srid = self.getDatabaseSRID()

        # the size of the grid in pixels. each grid cell gets its own kmeans clustering
        self.gridSize = int(gridSize)

        self.zoom = int(zoom)
        self.maptools = MapTools(int(mapTileSize))

        # filter operators
        self.valid_operators = ['=', '<', '>', '<=', '>=', 'list', '!list']

        self.request = request
        self.params = self.loadJson(request)
        self.cache = request.session.get("clustercache", {})
Exemple #2
0
    def __init__(self, zoom=1, gridSize=256, input_srid=4326, mapTileSize=256):

        # the srid of the coordinates coming from javascript. input_srid = output_srid
        self.input_srid = int(input_srid)

        # the size of the grid in pixels. each grid cell gets its own kmeans clustering
        self.gridSize = int(gridSize)

        self.zoom = int(zoom)
        self.maptools = MapTools(int(mapTileSize))

        # filter operators
        self.valid_operators = ['=', '<', '>', '<=', '>=', 'list', '!list']

        self.srid_db = self.getDatabaseSRID()