• 2010年8月25日周三_Editing_6.14


    /****************************************************************************************/

    //2010年8月25日 周三

    //InsideTheAPI_Editing

    //version 2.0

    /****************************************************************************************/

    At version 2.0, the ArcGIS APIs for JavaScript, Flex, and Silverlight introduce the ability to edit geographic data over the Web. Since a Web browser is a simple, familiar and free application, Web-based editing allows a larger group of people to add and improve on your data. These include field workers, analysts in other departments of your company, or perhaps even crowd-sourced volunteers who may be able to make valuable contributions to your data given a simple editing interface.

    在2.0版本,ArcGIS API for Javascript 和Flex 和silverlight 介绍了一个通过web对Geographic 数据编辑的能力。 浏览器是一个简单的、熟悉的、和自由的应用程序,基于网络的编辑,允许一大群人在你的数据上进行添加和移动。这包括field workers,对你公司其他的部门进行分析,或者来自于自愿者的人群,这些人可以对你的数据做出贡献。

    The APIs include components (or widgets) that help you add editing functionality to your applications. You can do some design work in both your map and your Web application to simplify the end user experience when editing. For example, you might predefine a set of feature templates, new in ArcGIS 10.0, to make it easier for users to add certain types of common features. You might also limit the attributes that can be added, and add some available attribute options in a drop down list to facilitate accurate, uniform data entry. As the designer of a Web editing application, you have complete control over how simple or complex of an editing experience you expose to your users.

    APIs 和组件(或者Widget)帮助你向你的应用程序中添加编辑功能。你可以在你的地图或者你的web应用程序中做一些设计工作,在编辑的时候简化用户的最终体验。 比如:你可以预先定义一些 feature templates,这个功能是ArcGIS 10中的新功能,这样用户就能够更加容易一些添加

    某些类型的通用Features。你也可以限制你可以添加的属性,添加一些能够在下拉框里面获取的属性,方便准确的、统一的数据输入。作为一个web编辑应用程序的设计者,你拥有完全的控制权,来控制你暴露给你的用户的编辑体验简单负责的程度。

    Web editing requires some initial setup of a feature service, which exposes information about a layer's feature geometries and attributes. Also, geometry services can be used to accomplish some Web editing tasks. In order to use the main Editor component, for example, you must have a running geometry service.

    Web 编辑需要对feature 服务做一些初始化的设置,它公开关于一个图层feature的geometries和属性信息。Geometry服务可以用来完成一些web 编辑任务。 为来使用那些主要的编辑组件,比如,你必须要有一个Geometry服务。

    What can I do with editing in the ArcGIS Web APIs?

    The ArcGIS Web APIs provide simple feature editing. The features must come from an ArcSDE geodatabase. This geodatabase can be licensed for either workgroup or enterprise use and does not have to be versioned.

    When editing data with the Web APIs, you can add, delete, cut (split), merge (union), and reshape features. You can also edit feature attributes. If you attempt to modify the same feature at the same time as someone else, the last edits to be made are the ones committed to the database.

    在ArcGIS web APIS我们可以使用编辑功能做什么?

    ArcGIS Web APIs提供了简单的要素编辑能力。 Features必须来自于一个ArcSDE地理数据库。这个地理数据库可以为编辑工作组或者企业应用发布牌照,并且不需要被翻译。

    当用ArcGIS Web APIs编辑数据的时候,你可以添加、删除、裁剪、合并和重新改造features。 你也可以编辑要素的属性。如果你像其他人一样试图在同一时间对同一个要素的属性进行修改,那么对要素的最后的编辑将会提交到数据库里面。

    For certain Web editing workflows, it is a good idea to have an analyst using ArcGIS Desktop periodically(.偶然地,定期地) review the edits to verify data integrity(完整). Although the editing components can perform some data validation(使生效), other tasks such as validating topologies cannot be performed over the Web.

    对于某一些web编辑流,使用ArcGIS Desktop定期分析、重新查看来检查数据的完整性是一个很好的注意。 今天编辑组件可以让一些数据生效,但是其他的一些任务,比如:使拓扑有效,就不能通过web执行。

    How do I add editing functionality to my application?

    The ArcGIS API for Flex provide multiple components to make it easier for you to add editing functionality to your Web applications.

    如何添加编辑功能到我的应用程序?

    ArcGIS API for Flex 提供了多种的组件,能够让你很容易的添加编辑功能到你的应用程序中。

    1. Editor component

    If you want to get started quickly, or if you just want to use the default editing interface included with the API, use the Editor component. The Editor component combines the functionality of the other components to provide everything that you need for editing a layer. You can choose the number and types of tools that are available on the component.

    The Editor component saves your edits immediately after they are made, for example, as soon as you finish drawing a polygon. If you decide not to use the Editor component, you must determine for yourself when and how often you want to apply edits.

    If you don't use the Editor component, you need to code your own editing experience. However, you can still take advantage of the DrawTool, EditTool, TemplatePicker, AttributeInspector and AttachmentInspector to help you - as shown in the Edit without Editorsample.

    如果你想快速的进行操作,或者你只想使用API中默认的编辑接口,那么就使用Editor componentEditor component。合并了其他组件的所有功能,并向你提供当编辑图层的时候所需要的所有的功能。 你可以选择组件中可以获取的工具的数量和种类。

    Editor component 在你完成编辑工作后就立刻可以进行保存,比如:只要你完成了绘制一个polygon,Editor component 就会立刻将其保存。

    如果你决定不使用编辑组件,你就必须为你自己决定,什么时间和多久你想应用编辑。

    如果你没有使用编辑组件,你需要编码实现你的编辑体验。 尽管如此,你任然还是可以使用DrawTool, EditTool,TemplatePicker ,attributeInspector和AttachmentInspector来帮助你。

     

    2. TemplatePicker component

    The TemplatePicker component displays a set of pre-configured feature choices that the user can create. The Template Picker is a great way to expose pre-configured feature types for easy editing and quality control. The symbols in the Template Picker come directly from the editing templates that you defined in the map document of your feature service.

    A Template Picker is included in the Editor component. The Template Picker can also be used on its own as a simple legend for your map.

    TemplatePicker组件

    TemplatePicker组件展示了一套预先定的Feature的选择,用户也可以自己创建这些选择项。TemplatePicker是一个很好的方法展示预先定义的feature类型,用于轻松编辑和质量控件。TemplatePicker中的symbols直接来自于编辑模板,这些编辑模板是在你的feature 服务的地图文档中定义的。

    一个TemplatePicker 包含在编辑组件里面。TemplatePicker 可以单独使用,作为一个简单的legend应用到你的地图中。

     

    3. AttributeInspector component

    When you make attributes available for editing on the Web, you need to provide an interface for users to edit the attributes, and you must ensure that the data they enter is valid. The Attribute Inspector component can help you with both these tasks.

    The Attribute Inspector reads the attribute fields available through your feature layer and provides a user interface for easily updating those fields. It also validates data entered in the fields, ensuring that the input matches the expected data type. For example, if a coded value domain is applied to a field, the permitted values appear in a drop down list, restricting the possibility of other values being entered. If a field requires a date value, a calendar appears, helping the user to supply a valid date.

    The Attribute Inspector exposes the available attributes on the layer for editing. Use the outFields property on the FeatureLayer to set the available attributes.

    An Attribute Inspector is included in the Editor component.

    当你让attributes在wen中处于可以编辑的状态,你需要为用户提供一个接口编辑属性,并且你还要保证你输入的数据是可以获取的。Attribute Inspector component组件可以在这两个任务中帮助你。Attribute Inspector阅读在你的FeatureLayer可以获取的fields,并提供一个用户接口,是使之很容易更新这些fields. 并使输入到Fields中的数据生效,并确保用户的输入匹配的期望的数据类型。 比如:如果一个编码值域应用到一个field、那些允许的值出现在一个下拉框。 限制其他可能输入的值。 如果一个字段值需要一个时间数值,出现一个日历,帮助用户提供一个可以使用的值。

    Attribute Inspector 展示了图层中用于的可以获取的属性。使用FetrueLayer的outFields属性来设置那些可以获取的属性

     

     

    4. AttachmentInspector component

    In some situations, you may want to associate a downloadable file with a feature. For example, you might want users to be able to click a feature representing a piece of real estate and see a link to a PDF file of the title deed. In the ArcGIS Web APIs, an associated downloadable file like this is known as a feature attachment. See the FAQ on How do I upload large attachments.

    The AttachmentInspector component helps users upload and view the list of feature attachments. The Attachment Editor includes a list of current attachments (with Remove buttons), as well as a Browse button that can be used to upload more attachments. The Attachment Editor works well inside an InfoWindow, but can be placed elsewhere on the page.

    In order to use feature attachments, attachments must be enabled on the source feature class. You can enable attachments for a feature class in ArcCatalog or the Catalog window in ArcMap.

    在某些情况下,你想把一个下面的文件和一个Feature关联起来。 比如:你想单击一个代表工业绿地的Feature,然后查看与之连接的一个PDF文件。在ArcGIS Web APIs 中和这个类似的下载文件我们称之为附属物。 在How do I upload large attachments 中查看FAQ。。

    AttachmentInspector component帮助用户下载和查看feature所属物的列表。The Attachment Editor包含当前附属物的一个列表,和一个浏览器按钮一样,可以被用来下载更多的附属物。The Attachment Editor 在一个infowindow中可以很好的工作,但是也在可以在页面的任何位置被取代。

    为了使用feature的附属物,在源Feature类上附属物是必须可以使用的。你可以在ArcCatalog或者ArcMap中的Catalog窗口中为Feature关联附属物。

    How does editing work?

    Editing 是如何工作的?

    Editing with the ArcGIS Web APIs works through the feature service, a new type of service available with ArcGIS 10.0. Editing workflows can also take advantage of the geometry service.

    和ArcGIS Web APIs一起进行编辑贯穿于Feature 服务, feature service  是一个新的服务类型,她在ArcGIS 10.0中是可以获取的。 Editing 流野可以利用Geometry 服务 。

    The role of the feature service

    Web editing requires a feature service to provide the symbology and feature geometry of your data. The feature service is just a map service with the Feature Access capability enabled. This capability allows the map service to expose feature geometries and their symbols in a way that is easy for Web applications to use and update.

    Web 编辑 需要一个Feature 服务来提供symnbology和你的数据的Feature Geometry。 Feature 服务就是一个地图服务,这个服务拥有feature访问能力。 这个能力允许地图服务使用一个方式来暴露要素 geometries和他们的symbols ,使用这种方式,一个web 应用程序会很容易的使用和更新这些要素的Geometries和symbols。

    Before you build a Web editing application, you need to do some work to create a feature service exposing the layers that you want to be edited. This involves setting up a map document and, optionally, defining some templates for editing. Templates allow you to pre-configure the symbology and attributes for some commonly-used feature types. For example, to prepare for editing roads, you might configure templates for "Controlled Access Freeway", "Other Divided Highway", "State Highway", and "Local Road". Templates are optional, but they make it easy for the end user of the application to create common features.

    在你创建一个web 编辑应用程序之前,你需要做一些工作来创建一个Feature服务来发布你要进行编辑的图层。 这涉及到设置一个地图文档,也可以选择性的定义一些用于编辑的模板。 模板允许你提前定义一些通用feature类型的symbology和属性。 比如:为了编辑路,你可能为”Controlled  Access Freeway”,"Other Divided Highway", "State Highway", and "Local Road".的配置模板。 模板是可选的,但是她为应用程序的最终用户创建通用Features提供了很大的便利。

    Once your map is finished, you need to publish it to ArcGIS Server with the Feature Access capability enabled. This creates REST URLs, or endpoints, to both a map service and a feature service. You will use these URLs to reference the services in your application.

    Feature services are accessible in the Web APIs through a new type of layer called a feature layer. Feature layers can do a variety(品种、种类、变化、多样) of things and can reference a layer in either a map service or a feature service; however, when you use a feature layer for editing purposes you need to reference a layer in a feature service.

    一旦你的地图完成,你就要将它发布为ArcGISServer地图服务,并且带有feature 的访问能力。 这就创建了REST URLs或者终点指向地图服务或者一个Feature 服务。  你将使用这些URL在你的应用程序中来引用这些服务。 通过一个称为Feature Layer的新图层类型在WEB APIs中,feature 服务是可以获取的。 Eature layers 可以多多种的事情,可以在一个地图服务或者feature 服务中引用一个图层,尽管如此,当你使用一个Feature图层用于编辑目的,你需要在feature服务中引用一个feature layer。

    When you perform editing, your Web application tells the feature layer which attributes have changed and, if applicable, how the geometry changed. The feature layer also displays the updated features after editing. You can call the applyEdits() method on the feature layer to apply the edits, which then commits them to the database.

    当你编辑的时侯,你的web 应用程序告诉Feature Layer那个属性已经改变,并且,如果合适的话,geometry是如何改变的。 Feature layer还要展示编辑后的新后的features。 你可以调用feature layer的applyEdits()方法来应用编辑,然后将他们提交到数据库。

     

    The role of the geometry service

    The ArcGIS Server geometry service helps perform common editing operations such as creating, cutting, and reshaping geographic features. Before you use the Editor component, you need to create a geometry service on your ArcGIS Server. Then when you create the Editor component, you must provide the URL to the geometry service. The component uses the service behind the scenes, and you won't have to call methods on the geometry service yourself unless you decide not to use the component.

    Geometry 服务的角色。

    ArcGIS Server Geometry服务帮助执行通用的编辑操作,比如:创建、剪切,reshaping  图形要素。在你使用编辑组件之前,你需呀创建一个Geometry服务在你的ArcGIS 服务器中。 然后,但你创建编辑组件,你必须提供一个执行geometry service 服务的URL.在场景的后面,这些组件使用服务,你也不用必须去调用Geometry上的服务,除非你已经决定不在使用组件。

     

    If you decide not to use the Editor component, you can still use the geometry service to help you code your own editing tools. The geometry service can also help you validate data. For example, you can use the geometry service to perform checks on edits, such as "no edit may fall outside this box", or "a polygon boundary may not cross itself". The Editor component actually calls the simplify() method on the geometry service before it commits a geometry to your database. Although ArcGIS topology validation is not available through the Editor component or editing-related classes, the geometry service may help you achieve a similar result through these types of data integrity checks.

    如果你决定不使用编辑组件,你任然可以使用Geometry服务来帮助你编码你自己的编辑工具。Geometry服务还可以帮助你使数据生效。 比如:

    你可以使用Geometry服务在编辑中执行检查,比如:查询没有超出查询的范围,或者一个多边形的边界可能没有穿过它自己。 编辑组件在提交到数据库之前,实际上调用geometry 服务上面的simplify()方法。 尽管通过编辑组件或者和编辑相关的类,ArcGIS的拓扑关系不能生效,但是Geometry服务可能帮助你通过这些数据类型完整性的检查达到一个相似的结果。

     

    The EditTool

    The EditTool helps you move graphics or their individual vertices. This is helpful in scenarios(n.剧情说明书,剧本) where you are not using the Editor component and you need to write your own editing logic, especially the client display behavior.

    编辑工具:

    编辑工具帮组你移动Graphics或者他们的独立的顶点。 在不使用Editor组件的情况下,你需要写你自己的编辑逻辑,指明客户端展示动作。

    The DrawTool

    The DrawTool helps you create new features by drawing them. It is commonly used in combination with the TemplatePicker to create new features based on the selected feature template.

    绘制工具、

    绘制工具帮助你通过绘制他们来创建新的features。 非常常见她和TemplatePicker合并一起使创建基于选中的要素模板的新要素。

    Designing your editing experience

    When you build a Web editing application, it is important to think about who will use the application and what they will need to do. You should provide your users no more and no less than the tools they need. In most situations you can design an appropriate editing experience for your users through a combination of the editing components included with the API. Keep in mind that although the API includes a comprehensive Editor component to help you get started, this particular component may not be the best fit for your scenario.

    设计你的编辑体验

    当你创建一个web 编辑应用程序,考虑谁将会使用应用程序或者他们需要使用是非常重要的。你应该向用户提供刚好他们所需要的工具。在很多的情况下,你可以通过一个包含在API中的编辑工具的组合来为你的用户设计一个编辑体验属性。 你应该记住,尽管API包含一个综合的编辑组件来帮助你入门,但是,这个特定的组件对你的场景来说可能不是最合适的。

     

    In some ways, the editing experience with the API has already been simplified for you. The components include no buttons for starting and stopping edit sessions, or for saving edits. You can provide these functions, but they're not necessary for most applications.

    在一些方法中,和API相关的编辑体验已经为你简化过了。组件里面不含有用于开始编辑、停止编辑,或者保存编辑的按钮。你可以提供这些功能,但是在大多数的应用程序中他们不是必须的。

    Consider the following approaches for designing a Web editing application. Each approach has its own merits and types applications for which it is most appropriate(恰当的 vt.侵吞;拨出...供专用).

    考虑下面用于设计web编辑应用程序的方法。 每一个方法有她自己的优点和与他最合适的应用程序类型。

    Feature sketching

    In this type of application, field analysts need to sketch(.草图;梗概;素描 v.素描;概述) simple events on the map, such as bird sightings. The geographic precision of the edits is not as important as the event's attributes and the fact that the event happened. In this type of an application, you can use a Template Picker to limit the types of items users can sketch. The Attribute Inspector is also useful, either in a side panel or in an info window that appears when the feature is clicked. Options for splitting and merging features, adding a point at an X/Y location, snapping, or uploading feature attachments may clutter the application and should be avoided unless absolutely needed.

    View a sample that shows how to build a feature sketching application.

    在这种应用程序中,字段分析需要描述地图中的简单事件,比如,鸟视界。 精确的地理编辑没有事件的属性那么重要,事实是事件发生了。 在这种的应用程序中,你可以使用一个Template Picker 来限制用户可以描述的items的类型。Attribute Inspector也是有用的,不管是一个panel的内部还是一个infowindows,他们都是在feature上面单击的才出现的。用于分割和合并要素、添加一个点到一个X/Y位置或者下载feature的附属物的选项可能会扰乱你的应用程序,因为他应避免使用它,除非确实需要。

    Attribute-only editing

    Some editing applications include a mapping component, but don't require any changing of geographic features. For example, you might want to create a Web application allowing any office employee to edit the attributes of a parcel feature in your database. You want to prevent them from editing the geometry, leaving that task to your GIS analysts. In this scenario, you can include a map in your application, but expose editing only through the Attribute Inspector. A simple map click on a parcel displays the attributes to be edited. You don't need to include any buttons or components for creating, deleting, or reshaping features.

    View a sample that shows how to build an attribute editing application.

    一些编辑的应用程序需要一个地图组件,但是不需要geographic要素的任何改变。 比如:你可能想要创建一个web应用程序,它允许任何的办公室工作人员来编辑一个数据库中包数据的数据额属性。你想要阻止编辑geometry,将这个任务留给你的ArcGIS分析。 在这样的场景下,你可以在你的应用程序中包含一个地图,但是只能通过Attribute Inspector来暴露编辑。 在一个包上面的单击地图,出现将要被编辑的属性。你不需要包含任何按钮和组件用于创建、删除、reshaping feature。

     

    Citizen(市民) participation(参与), or geo-wiki

     

    In this type of application, citizens can be the editors and report problems to a government organization by placing points on the map and including ancillary(助手) information such as photographs or a brief description.

    Users of this type of application do not even know that they are editing GIS data. They are only allowed to add point features to the database, using a carefully selected set of incident types that you predefined in a Template Picker. Attachments are allowed through the Attachment Inspector component so that citizens can upload images of the incident. Attribute editing may be allowed to a very limited degree so that citizens can describe the incidents.

    In this type of application, you may have to code some security checks to ensure that users can only edit or delete their own incidents. You may also include logic to periodically(ad.偶然地,定期地) clean out the database, or allow a subset of authenticated users to close or delete incidents.

    View a sample that shows how to build a citizen participation application.

    在这种类型的应用程序中,市民可以是编辑者并向政府组织报告问题,它可以通过在地图放置一个点并包含辅助的信息,比如:图标、一个简短的描述。

    这种应用程序的用户甚至还不知道他们正在编辑GIS数据。 他们只允许向数据库中添加点要素,使用一个仔细选择的事件类型,这些事件类型是你事先在Template Picker中定义的。通过Attachment Inspector组件是可以添加附件的,因此用户可以upload事件的图片。 属性编辑可能会允许一个有限程度,因此市民可以对事件进行描述。

    在这种应用程序中,你可能必须编码一些安全的检查,保证用户只能编辑、删除他们自己的事件。 你可能也包含一些逻辑去定期的清空数据库或者允许管理员用户来关闭或者删除事件。

  • 相关阅读:
    Python3 日期与时间戳相互转换
    PHP 二维数组排序保持键名不变
    C# Command命令(行为型模式)+队列 实现事务,带异步命令重试机制和生命周期
    领域驱动系列五模型驱动设计的构造块
    领域驱动系列四之模型驱动
    领域驱动系列三
    领域驱动系列二策略模式的应用
    领域驱动系列一基本概念介绍
    Redis学习系列七分布式锁
    Redis学习系列六ZSet(有序列表)及Redis数据结构的过期
  • 原文地址:https://www.cnblogs.com/xingchen/p/1808767.html
Copyright © 2020-2023  润新知