跳转到主要内容

UDL.AI Python接口

项目描述

UDL.AI Python API

udlai 是一种通过方便的Python API与UDL.AI平台进行交互以进行位置智能的方式。

注意,要使用 udlai,您需要获取访问令牌。有关详细信息,请参阅 udl.ai

安装

udlai 可以从 PyPIconda-forge 安装。

pip install udlai

或者

conda install -c conda-forge udlai
# or alternatively
mamba install -c conda-forge udlai

功能

在不久的将来,udlai 将提供方便的接口来访问UDL.AI平台的各个部分。目前,仅提供功能API模块,允许您从UDL.AI数据仓库检索数据。

功能API

使用从UDL收到的令牌,您将能够执行以下任务

获取属性列表

获取用户可访问的所有属性列表,包括其元数据和描述。

>>> udlai.attributes(token)
      id                       name  ...  year value_formatter
0      1       Buildings floorspace  ...  2013            None
1      2        Buildings footprint  ...  2013            None
2      3                     Height  ...  2013            None
3      4                    Stories  ...  2013            None
4      9                   box_area  ...  2013            None
..   ...                        ...  ...   ...             ...
234  283             usefit_ind_old  ...     0            None
235  288  Distance secondary school  ...  None            None
236  294            Price 2 bedroom  ...  None            None
237  295            Price 3 bedroom  ...  None            None
238  296           Price 4 bedrooms  ...  None            None

[239 rows x 22 columns]

获取特定功能详情

获取特定属性的属性、描述和汇总统计信息。

>>> udlai.attribute_detail(token, 22)
id                                                                     22
name                                                          obj_compact
description             Compactness of object: C=obj_peri²/(4*box_area*π)
short_description                                                    None
unit                                                                    -
tags.id                                                                 4
tags.name                                                      Morphology
main_tag.id                                                             4
main_tag.name                                                  Morphology
data_version                                                         None
data_last_update                                                     None
data_processor                                                        UDL
source_provider                                            Swiss Topo TLM
source_provider_link    https://www.swisstopo.admin.ch/de/wissen-fakte...
coverage_general                                              Switzerland
epsg_code                                                            2056
min_value                                                        0.960614
max_value                                                       24.141694
standard_deviation                                               0.893447
mean                                                             1.647733
year                                                                 2013
value_formatter                                                      None
dtype: object

获取给定坐标(组)的功能值

获取提供的坐标位置或位置的功能值。

>>> udlai.features(token, 47.37, 8.54, [10, 11, 22], index_by="name")
box_length                 104
box_perim                  335
obj_compact    2.2064113123322
Name: (47.37, 8.54), dtype: object

获取感兴趣区域的汇总

获取特定区域内属性的汇总统计信息。

>>> udlai.aggregates(token, shapely_geom, [10, 12], index_by='name')
                  sum       mean  median   min    max        std
box_length  12921.0  94.313869    94.0  19.0  135.0  30.600546
box_width   13118.0  95.751825   100.0  29.0  142.0  30.870646

联系人

Martin Fleischmann (@martinfleis)

m.fleischmann@urbandatalab.net

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分发

udlai-0.5.0.tar.gz (51.4 kB 查看哈希值)

上传时间 源代码

构建分发版

udlai-0.5.0-py3-none-any.whl (14.7 kB 查看哈希值)

上传时间 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面