Ejemplo n.º 1
0
 def layout(self, columns):
     fullcol = [(self.column_id, 'bigint'),
                (self.column_kind, 'char(1)')]
     fullcol.extend(columns)
     PGTable.layout(self, fullcol)
     self.add_geometry_column(self.column_geom, self.srid,
                              'POINT', with_index=True)
Ejemplo n.º 2
0
 def layout(self, columns):
     """ Layout the table as specified in PGTable.layout() but
         it will add a column for the OSM id. The name of the column
         is specified in 'column_id'.
     """
     fullcol = [(self.column_id, 'bigint PRIMARY KEY')]
     fullcol.extend(columns)
     PGTable.layout(self, fullcol)
Ejemplo n.º 3
0
    def __init__(self, db, name="relations_hier", subset=None):
        PGTable.__init__(self, db, name)

        if subset is None:
            self._subset = """SELECT DISTINCT relation_id 
                              FROM relation_members
                              WHERE relation_type = 'R'"""
        else:
            self._subset = subset
Ejemplo n.º 4
0
 def layout(self, columns):
     """ Layout the table as specified in PGTable.layout() but
         it will add a column for the OSM id. The name of the column
         is specified in 'column_id'.
     """
     fullcol = [(self.column_id, 'bigint PRIMARY KEY')]
     fullcol.extend(columns)
     PGTable.layout(self, fullcol)
     self.add_geometry_column(self.column_geom, self.srid, 'GEOMETRY', with_index=True)
Ejemplo n.º 5
0
 def __init__(self, db, basetable, name, subset):
     PGTable.__init__(self, db, name)
     updateset = "%s IN (SELECT id FROM %s_changeset WHERE action <> 'D')" % \
                   (self.column_id, basetable)
     if subset is None:
         self.wherequery = ""
         self.updatequery = "WHERE %s"% updateset
     else:
         self.wherequery = "WHERE %s" % subset
         self.updatequery = "WHERE %s AND %s" % (subset, updateset)
     self.basetable = basetable
Ejemplo n.º 6
0
 def __init__(self, db, name, subset, transform="%s"):
     PGTable.__init__(self, db, name)
     if subset is None:
         self.wherequery = "SELECT id, tags, geom FROM nodes"
         self.updatequery = "SELECT id, tags, geom FROM node_changeset WHERE action <> 'D'"
     else:
         self.wherequery = "SELECT id, tags, geom FROM nodes WHERE %s" % subset
         self.updatequery = "SELECT id, tags, geom FROM node_changeset WHERE action <> 'D' AND %s" % (subset)
     if self.srid != "4326":
         transform = "ST_Transform(%s, %s)" % (transform, self.srid)
     self.transform = transform
Ejemplo n.º 7
0
    def __init__(self, db, name, subset):
        PGTable.__init__(self, db, name)
        updateset = "WHERE id = ANY(ARRAY(SELECT id FROM %s_changeset WHERE action <> 'D'))"
        if subset is None:
            wherequery = "WHERE tags is not null"
        else:
            wherequery = "WHERE %s" % subset
            updateset = "%s AND %s" % (updateset, subset)
        self.node_construct = 'SELECT id, tags, geom FROM nodes %s' % wherequery
        self.way_construct = 'SELECT id, tags, ST_Centroid(osgende_way_geom(nodes)) as geom FROM ways %s' % wherequery
        self.node_update = 'SELECT id, tags, geom FROM nodes %s' % updateset
        self.way_update = 'SELECT id, tags, ST_Centroid(osgende_way_geom(nodes)) as geom FROM ways %s' % updateset

        if self.srid == '4326':
            transform = '%s'
        else:
            transform = 'ST_Transform(%%s, %s)' % self.srid
        self.transform = transform
Ejemplo n.º 8
0
 def __init__(self, db, name):
     PGTable.__init__(self, db, name)
 def __init__(self,db):
     PGTable.__init__(self, db,
                      name=conf.DB_DEFAULT_STYLE_TABLE)
Ejemplo n.º 10
0
 def __init__(self, db):
     PGTable.__init__(self, db, name=conf.DB_DEFAULT_STYLE_TABLE)
Ejemplo n.º 11
0
    def __init__(self, db, mastertable, name="joined_ways"):
        PGTable.__init__(self, db, name)

        self.master_table = mastertable
Ejemplo n.º 12
0
 def __init__(self, db, name, subset, country_table=None, country_column='code', uptable=None):
     PGTable.__init__(self, db, name)
     self.subset = subset
     self.country_table = country_table
     self.country_column = country_column
     self.update_table = uptable