o2g/osm/exporter.py
def process(self):
        """Process the files and collect necessary data."""

        # Extract relations
        self.rh = RelationHandler()
        self.rh.apply_file(self.filename)

        logging.debug('Found %d public transport relations.', len(self.rh.relations))

        # Collect ids of interest
        node_ids, stop_node_ids, way_ids, reverse_map = self.__collect_ids()

        # Extract nodes
        self.nh = NodeHandler(node_ids)
        self.nh.apply_file(self.filename, locations=True)

        count = 0
        for idx, missing_node_id in enumerate(self.nh.missing_node_ids):
            count += 1
            logging.warning(
                '[no data] missing stop node. rel: https://osm.org/relation/%s node: https://osm.org/node/%s.',
                reverse_map[missing_node_id], missing_node_id)

        if count:
            logging.warning(
                '%d nodes that appear in relations are missing.',
                count)
        else:
            logging.debug('Lucky you! All relation member nodes were found.')

        # Extract ways
        self.wh = WayHandler(way_ids)
        self.wh.apply_file(self.filename, locations=True)
def process(self):
        # Extract relations
        self.rh = RelationHandler()
        self.rh.apply_file(self.filename)

        logging.debug('Found %d public transport relations.', len(self.rh.relations))

        # Collect ids of interest
        node_ids, stop_node_ids, way_ids, reverse_map = self.__collect_ids()

        # Extract nodes
        self.nh = NodeHandler(node_ids)
        self.nh.apply_file(self.filename, locations=True)

        count = 0
        for idx, missing_node_id in enumerate(self.nh.missing_node_ids):
            count += 1
            logging.warning(
                '[no data] missing stop node. rel: https://osm.org/relation/%s node: https://osm.org/node/%s.',
                reverse_map[missing_node_id], missing_node_id)

        if count:
            logging.warning(
                '%d nodes that appear in relations are missing.',
                count)
        else:
            logging.debug('Lucky you! All relation member nodes were found.')

        # Extract ways
        self.wh = WayHandler(way_ids)
        self.wh.apply_file(self.filename, locations=True)
def process ( self ) : # Extract relations self . rh = RelationHandler ( ) self . rh . apply_file ( self . filename ) logging . debug ( 'Found %d public transport relations.' , len ( self . rh . relations ) ) # Collect ids of interest node_ids , stop_node_ids , way_ids , reverse_map = self . __collect_ids ( ) # Extract nodes self . nh = NodeHandler ( node_ids ) self . nh . apply_file ( self . filename , locations = True ) count = 0 for idx , missing_node_id in enumerate ( self . nh . missing_node_ids ) : count += 1 logging . warning ( '[no data] missing stop node. rel: https://osm.org/relation/%s node: https://osm.org/node/%s.' , reverse_map [ missing_node_id ] , missing_node_id ) if count : logging . warning ( '%d nodes that appear in relations are missing.' , count ) else : logging . debug ( 'Lucky you! All relation member nodes were found.' ) # Extract ways self . wh = WayHandler ( way_ids ) self . wh . apply_file ( self . filename , locations = True )
Process the files and collect necessary data.
Process the files and collect necessary data .