Solved

Rasterizing a polygon

  • 31 January 2013
  • 4 replies
  • 12 views

Badge
Hello -

 

I want to do something that seems a simple operation but doesn't really work. 

 

 

I got a file geodatabase that holds polygons with several attributes. One of them is date, another is a value. Each date has several polygons based on value. For each date, these polygons don't overlap. 

 

 

I want to transform these polygons to a GeoTiff. The name of the geotiff should be the date and the value of a pixel should correspond with the value found in the polygon that can be found on that location for that date. 

 

 

I've looked at: http://fmepedia.safe.com/articles/Samples_and_Demos/Converting-Vector-data-to-Raster 

 

 

Example 1 doesn't seem to be working for me. Example two and three might but I'm not sure which one to use. Any suggestions? 

 

 

I got FME2012
icon

Best answer by davideagle 31 January 2013, 12:09

View original

4 replies

Badge +14
Hi - Not sure what you need to do with the Value, but I think the key to this process for you is the Fanout on the Writer. First make sure you apply a group on the Rasterizer to ensure multiple features exit in their Rasterized Groups. Then use the Fanout to create the separate images.

 

 

A final note of warning, don't try to view a GeoTiff in a standard Windows paint package... they don't like them, use the Universal Viewer to check what you have is what you want.

 

 

I've put a sample workspace here for you as a starting point:

 

 

http://goo.gl/MPxXC
Badge
Hey Dave,

 

Thanks for the blazing fast reply again! 

 

If i understand it correclt, what I need to do is to set the color for each value indivdually. I have about 10 classes so that's not too bad, I was constantly messing around with this conversion and just tried to avoid it altogether, but it's not that hard! Thanks a lot. 
Badge +14
To set the colour just use an AttributeValueMapper. Set it to read from the Date field and then essentially, if Date = 01/02/2013 set fme_fill_colour = 1,0,0 (red) etc. That will save you having lots of Transformers.

 

 

No worries.
Userlevel 4
Badge +13
Hi,

 

 

If you use the schemamapper to do the color mapping you can effectivly make the all process more flexible. This way the number of features and their values can change by editing an external file and prevent you from constantly making these changes in the workspace.

 

Hope this helps.

 

/I

Reply