Solved

Extract polygon countour


Badge
I have raster grid from which I want to extract contours. I know polyline contours are fairly easy to extract but what I need is the polygon contours.

 

 

Is there any way in FME to extract polygon contours out of raster grid?

 

 

 

Using Professional Edition 64/32 on Windows 7 64bit

 

 

 
icon

Best answer by gio 6 October 2015, 18:08

View original

11 replies

Badge +3
Depends on the raster. If it has like a zillion colors or high antialiasing you might want to copy it and then preproces the copy.

 

For instance reduce colors using inkscape or gimp.

 

 

you could then use a reasterexpressionevaluator to query the color of the polygon (assuming it has a unique color in the grid.) Then set all others to nvd (novalue) then a rasterpolyycoercer and then dissolving.

 

 

 
Badge
Thanks for your answer. This is a GMTED2010 raster which is available here http://topotools.cr.usgs.gov/gmted_viewer/gmted2010_global_grids.php

 

 

Correct me if I am wrong, I think your solution will not work on these grids.
Userlevel 2
Badge +17
Hi,

 

 

An idea.

 

Round the cell values with a RasterCellValueRounder (if you set -2 to the Decimal Places parameter, cell values will be rounded by 100 place).

 

Transform the raster to polygons with a RasterToPolygonCoercer.

 

If necessary, make the boundaries smooth with a Generalizer (McMaster algorithm, Preserve Shared Boundaries: Yes).

 

 

Takashi
Badge +3
Hi,

 

 

Yes i would not advise doing that on this type of grid. ;_)

 

 

FME contourgenereator is supposed to be able to handle rasters.

 

I tried a extent of 2400X2400 pixel to countourinterval of 1000. This conversion took 39 secs.

 

 

This is just a reader for the grid and a contourgenerator.

 

 

These grids are large, you would want to tile the raster, or read it in in smaller tiles (create user parameters for the search envelope in the navigator  and or use a ).It's simply large.

 

 

 

 

 
Badge +3
tolerance 0.5 , interval 500 and linejoiner took 49secs.
Badge
Yes it is large, not doubt about that. But I think FME 64bit can porcess this grid with out any problems.

 

Yes FME contourgenerator can produce countours, but the output is polyline and my task is to produce polygon.
Badge +3
that is why i added a linejoiner. It will close all contours wich are "complete".

 

The an Areabuilder.

 

 

 

 

Incompletes are at the edge of the extent.

 

In a worksbench i have made to exract levels of groundwater i do following:

 

I extract the hull with a hullacumulator and intersect this with the contour lines.

 

then i create areas with areabuilder. (maybe some snapping and linejoiner will be required, depending on data)

 

This gives  fully closed contourplates.

 

I also order the contourplates to sort the highest on top (in case you want to do an AreaOnArea overlay)

 

 

In the pic i have not done that (yet though)
Badge +3
Hi again,\\

 

 

Here is contours to fullcoverage area..\\

 

 

 

 

 

This is a simple workbench

 

 

 
Badge +3
..workbench pic,

 

 

Joining in posted pic was not done with elevation. because you can not know if the boundary intersects contours with same elevation.

 

 

If you use elevation, you must at least use a higher contour density.

 

Here is same area with elavation as group by parameter. As you can see the result will not fully close. As the boundingboxboundary has no elevation of its own.

 

Data is sorted by elevation descending.

 

 

 

 

 

 

 
Badge +3
i tried it with density 50, this took 5 mins and covers much more area.

 

 

Now it is running on density 10..it is at over 3 million contourlines and still running strong...lol.

 

 

;)
Badge
Sorry for dely in my reply.

 

 

Yes it works like a charm on small area, now I am processing the whole area.

Reply