span8
span4
span8
span4
***Note: For an up-to-date article please refer toCreating PDF Cartographic Output (2016).
This article demonstrates how to create cartographic output in a PDF file by merging spatial data into a pre-defined map frame.
This article describes a method by which to create PDF cartographic outputs such as this:
The basic methodology is to read a map frame into FME,fit the required area of data into that frame,style the features,update the text fields,and then write to PDF.
In this example the source map frame is stored in a Microstation DGN (Design) file.It looks like this:
Notice how there are predefined boxes for the edge of the plot,the edge of the data,and for various inset boxes.There are also default text values which are to be replaced with the real content.
Note that the DGN frame units are inches.The outer boundary is 11 x 8.5 inches,meaning it will fit a letter-sized piece of paper.
The workspace to carry out the translation to PDF looks like this:
Although it is quite large,it is not as complex as it looks.It can be broken down into several sections.
Here an inset box for a logo is read in from the DGN.Also read in is a graphics file for that logo.The extents of the logo box are extracted and the logo fitted into that space with the RasterGeoreferencer transformer.
Section 2 includes just a couple of frame features that need to be read and styled,but then written to PDF with no other alteration.
Section 3 handles text:
The text is read and styled first of all.The PDFTextMapper custom transformer is where the default values in the DGN frame are replaced with new values.These new values may come from user input (published parameters),from a transformer (TimeStamper),or elsewhere.
The next section is where it becomes more complex (and interesting).There is a grid dataset with a set of pre-defined map sheets.The user is able to select which map sheet to map.The chosen sheet is used as a spatial boundary for reading the real features;a FeatureReader transformer is used to do this.
Once the features are read,they are styled and sorted into order.The sorting is done to ensure all features are shown in the correct order in the output.Features below all others must reach the PDF writer first of all.In this case the key is to ensure that property boundaries are written before buildings,so the buildings appear above the properties.
The data is then fitted into the given map sheet outline:
This action is done inside a custom transformer called the MapTileFeatureWarper.The user can optionally provide a limits box for the data.If they do the data can be clipped to this boundary.If this limit is not supplied then the data will be warped to the extents of the map frame as they are;this could lead to differences in the X and Y scales if the data extents do not have the same x/y ratio as the frame.
The final part of the workspace handles the inset map.This is comprised of all the tiles that are available for input.The tiles are warped into the extents of the inset map frame,with the chosen tile being highlighted with a different styling.
As a final step,various parameters are published so the user can customize the output:
Running the workspace then produces the output as shown at the top of this page.
Nice article.
But can this be extended with an example of how to use the new PDFPageFormatter to get to the same output?That transformer seems to be simplifying this process.
@erik_janThanks for the feedback.This is an older article that definitely needs updating.We'll be doing so in the next couple of weeks.
Is there any way to add any of the background maps availible in the data inspector to the pdf output?
Hi@mapdogWe have some readers to that read directly from web services (e.g.Esri ArcGIS Online).In this case you would add the reader to your workspace and direct the features to the PDF writer.Or,for web services for which a reader is not available,try the HTTPCaller transformer.This article summarizes how FME works with web serviceshttps://knowledge.亚搏在线safe.com/content/kbentry/1543/getting-started-with-fme-and-the-web.html
Hi!Thanks for this great example.But there's something "magic" here.The custom transformer MapTileFeatureWarper is impossible to find on FME hub and the workspace is not downloadable...在某种程度上,you need to scale or "warp" features to the map extent.Is it possible to find the transformer?Is there an aternative approach?
Sorry@inspecteurgadge- that custom transformer is not available.The newer approach is to use the PDFPageFormatter.We are working on getting some more up to date PDF articles online.
Creating Charts with FME | ChartGenerator
MicroStation Text Styles in FME 2015.1 and newer
MicroStation Text Styles in FME 2015.0 and older
Excel Provider error (-2147467259) Spreadsheet is full (FME 2013 and earlier)
How to retain CAD symbology and text in database formats
Overview of Excel Writer Parameters
Writing Microstation (DGN) Text Nodes with FME
MS Excel Error: Failed to open writer (FME 2013 SP1 and earlier)
© 2019 亚搏在线Safe Software Inc |Legal