예제 #1
0
    def create_table_objects(self):
        # stores all modified routes (no changes in guideposts or
        # network nodes are tracked)
        self.update_table = osgende.UpdatedGeometriesTable(
            self.db, conf.DB_CHANGE_TABLE)
        self.update_table.srid = conf.DB_SRID

        # Route segments for the routable network
        self.segment_table = osgende.RelationSegments(
            self.db,
            conf.DB_SEGMENT_TABLE,
            conf.TAGS_ROUTE_SUBSET,
            uptable=self.update_table)
        self.segment_table.srid = conf.DB_SRID
        self.segment_table.set_num_threads(self.options.numthreads)

        hiertable = osgende.RelationHierarchy(
            self.db,
            name=conf.DB_HIERARCHY_TABLE,
            subset="""SELECT id FROM relations
                                      WHERE %s""" % (conf.TAGS_ROUTE_SUBSET))

        hroutes = hrel.Routes(self.db, self.segment_table, hiertable)
        hroutes.set_num_threads(self.options.numthreads)

        self.data_tables = [
            self.segment_table,
            hiertable,
            hroutes,
            hposts.GuidePosts(self.db, 'skating', True),
        ]
        self.style_tables = [hstyle.SkatingStyleDefault(self.db)]
예제 #2
0
    def create_table_objects(self):
        # stores all modified routes (no changes in guideposts or 
        # network nodes are tracked)
        self.update_table = osgende.UpdatedGeometriesTable(self.db, conf.DB_CHANGE_TABLE)
        self.update_table.srid = conf.DB_SRID

        # Country polygons
        countries = hadmin.CountryTable(self.db)

        # Route segment for the routable network
        self.segment_table = osgende.RelationSegments(self.db, 
                         conf.DB_SEGMENT_TABLE,
                         conf.TAGS_ROUTE_SUBSET,
                         country_table=countries,
                         country_column='code',
                         uptable=self.update_table)
        self.segment_table.srid = conf.DB_SRID
        self.segment_table.set_num_threads(self.options.numthreads)

        # table saving the relation between the routes
        hiertable = osgende.RelationHierarchy(self.db,
                            name=conf.DB_HIERARCHY_TABLE,
                            subset="""SELECT id FROM relations
                                      WHERE %s""" % (conf.TAGS_ROUTE_SUBSET))

        routetable = hrel.Routes(self.db, self.segment_table, hiertable)
        routetable.set_num_threads(self.options.numthreads)

        self.data_tables = [
            self.segment_table,
            hiertable,
            routetable,
            hposts.GuidePosts(self.db, 'hiking'),
            hposts.NetworkNodes(self.db),
        ]
        self.style_tables = [
            hstyle.HikingStyleDefault(self.db)
        ]