一种基于卷积的城市范围检测方法。

urban-footprinter的Python项目详细描述


PyPI version fury.ioBuild StatusCoverage StatusGitHub licenseBinder

城市足迹

基于可重用卷积的栅格数据城市范围检测方法。在

LULCConvolution resultComputed urban extent
LULCConvolution resultUrban extent

该方法基于Atlas of Urban Expansion中使用的方法。其主要思想是,一个像素被视为城市范围的一部分,这取决于它周围的建成像素的比例。请参阅notebook overviewthis blog post以获取有关该过程的更详细描述。在

安装和使用

要使用pip安装:

$ pip install urban-footprinter

或克隆回购:

^{pr2}$

然后将其用作:

importurban_footprinterasufp# Or use `ufp.urban_footprint_mask_shp` to obtain the urban extent as a # shapely geometryurban_mask=ufp.urban_footprint_mask("path/to/raster.tif",kernel_radius,urban_threshold,urban_classes=urban_classes)

在哪里

help(ufp.urban_footprint_mask)

Help on function urban_footprint_mask in module urban_footprinter:

urban_footprint_mask(raster, kernel_radius, urban_threshold, urban_classes=None, largest_patch_only=True, buffer_dist=None, res=None)
    Computes a boolean mask of the urban footprint of a given raster.
    
    Parameters
    ----------
    raster : ndarray or str, file object or pathlib.Path object
        Land use/land cover (LULC) raster. If passing a ndarray (instead of the
        path to a geotiff), the resolution (in meters) must be passed to the
        `res` keyword argument.
    kernel_radius : numeric
        The radius (in meters) of the circular kernel used in the convolution.
    urban_threshold : float from 0 to 1
        Proportion of neighboring (within the kernel) urban pixels after which
        a given pixel is considered urban.
    urban_classes : int or list-like, optional
        Code or codes of the LULC classes that must be considered urban. Not
        needed if `raster` is already a boolean array of urban/non-urban LULC
        classes.
    largest_patch_only : boolean, default True
        Whether the returned urban/non-urban mask should feature only the
        largest urban patch.
    buffer_dist : numeric, optional
        Distance to be buffered around the urban/non-urban mask. If no value is
        provided, no buffer is applied.
    res : numeric, optional
        Resolution of the `raster` (assumes square pixels). Ignored if `raster`
        is a path to a geotiff.
    
    Returns
    -------
    urban_mask : ndarray

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
字典java cassandra对象映射注释   java定制Solr TokenFilter lemmatizer   字符串从Java文件中读取windows文件名   java如何在Windows上设置StanfordCorenlp服务器以返回文本   java axis2“意外的子元素值”   java使用POI HSSF获取错误   多线程Java等待计时器线程完成   java ForkJoinPool BuffereImage处理风格   从java代码运行Python脚本   java将字节[]转换为短[],使每个短元素包含13位数据   java如何为swing jframe应用程序将代码划分为类   java使用okhttp更改baseurl   java AlertDialog。建设者setView导致堆栈溢出错误   java如何在特定的radius 安卓 studio中接收地址列表?