__init__.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:python-fhrs-osm 作者: gregrs-uk 项目源码 文件源码
def get_district_mismatches(self, comparison_view='compare', district_id=182):
        """Get OSM entities which have an fhrs:id for which there is no match
        in the database.

        district_id (integer): Boundary Line district ID
        Returns dict
        """

        dict_cur = self.connection.cursor(cursor_factory=DictCursor)

        sql = ('SELECT osm_name, osm_fhrsid, TRIM(TRAILING ' ' FROM osm_type) as osm_type,\n' +
               'osm_id, CONCAT(substring(osm_type FROM 1 FOR 1), osm_id) AS osm_ident\n' +
               'FROM compare\n' +
               'WHERE status = \'mismatch\' AND osm_district_id = %s')
        values = (district_id,)
        dict_cur.execute(sql, values)

        result = []
        for row in dict_cur.fetchall():
            result.append(row)

        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号