span8
span4
span8
span4
In this tutorial we will translate a DWG file representing traffic signals to Esri shapefile (SHP).The signals are stored as blocks in the DWG file, and there is a text entity which holds the signal ID.Our goal is to:
This transformation highlights one way to work with AutoCAD block entities in FME: not exploding blocks (preserving their insertion points) works well when translating to a format that does not store such complex entities, or require single geometries in the output.
The data used in this tutorial originates from open data made available by the温哥华市, British Columbia.It contains information licensed under the Open Government License - Vancouver.
In the image below, we see an example of one of the traffic signals in this DWG file.The traffic signal is stored as a block.
In addition to this block there is a text label indicating an ID for the signal.This is not contained within the block, but rather it is stored on the TrafficSignals layer along with our block.
Let’s see how FME handles this data by looking at the DWG file in the FME Data Inspector, with the reader parameter爆炸块到实体unchecked:
FME has read the 'insert point' of the blocks, which represents the location of the block (in blue).Note that the red point represents the text insertion point, which is different.The blue insert point is what will be translated to the SHP file.The text representing the signal id's is also stored on the TrafficSignals layer, and is moved onto the insert point using a NeighborFinder transformer.
1)启动工作台并添加一个AutoCAD DWG / DXF阅读器到一个空白的工作区。
In the Add Reader dialogue, select AutoCAD DWG/DXF for the reader, and the trafficsignals.dwg file for the dataset.
Click on the Parameters button.
Ensure ‘Group Entities By’ is set to ‘Layer Name’.
We want to keep the block preserved as one single entity (point), so do not explode the blocks in the reader parameters:
Click OK twice.
We only need the TrafficSignals feature type, so deselect the ‘0’ feature type in the Select Feature Types dialog.
2)暴露autocad_text_string
Open TrafficSignals reader feature type in the Parameter Editor window by clicking on it.Click on the Format Attributes tab.Check autocad_text_string.点击应用。We will work with this attribute later.
3)添加GeometryFilter
Open the GeometryFilter transformer in the Parameter Editor window by clicking on it.分离从文本(其表示信号ID的)通过选择“点”和“文本”下“几何类型到过滤器”的点(它表示块的插入点)。这种准备数据的NeighborFinder。
4)添加NeighborFinder
从GeometryFilter到NeighborFinder的基本端口连接点。从GeometryFilter输出的文本连接到候选端口。
点击打开它在参数编辑器窗口中的NeighborFinder变压器。设置最大距离为5(使用数据检查测量工具,以确认这是一个很好的使用数量)。点击应用。
5)添加AttributeRenamer
重命名autocad_text_string到SignalID。
6)添加ESRI的shapefile作家
从作家菜单中选择Add作家。
添加ESRI的shapefile作家。选择数据集的位置。在shape文件定义下拉列表,选择手动。单击确定。
7)的输出端口从AttributeRenamer连接到写入
打开作家参数对话框。选择“用户属性”选项卡。添加您在AttributeRenamer(SignalID)创建的属性。点击应用。
8)运行的工作区,并检查输出数据
现在,您将看到有文本标签的属性表中的一个属性的单点。
DWG文本标签在数据检查的SHP属性。
Reading Basic Geodatabase Annotation - GDB to DWG
Polygon Within a Distance of Selected Features
How to Convert DGN to Shapefile (CAD Levels to GIS Attributes)
如何SHP转换为DWG(ESRI的shapefile到AutoCAD)
Determining Spatial Relationships
Tutorial: Getting Started with AutoCAD
Map and Map Feature Annotation
Reading AutoCAD Map 3D Object Data
© 2020 Safe Software Inc |Legal