span8
span4
span8
span4
Previous: Modify Raster Cell Size by Resampling
In this tutorial, you will learn how to select an area and change the values of raster cells by overlaying a polygon onto a raster dataset. This can be easily accomplished in FME using theMapnikRasterizer, an existing raster dataset, and point, line, or polygon features.
changing-raster-values-by-geographic-feature.fmwt
Note: Since you areworking on a public facing database, tables can occasionally be overwritten and/or modified. If your translation produces unexpected results, see theResetting the PostGIS Training Databasearticle.或者,您可以下载提供的文件(s) and replace the PostGIS reader with a reader of the appropriate format.
在这种情况下,你会重新分类基于这样的公园多边形覆盖城市细胞的区域的栅格单元。这将改变来自频带值[频带0:0],[带1:0],[频带2:0],[频带3:255]到[频带0:0],[1波段:255],[带2:0],[频带3:255],其中公园多边形覆盖栅格单元在VancouverLand数据集。
The MapnikRasterizer allows you to convert point, line, and/ polygon features onto a new or existing raster by dividing features into groups called layers. For more information see theMapnikRasterizer Documentation.
Notice how the two connections are listed in the Rendering Rules; however, they are set as Line symbols. Since you are classifying raster values by park polygons, you need to change the symbolizers for both of the Rendering Rules.
Important: ensure the rendering rules are ordered as they are in the screenshot above otherwise the urban cells will be created on top of the park cells. The urban cells need to be classified first, followed by the park cells so they appear on the output raster. You can adjust the ordering of the rendering rules using the move up/down arrows below the Rendering Rules box.
Smoothing is used to control whether the output will have to follow Boolean or Fuzzy logic. A Smoothing Gamma value of 1 uses Fuzzy logic which is useful for areas with movement or uncertainty such as a shoreline. Alternatively, a Smoothing Gamma value of 0 uses Boolean logic which is useful when you want to classify cells with 100% certainty. This exercise will use Boolean Logic so cells will be classified as either urban or park - this will prevent cells from being classified as 20% park and 80% urban.
Fuzzy Logic
Boolean Logic
单元格间距参数指定的宽度the output raster cells, measured in ground units. Note: smaller cells provide greater resolution, however, they typically take longer to load when viewing large extents (i.e. a cell spacing of 1 will take longer to load than 5) and also have large file sizes.
An Automatic Attribute Definition is when Workbench automatically defines the list of attributes, depending on which Reader feature types are connected, for more information see theAbout Writer Feature Types: User Attributesdocumentation.
After running the translation, the output will be displayed in the FME Data Inspector. Notice the park cells have been classified using the Raster Bands (Band 0-3) and urban areas are black.
Data used in this tutorial originates from open data made available by theCity of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.
© 2019 Safe Software Inc |Legal