Skip to main content
Solved

Extract polygon countour

  • October 1, 2015
  • 11 replies
  • 234 views

Forum|alt.badge.img
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

 

 

 

Best answer by gio

..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.

 

 

 

 

 

 

 
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

11 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 1, 2015
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.

 

 

 

Forum|alt.badge.img
  • Author
  • October 1, 2015
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.

takashi
Celebrity
  • October 2, 2015
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

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 2, 2015
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.

 

 

 

 

 

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 2, 2015
tolerance 0.5 , interval 500 and linejoiner took 49secs.

Forum|alt.badge.img
  • Author
  • October 2, 2015
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.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 6, 2015
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)

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 6, 2015
Hi again,\\

 

 

Here is contours to fullcoverage area..\\

 

 

 

 

 

This is a simple workbench

 

 

 

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Best Answer
  • October 6, 2015
..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.

 

 

 

 

 

 

 

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 6, 2015
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.

 

 

;)

Forum|alt.badge.img
  • Author
  • October 9, 2015
Sorry for dely in my reply.

 

 

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