CrimeMap.py 文件源码

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

项目:BlueLines 作者: JacksYou 项目源码 文件源码
def gen_points(self, dataframe, map):
        """places points from coords in dataset onto a map

        Args: 
            dataframe: dataset to get coords from
            map: map
        """
        points = pd.Series(
            [Point(self.base_map(mapped_x, mapped_y)) for mapped_x, mapped_y in
             zip(dataframe['Longitude'], dataframe['Latitude'])])
        crimes = MultiPoint(list(points.values))

        polygons = prep(MultiPolygon(list(map['poly'].values)))
        return list(filter(polygons.contains, crimes))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号