SPAN8.
SPAN4.
database-transformers-advanced.fmwt
FME contains a number of Workbench transformers specifically designed for use with databases. These come under the Workflows category in the transformer gallery. Such transformers are commonly used to query a database, but can also be used to dispatch updates and insertions or perform spatial relationships with data residing in a database.
出于我们的目的,地理数据库是此类数据库的一个示例。
为什么要使用变压器?
Transformers are sometimes preferable to using a writer to carry out updates because you may wish to only apply a change to a small subset of data, or you may wish to use a special where clause that isn’t available when you choose a writer's UPDATE mode. However, unless you need these functions for a specific reason, you should use a writer instead.
arcsdequerier
The ArcSDEQuerier is a transformer for issuing commands to an ArcSDE database. This transformer can issue update and delete commands, but – as mentioned – it’s better to use the SDE writer where possible. In query mode a full set of spatial interactions is available.
FeatureReader
FearyureReader变压器可用于读取任何FME支持的数据格式。第一次使用此变压器是简单地读取数据集,就像读者一样。变换器由传入功能启动以读取现有数据集。然后它将数据集的内容返回为功能。换句话说,它真的正在做工作台读者的作业,而是在工作空间的转换阶段。启动器功能可以来自读者,或来自创建器变压器。
该变压器的第二个作用是对正在读取的数据上进行空间和非空间查询。以这种方式,可以将任何数据格式视为数据库。例如,如果发起者特征是多边形,则可以使FextureReader从选定数据集中读取点特征,其中这些点落在传入的多边形内。
The example below will demonstrate such functionality.
Grid(ESRI文件地理数据库功能类)
Address Points(ESRI文件地理数据库功能类)
在上面的图像中,我们看到网格和地址点的可视化功能类以及它们的伴随属性。
The task here is to read all Addresses within a specified city Grid square. Because the addresses do not have a city Grid cross-reference, this will have to be done with a spatial, rather than non-spatial, query.
一个方法是读取整个地址数据集,然后将其滤除对选定的网格正方形。但是,如下所示,执行任务的更有效的方法是使用FeateureReader变压器。
1. Read Grid Data
Grid feature geometry is read from the source feature class using the Esri Geodatabase (File Geodb) reader. The Grid feature will provide the spatial constraint that will be used when querying against the Address Points dataset. Instead of reading in the entire Grid dataset, we will use the WHERE clause functionality on the File Geodatabase reader to select a specific Grid square to act as our spatial constraint for our Address Points feature class. Such functionality can provide efficiency and performance to the workflow.
将ESRI地理数据库(File GeoDB)读取器添加到工作区,然后单击“参数”按钮。选择Grid作为读取和参数的Where子句部分的表对话框类型FaceText ='L13'(记住包含单引号)。
The WHERE clause will query the underlying File Geodatabase and return only the Grid square that matches the query. It should be noted that the WHERE clause can be adjusted after adding the reader via the Navigation tree in Workbench.
2。Read Address Points
Address feature geometry is read from the source feature class using the FeatureReader transformer. The Grid square selected in Step 1 will act as the initiating feature and the spatial query for the FeatureReader.
将FeatureReader变压器添加到工作区,并将网格方读取器连接到FearyureReader的启动器端口。打开FeatureReader参数对话框。对话的读取器部分要求查询数据的位置。这是地址点数据的位置。
Next, under the Feature Types to Read section of the dialogue, click on the [...] button and select the Address Points feature class. While the WHERE Clause can be left empty in this instance (we already selected AddressPoints), we do need to select a spatial interaction.
从空间过滤器下拉菜单中选择包含。完成后,您的FeatureReader参数对话框应如下所示:
3. Visualize Result
将Inspector变压器连接到要素读取器上的AddressPoints输出端口。运行工作区。与所选网格正方形对应的地址差块应出现在数据检查器中。覆盖原始网格数据以证明查询正常工作。
高级任务
Some addresses in the dataset have a Status field whose value is ‘Retired’ – indicating an address that is no longer valid. You can see this in the Data Inspector table view:
Use the FeatureReader WHERE clause to filter out addresses with this status.
在没有WHERE子句的情况下为所选网格广场进行一项功能计数。这将有助于确认查询正常运行。例如,在排除退休地址时,Square L13总共有307个地址或278。
©2019 S亚搏在线afe Software Inc |合法的