当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python ArcGIS HttpReceiver用法及代码示例


本文简要介绍 python 语言中 arcgis.realtime.velocity.feeds.HttpReceiver 的用法。

用法:

class arcgis.realtime.velocity.feeds.HttpReceiver(label, description, authentication_type, sample_message, data_format=None, track_id_field=None, geometry=None, time=None)

可选参数:

  • data_format: [ EsriJsonFormat GeoJsonFormat DelimitedFormat JsonFormat XMLFormat ]。包含此 feed 的数据格式配置的实例。仅配置允许的格式。如果在初始化期间未正确设置,则会自动检测格式并根据传入数据的样本进行设置。该示例将从 init 中迄今为止提供的配置中获取。
  • track_id_field: String 。应设置为轨道 ID 的传入数据的字段名称。
  • geometry: [XYZGeometrySingleFieldGeometry]。几何配置的实例,将用于从传入数据创建几何对象。
  • time: [TimeInstantTimeInterval]。时间配置实例,将用于根据传入数据创建时间信息。

返回:

具有 Http 接收器提要配置的数据类。

通过专用 HTTP 端点接收事件。该数据类可用于定义提要配置并创建提要。

Parameter

Description

label

String 。此 Feed 实例的唯一标签。

description

String 。饲料说明。

authentication_type

String 。认证类型。

选项:

none or arcgis.

sample_message

String 。样本内容以auto-detect的数据格式表示。

例如:

“name,agensam,23”

例子:

# Usage Example

from arcgis.realtime.velocity.feeds import HttpReceiver
from arcgis.realtime.velocity.http_authentication_type import (
    NoAuth,
    BasicAuth,
    CertificateAuth,
)

sample_message="name,age

dan,23"

http_receiver = HttpReceiver(
    label="feed_name",
    description="feed_description",
    authentication_type="none",
    sample_message=sample_message,
    data_format=None
)

# use velocity object to get the FeedsManager instance
feeds = velocity.feeds

# use the FeedsManager object to create a feed from this feed configuration
http_receiver_feed = feeds.create(http_receiver)
http_receiver_feed.start()
feeds.items

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 arcgis.realtime.velocity.feeds.HttpReceiver。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。