span8
斯潘4
本文将演示如何阅读,样式和排序特征类型,and how to set up a page layout for output to a PDF file.所附示例将生成二维地图输出,define how features can be drawn as a layer,and output map elements as individual layers.Our final cartographic output will be a map that includes:
The attached workspace includes the transformers and 亚搏在线workflow necessary to generate the PDF output you see below.You'll notice that individual layers have been created in the PDF file that allow the user to turn off and on the various map elements.
Place feature type readers for each layer to be included in the map.For our example,我们使用的是GML VotingDivisions(多边形特征类型)。GML投票地点(点特征类型)以及将用于背景图像的JPEG2000光栅。
我们希望我们的地图只包括指定为高级投票站的投票地点的点和标签。我们将使用测试变压器测试“Division”等于“Adv A”或“Adv E”(表示高级投票站)的投票位置。我们将设置测试人员将符合标准的数据传递给LabelPointReplacer以创建标签功能,and to an AttributeCreator transformer to maintain the underlying point feature geometry.所有其他不符合测试标准的点几何图形将被丢弃。
我们将使用boundingboxAccumulator从jpeg阅读器分支,为地图元素创建一个边界框。
标题和签名将使用两个创建者变压器生成,是“文本几何对象”。
Note:必须设置每个文本对象的高度值(即“height”不能为“0”);but all other Geometry Parameters can remain ‘0'.Also be aware that the height value specified in the Creator transformer will be overwritten when using the PDFStyler.
我们工作区的下一部分使用一系列的attributeCreator Transformers来分配如何绘制特性的顺序,要重命名几个输出层,修改点特征的尺寸参数。
We will create a new attribute simply called ‘_order' that will define the order of how feature types will be drawn.Lower values (i.e.“0”)将首先绘制(在底层上),and larger values (i.e.“5”)将最后绘制(在最顶层)。The actual sorting of layers occurs in the Sorter transformer based on this ‘_order' attribute.
还将使用attributeCreator转换器更改功能类型名称,以更好地反映其源数据集。例如,the AttributeCreator_BackgroundMap,属性创建器边界框,而attributeCreator_AdvancedVotingLabels Transformers使用“fme_feature_type”属性更改将写入PDF文件的层的名称。
The size of a point feature cannot currently be modified from within the parameters of the PDFStyler.However,有一个解决方法可以实现相同的结果。通过在attributeCreator Transformer中创建一个名为“pdf点宽度”的新属性,and changing its attribute values,we are able to change the size of the points displayed.You will see this workaround being applied in the AttributeCreator_ AdvancedVotingPoint transformer.
PDFStyler transformers are used for setting the appearance of the features that will appear in the final cartographic output.PDFStyler transformers can be used to style geometry (such as color,opacity,线条样式)和文本功能(如字体大小和样式)。
For our workspace,PdfStyler_签名,PDFStyler_Title and PDFStyler_AdvancedVotingLabel transformers are all used to set the text color,font size and style.PdfStyler_高级投票点,PdfStyler_边界框,使用pdfStyler_DivisionPolysTransformers设置多边形的颜色和不透明度,点and bounding box features.
Features must be sent to the PDF writer in the order of how they will be drawn.As each layer is output,它将从下到上绘制在相应的PDF层中。Sorter Transformer只使用“_order”属性(在步骤2中指定)按升序对从pdfStyler Transformers输出的功能进行排序。结果是背景图放在底部,先进的投票标签放在我们地图的顶部。
The PDFPageFormatter is a graphical interface that is useful for setting the page size and frames (for the drawing objects) in the final PDF.通过右键单击输入端口并选择向上移动,可以更改帧的顺序。或者向下移动。
For our example,使用pdfPageFormatter绘制三帧:“签名”,“标题”和“主要”。‘Signature' and ‘Title' receive the output from the Creator transformers.“主”接收来自分拣机变压器的输出,并包含我们所有的映射信息。具有重叠特征类型的所有映射信息必须放置在同一帧中,(i.e.“主”否则,比例和地图范围将不匹配/不一致。
Note:光栅图像,多边形和点必须始终发送到同一帧,以确保数据正确缩放。只有在地图不占用相同范围和位置的情况下,才应使用单独的地图信息框架;(例如)插图)。
使用扇出将所有要素类型写入各个图层。This is done by renaming the PDF Writer layer name to ‘fme_feature_type',并允许在PDF文档中根据需要打开或关闭每个单独的功能层。
The completed workspace:
数据属性
此处使用的数据源于温哥华市,不列颠哥伦比亚省。It contains information licensed under the Open Government License - Vancouver.
?2019安全亚搏在线软件公司|Legal