tests.py 文件源码

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

项目:smoomapy 作者: mthh 项目源码 文件源码
def test_input_with_missing_values(self):
        gdf = GeoDataFrame.from_file("misc/nuts3_data.geojson")
        gdf.loc[12:18, "gdppps2008"] = np.NaN
        StePot = SmoothStewart(gdf, "gdppps2008",
                               span=65000, beta=2, resolution=100000,
                               mask=gdf)
        result = StePot.render(9, "equal_interval", output="Geodataframe")
        self.assertIsInstance(result, GeoDataFrame)
        self.assertEqual(len(result), 9)

        gdf2 = GeoDataFrame.from_file('misc/nuts3_data.geojson').to_crs({"init": "epsg:3035"})
        gdf2.loc[:, 'gdppps2008'] = gdf2['gdppps2008'].astype(object)
        gdf2.loc[15:20, 'gdppps2008'] = ""
        gdf2.loc[75:78, 'gdppps2008'] = ""
        StePot = SmoothStewart(gdf2, 'gdppps2008', span=65000, beta=2, resolution=48000, mask=gdf2)
        result = StePot.render(9, 'equal_interval', output="GeoDataFrame")
        self.assertIsInstance(result, GeoDataFrame)
        self.assertEqual(len(result), 9)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号